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.14.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.14.0
File Size Uploaded Provenance Actions
kannolo-0.14.0.tar.gz 762.2 kB Without provenance Details for kannolo-0.14.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for kannolo 0.14.0
File Actions
kannolo-0.14.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.14.0-cp313-cp313-manylinux_2_34_x86_64.whl
kannolo-0.14.0-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details for kannolo-0.14.0-cp313-cp313-macosx_11_0_arm64.whl
kannolo-0.14.0-cp313-cp313-macosx_10_12_x86_64.whl CPython 3.13 CPython 3.13 macOS 10.12+ x86-64 Details for kannolo-0.14.0-cp313-cp313-macosx_10_12_x86_64.whl
kannolo-0.14.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.14.0-cp312-cp312-manylinux_2_34_x86_64.whl
kannolo-0.14.0-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details for kannolo-0.14.0-cp312-cp312-macosx_11_0_arm64.whl
kannolo-0.14.0-cp312-cp312-macosx_10_12_x86_64.whl CPython 3.12 CPython 3.12 macOS 10.12+ x86-64 Details for kannolo-0.14.0-cp312-cp312-macosx_10_12_x86_64.whl
kannolo-0.14.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.14.0-cp311-cp311-manylinux_2_34_x86_64.whl
kannolo-0.14.0-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details for kannolo-0.14.0-cp311-cp311-macosx_11_0_arm64.whl
kannolo-0.14.0-cp311-cp311-macosx_10_12_x86_64.whl CPython 3.11 CPython 3.11 macOS 10.12+ x86-64 Details for kannolo-0.14.0-cp311-cp311-macosx_10_12_x86_64.whl
kannolo-0.14.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.14.0-cp310-cp310-manylinux_2_34_x86_64.whl
kannolo-0.14.0-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details for kannolo-0.14.0-cp310-cp310-macosx_11_0_arm64.whl
kannolo-0.14.0-cp310-cp310-macosx_10_12_x86_64.whl CPython 3.10 CPython 3.10 macOS 10.12+ x86-64 Details for kannolo-0.14.0-cp310-cp310-macosx_10_12_x86_64.whl

Total release size: 17.8 MB

Release files / kannolo-0.14.0.tar.gz

Download URL kannolo-0.14.0.tar.gz
Size 762.2 kB
Tags Source
SHA-256 checksum
How to use checksums
04f8c32e88233d0bec132cf0574ef34b1a2c8b0c04f2104bd45abaf0d2173e32
BLAKE2b-256 checksum
How to use checksums
074e95a45eff3a277d41483b14ba93d7f333fddf277d94c67d8807d612b662f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

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

Download URL kannolo-0.14.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
9d1f1943761a7b9071f43208e3e263ea5399204b43661ad0495be3d35819218b
BLAKE2b-256 checksum
How to use checksums
43b91a8eb4a550ea4e7abf2b6c3a812bd8e4acf23cdda15c307248c182700ba9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

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

Download URL kannolo-0.14.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
26c85322bbfe4f102860c48aed146cf2055bd656dfe93373c146761094904bb7
BLAKE2b-256 checksum
How to use checksums
0814511d9e575c28e305f13ffb0869ba3ab697ea159e499e492cfad3df4c29db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

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

Download URL kannolo-0.14.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
053306df731fe78c1418acd73a782e891a9c8a3053384ae8def3421d91f655cd
BLAKE2b-256 checksum
How to use checksums
08685f920c7ce0ce5b6a6db6198bc7fd94ad09f16007ab7b2a512d0d238848f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

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

Download URL kannolo-0.14.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
e91198a9d15c6199b3f709e787c183cfafd15dd5d26753e9eb0300ddb52f76cd
BLAKE2b-256 checksum
How to use checksums
5d44b637df8e50bd7efda48e6519afbe87a1df0b7bd4a14bc3fd0ca6ada69376
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

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

Download URL kannolo-0.14.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
ab78b1cd0219c01e370bb145603dcc9624db0088cdf43d407960364f803856bd
BLAKE2b-256 checksum
How to use checksums
7302e8dbe167f1fb6848da3b899d81c1a457c7600bb6db08a73c2cf2a5823d9f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

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

Download URL kannolo-0.14.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
40f48fa7cfb15f3f007d36399b68f1e0948cf6c7ec4a5db37195ffeb23570232
BLAKE2b-256 checksum
How to use checksums
6e64aaa7b580dedb90e8c2b3c80bbcc125a28b38cdc5b780587bfedb8f2a4d94
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

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

Download URL kannolo-0.14.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
8fc48295902b258e1ad778096dba1db101f7856692077b6decd941ad7299b25b
BLAKE2b-256 checksum
How to use checksums
dc2f2f4cda396acfd998e848d5f00ef3f59f7a6a2c051af005e3968285f03716
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

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

Download URL kannolo-0.14.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
2758ff107b0a9a990e2db22326ecc25332b1c527762a07ebc775182a7cdfca88
BLAKE2b-256 checksum
How to use checksums
aa521cc28cd26140984a5c4617c82826c66d560741c65f34d465cceffd5d30fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

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

Download URL kannolo-0.14.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
583abf823d505f8b5fa2e74ea2dc4695ec15e5d1ff9d575bd84d2860e8d13619
BLAKE2b-256 checksum
How to use checksums
190719d7ee6178bb757d117692bfca5eba831470515461967e8dfa9cfe050abb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

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

Download URL kannolo-0.14.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
28152b7d1716e9239942211eca8f648e69d7f731961a722922f24a5a7078bb7f
BLAKE2b-256 checksum
How to use checksums
53ba72afd857e3fae7dd01a6b5e8bea0d1062d12630295902ea48634286f2bdb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

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

Download URL kannolo-0.14.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
b25f4a02d029f52d00ff5faef558cdcf8d4777fc2d43e22cadc6652cd3cf9f2c
BLAKE2b-256 checksum
How to use checksums
9d7af827fde590073c47e7a4cb2490b0c2c8f4376fa41467d1e0e06b51a45dc2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

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

Download URL kannolo-0.14.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
0c8598eec80df8ac66845299fb3d620c6acb16c13ff137b5c76a5a9412eea49a
BLAKE2b-256 checksum
How to use checksums
e8ece2caf99b0cc4638417266ef50ccffb20e0268b2826b0f4a307f49751ced0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for kannolo 0.14.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.14.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