Skip to main content

kANNolo

kANNolo is a research-oriented library for Approximate Nearest Neighbors (ANN) search written in Rust 🦀. It is explicitly designed to combine usability with performance effectively. Designed with modularity and researchers in mind, kANNolo makes prototyping new ANN search algorithms and data structures easy. kANNolo supports both dense and sparse embeddings seamlessly. It implements the HNSW graph index and Product Quantization.

Python Installation

Quick start (prebuilt wheels)

For most users, this is the easiest option:

pip install kannolo

The prebuilt wheel includes dense and sparse HNSW indexes. If a compatible wheel exists for your platform, pip downloads and installs it directly. If not, pip compiles from source.

To use multivector reranking (SparseMultivecRerankIndex, SparseMultivecTwoLevelsPQRerankIndex), build from source with the multivec feature enabled (see Building from source below).

Building from source (maximum performance)

For maximum performance optimized to your CPU, build from source. Choose one of the two approaches below:

Shared Prerequisites

Both building approaches require Rust and nightly:

  1. Install Rust (via rustup):
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  1. Activate nightly:
rustup install nightly
rustup default nightly

Approach 1: Build from PyPI source

Compile and install directly from PyPI with CPU optimization (dense and sparse indexes only):

RUSTFLAGS="-C target-cpu=native" pip install --no-binary :all: kannolo

This installs the package in your system/virtual environment site-packages. For multivector reranking support, use Approach 2 instead.

Approach 2: Build from GitHub (development mode)

Clone the repository and build for development/modification:

  1. Clone and prepare:
git clone https://github.com/TusKANNy/kannolo.git
cd kannolo
  1. Create a virtual environment (recommended):
python3 -m venv ./venv
source ./venv/bin/activate  # On Windows: venv\Scripts\activate

Alternatively, use conda:

conda create -n kannolo python=3.11
conda activate kannolo
  1. Install maturin:
pip install maturin
  1. Build and install in editable mode:

    Dense and sparse indexes only (default, lighter build):

    RUSTFLAGS="-C target-cpu=native" maturin develop --release
    

    With multivector reranking support (SparseMultivecRerankIndex, SparseMultivecTwoLevelsPQRerankIndex):

    RUSTFLAGS="-C target-cpu=native" maturin develop --release --features multivec
    

Why use editable mode? Changes to Python code take effect immediately without reinstalling. Perfect for development and prototyping.

  1. Verify installation:
python -c "import kannolo; print('Successfully installed kannolo!')"

Rust

The crate exposes three feature flags:

Feature What it enables Default
multivec Multivector reranking indexes (SparseMultivecRerankIndex, SparseMultivecTwoLevelsPQRerankIndex) and the hnsw_rerank_search CLI binary No
python PyO3 bindings — activated automatically by maturin when building the Python wheel No
cli CLI binaries: hnsw_build, hnsw_search, hnsw_rerank_{build,search}_{dense,sparse}, ivf_build, ivf_search (combine with multivec to also get hnsw_rerank_search) No

If you want to compile the library only (dense and sparse indexes, no multivec, no binaries):

RUSTFLAGS="-C target-cpu=native" cargo build --release

If you want the CLI binaries hnsw_build, hnsw_search, the two-stage hnsw_rerank_{build,search}_{dense,sparse}, ivf_build and ivf_search (dense and sparse):

RUSTFLAGS="-C target-cpu=native" cargo build --release --features cli

If you want multivector reranking in the library (adds SparseMultivecRerankIndex and SparseMultivecTwoLevelsPQRerankIndex):

RUSTFLAGS="-C target-cpu=native" cargo build --release --features multivec

If you want all CLI binaries including hnsw_rerank_search:

RUSTFLAGS="-C target-cpu=native" cargo build --release --features "cli,multivec"

The resulting binaries are placed in target/release/.

Details on how to use kANNolo's core engine in Rust 🦀 can be found in docs/RustUsage.md.

Details on how to use kANNolo's Python interface can be found in docs/PythonUsage.md.

Resources

Check out our docs folder for a more detailed guide on how to use kANNolo directly in Rust, replicate the results of our paper, or use kANNolo with your custom collection.

📚 Bibliography

Leonardo Delfino, Domenico Erriquez, Silvio Martinico, Franco Maria Nardini, Cosimo Rulli and Rossano Venturini. "kANNolo: Sweet and Smooth Approximate k-Nearest Neighbors Search." Proc. ECIR. 2025.

Citation License

The source code in this repository is subject to the following citation license:

By downloading and using this software, you agree to cite the under-noted paper in any kind of material you produce where it was used to conduct a search or experimentation, whether be it a research paper, dissertation, article, poster, presentation, or documentation. By using this software, you have agreed to the citation license.

ECIR 2025

@InProceedings{10.1007/978-3-031-88717-8_29,
author =    "Leonardo Delfino and
             Domenico Erriquez and
             Silvio Martinico and
             Franco Maria Nardini and
             Cosimo Rulli and
             Rossano Venturini",
title =     "kANNolo: Sweet and Smooth Approximate k-Nearest Neighbors Search",
booktitle = "Advances in Information Retrieval",
year =      "2025",
publisher = "Springer Nature Switzerland",
pages =     "400--406",
isbn =      "978-3-031-88717-8"
}

Metadata

Release files for kannolo 0.13.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kannolo 0.13.0
File Size Uploaded Provenance Actions
kannolo-0.13.0.tar.gz 758.7 kB Without provenance Details for kannolo-0.13.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for kannolo 0.13.0
File Actions
kannolo-0.13.0-cp313-cp313-manylinux_2_34_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.34+ x86-64 Details for kannolo-0.13.0-cp313-cp313-manylinux_2_34_x86_64.whl
kannolo-0.13.0-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details for kannolo-0.13.0-cp313-cp313-macosx_11_0_arm64.whl
kannolo-0.13.0-cp313-cp313-macosx_10_12_x86_64.whl CPython 3.13 CPython 3.13 macOS 10.12+ x86-64 Details for kannolo-0.13.0-cp313-cp313-macosx_10_12_x86_64.whl
kannolo-0.13.0-cp312-cp312-manylinux_2_34_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.34+ x86-64 Details for kannolo-0.13.0-cp312-cp312-manylinux_2_34_x86_64.whl
kannolo-0.13.0-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details for kannolo-0.13.0-cp312-cp312-macosx_11_0_arm64.whl
kannolo-0.13.0-cp312-cp312-macosx_10_12_x86_64.whl CPython 3.12 CPython 3.12 macOS 10.12+ x86-64 Details for kannolo-0.13.0-cp312-cp312-macosx_10_12_x86_64.whl
kannolo-0.13.0-cp311-cp311-manylinux_2_34_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.34+ x86-64 Details for kannolo-0.13.0-cp311-cp311-manylinux_2_34_x86_64.whl
kannolo-0.13.0-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details for kannolo-0.13.0-cp311-cp311-macosx_11_0_arm64.whl
kannolo-0.13.0-cp311-cp311-macosx_10_12_x86_64.whl CPython 3.11 CPython 3.11 macOS 10.12+ x86-64 Details for kannolo-0.13.0-cp311-cp311-macosx_10_12_x86_64.whl
kannolo-0.13.0-cp310-cp310-manylinux_2_34_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.34+ x86-64 Details for kannolo-0.13.0-cp310-cp310-manylinux_2_34_x86_64.whl
kannolo-0.13.0-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details for kannolo-0.13.0-cp310-cp310-macosx_11_0_arm64.whl
kannolo-0.13.0-cp310-cp310-macosx_10_12_x86_64.whl CPython 3.10 CPython 3.10 macOS 10.12+ x86-64 Details for kannolo-0.13.0-cp310-cp310-macosx_10_12_x86_64.whl

Total release size: 17.7 MB

Release files / kannolo-0.13.0.tar.gz

Download URL kannolo-0.13.0.tar.gz
Size 758.7 kB
Tags Source
SHA-256 checksum
How to use checksums
d7fb414eddf5b33dbd7cb47f61bb1fe1b4145137d5a98fbf32411fe5f6d8f686
BLAKE2b-256 checksum
How to use checksums
bbf24290eef1c109d519df178815ed8687204eb251b05c38364356389a7ece1a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / kannolo-0.13.0-cp313-cp313-manylinux_2_34_x86_64.whl

Download URL kannolo-0.13.0-cp313-cp313-manylinux_2_34_x86_64.whl
Size 1.6 MB
Tags CPython 3.13 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
e6ced13ce908bafa4b2af1f46c6c4e2764d2a406a3d7fc0fb17132b66b432ef5
BLAKE2b-256 checksum
How to use checksums
b1be3b5e6fa8d2c0a03583afedaa9bc357fc4ddcd102fc787a9227f7af56f681
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / kannolo-0.13.0-cp313-cp313-macosx_11_0_arm64.whl

Download URL kannolo-0.13.0-cp313-cp313-macosx_11_0_arm64.whl
Size 1.2 MB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
1cabea67b0b0da154c815c311cd8cc44ed8e04b374049b956e989b5537482d9d
BLAKE2b-256 checksum
How to use checksums
7b209291c739d1fe81694c74b7fedac30799a2231b77ff1788af9ae219d2a91b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / kannolo-0.13.0-cp313-cp313-macosx_10_12_x86_64.whl

Download URL kannolo-0.13.0-cp313-cp313-macosx_10_12_x86_64.whl
Size 1.5 MB
Tags CPython 3.13 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
3f1f1bef6a1767932265f4c94bdc3cae767b57f860ab507f2f26f52b2b34ce1f
BLAKE2b-256 checksum
How to use checksums
8ae35cf1010b06319cd2f936a31e0e699ce7a98463c72bb52835b5a5d476955a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / kannolo-0.13.0-cp312-cp312-manylinux_2_34_x86_64.whl

Download URL kannolo-0.13.0-cp312-cp312-manylinux_2_34_x86_64.whl
Size 1.6 MB
Tags CPython 3.12 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
e1c175b841ec8f1480185982d96ced4acb03e9542e5b128a468d62641fa70e54
BLAKE2b-256 checksum
How to use checksums
03ec60d8a598f44e9062545bb68e6860641d40cebdc0f04dc0c07e35e1378b56
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / kannolo-0.13.0-cp312-cp312-macosx_11_0_arm64.whl

Download URL kannolo-0.13.0-cp312-cp312-macosx_11_0_arm64.whl
Size 1.2 MB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
59305c8d1825dc24d34a271efe5d9fe457488cffebdce3d6ff05c8bbe78246fd
BLAKE2b-256 checksum
How to use checksums
1f9d776106785fa4678e91e91c81dd5074d2e89ef3630014f21699b994df16fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / kannolo-0.13.0-cp312-cp312-macosx_10_12_x86_64.whl

Download URL kannolo-0.13.0-cp312-cp312-macosx_10_12_x86_64.whl
Size 1.5 MB
Tags CPython 3.12 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
74c8fb1c2a47eef247a5a500577001da7c7c34cd4aaafcc351c788b59cf55475
BLAKE2b-256 checksum
How to use checksums
035eceb87c0bed04cde42537f76aba40b36948c7a24eaf4fded6405f5e321c25
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / kannolo-0.13.0-cp311-cp311-manylinux_2_34_x86_64.whl

Download URL kannolo-0.13.0-cp311-cp311-manylinux_2_34_x86_64.whl
Size 1.6 MB
Tags CPython 3.11 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
d03e36f4ecc8cbd0cd4c4e44629cc0128fe1f15ff45b83b9e8a63c1f4f6f3e9e
BLAKE2b-256 checksum
How to use checksums
6432e5c903633d4253f1433b411469f981b0b32179ff21700ef9a897d2bd6b8f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / kannolo-0.13.0-cp311-cp311-macosx_11_0_arm64.whl

Download URL kannolo-0.13.0-cp311-cp311-macosx_11_0_arm64.whl
Size 1.2 MB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
cf860260b033f007595635ee338a88888d8f7b9f1e8c6cd3ab93bb22664e8a25
BLAKE2b-256 checksum
How to use checksums
29026218c33fc40a735665f72a4213afc51b067bd4adc22adbcf4ad14adb0447
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / kannolo-0.13.0-cp311-cp311-macosx_10_12_x86_64.whl

Download URL kannolo-0.13.0-cp311-cp311-macosx_10_12_x86_64.whl
Size 1.5 MB
Tags CPython 3.11 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
722130ce435bfb99092fd0a9d7fe9b8fbd0083184c077a77cb7b5179aa7c70c7
BLAKE2b-256 checksum
How to use checksums
64d5078d489fa6839ac113bdee258306140624a01494bc688f1e522af0422db0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / kannolo-0.13.0-cp310-cp310-manylinux_2_34_x86_64.whl

Download URL kannolo-0.13.0-cp310-cp310-manylinux_2_34_x86_64.whl
Size 1.6 MB
Tags CPython 3.10 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
87c8b277441a966aceb125cffee670ef9822c8fd893f264e35fcf00d41a4a559
BLAKE2b-256 checksum
How to use checksums
571f82374bf57d87592b523fea141f6a218ae39a130848d6cc66655f4f35449c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / kannolo-0.13.0-cp310-cp310-macosx_11_0_arm64.whl

Download URL kannolo-0.13.0-cp310-cp310-macosx_11_0_arm64.whl
Size 1.2 MB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
0a2766915d779142ed7d47afd30c26307ef5b452f65ce653925d647bc47f0bd1
BLAKE2b-256 checksum
How to use checksums
d105185b840e01c3808ae45a8f8c6dc3a7d1593248b76154cbb20f4217c049e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / kannolo-0.13.0-cp310-cp310-macosx_10_12_x86_64.whl

Download URL kannolo-0.13.0-cp310-cp310-macosx_10_12_x86_64.whl
Size 1.5 MB
Tags CPython 3.10 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
b3226708107ebaa12b463cb87681923c1343a6e60e9c40e3a926bed0b74d5806
BLAKE2b-256 checksum
How to use checksums
c240712dcee6bc8a47d0f7812178ab60d324f2a8929390095fa4034cd1a93dfb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Security for kannolo 0.13.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.13.0 This release

13 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page