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.15.1

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.15.1
File Size Uploaded Provenance Actions
kannolo-0.15.1.tar.gz 764.5 kB Without provenance Details for kannolo-0.15.1.tar.gz

Built distributions (wheels)

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

Total release size: 17.8 MB

Release files / kannolo-0.15.1.tar.gz

Download URL kannolo-0.15.1.tar.gz
Size 764.5 kB
Tags Source
SHA-256 checksum
How to use checksums
19b2fc20a335dc0d9d8e5f2c71399e5b929463ba19438c24da5642fc9f7a14d9
BLAKE2b-256 checksum
How to use checksums
c0c67d24fc598a65e788e4c1cdcfb843ebfe4f29fa8070d3b58a1a4bcab93463
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.15.1-cp313-cp313-manylinux_2_34_x86_64.whl

Download URL kannolo-0.15.1-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
a1da6e8f536a4e37de989fad5db9246d9f78b3eeabaeea2da9f0354df443de60
BLAKE2b-256 checksum
How to use checksums
502977ef505bec5e44a10c5997e14693f1128ce90c14a37ee66fff1b309f8a01
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.15.1-cp313-cp313-macosx_11_0_arm64.whl

Download URL kannolo-0.15.1-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
9eed1267897df9f3f772dcf631f46459ebed40492c05da0bc0209bdc5e436baf
BLAKE2b-256 checksum
How to use checksums
e2e0046ad97931b9a5bc156d8f63a9d58183fe9fc1855bf2c365f4593b12ca6b
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.15.1-cp313-cp313-macosx_10_12_x86_64.whl

Download URL kannolo-0.15.1-cp313-cp313-macosx_10_12_x86_64.whl
Size 1.4 MB
Tags CPython 3.13 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
98b2c7440fe3acca843c43a5c5dd6e774d4542441d8852437856a8d794bad691
BLAKE2b-256 checksum
How to use checksums
b1f24ebf7a9bc26c279fe30d1535cf5f38bb51380207f39b89d8327347b480b0
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.15.1-cp312-cp312-manylinux_2_34_x86_64.whl

Download URL kannolo-0.15.1-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
c3e9d84010b4d7354d5c85912312448449f50beec08996dc0cac8e86e33d79b9
BLAKE2b-256 checksum
How to use checksums
d3e72f296098638d783975df10c92f6096038e34208c01a419cdd50e3cd5fdb0
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.15.1-cp312-cp312-macosx_11_0_arm64.whl

Download URL kannolo-0.15.1-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
bf68a77355cade9524d5998c32f4e5e044cde822b33e1952ea5adae4fa7bf713
BLAKE2b-256 checksum
How to use checksums
36fe0af570b493cdf6366b20ecbfd268826713c0105fb19783f5f5ac40932e86
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.15.1-cp312-cp312-macosx_10_12_x86_64.whl

Download URL kannolo-0.15.1-cp312-cp312-macosx_10_12_x86_64.whl
Size 1.4 MB
Tags CPython 3.12 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
2ecec3491cd2a4850032577c92d8c3f0fe0cc2932fce71926254ff9f12215eb5
BLAKE2b-256 checksum
How to use checksums
b63cf47a615fea7f1c9b06cdfb16a099f270109ed80a045a49f14bf811372206
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.15.1-cp311-cp311-manylinux_2_34_x86_64.whl

Download URL kannolo-0.15.1-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
af1d885e0e93dbfe9de2e10976091e0a94e6b94b958aceef7ed2464a30333aea
BLAKE2b-256 checksum
How to use checksums
a35b7b3b2bfada9393228c42900cb8e1753d2835896dde3b20e4ac6034c2d12a
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.15.1-cp311-cp311-macosx_11_0_arm64.whl

Download URL kannolo-0.15.1-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
f0ab25973b7ad09d5c1c4f976b6fa1207c543106ec164e3eb9459fbad5186ca5
BLAKE2b-256 checksum
How to use checksums
8e7f38d0ec9e7e9bbd487f4b9b367aedc1920d1e233904a957bd12ae801988eb
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.15.1-cp311-cp311-macosx_10_12_x86_64.whl

Download URL kannolo-0.15.1-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
dabf9dc41932a9e597edd09b8ed65d2efaa25af83a2b7d55f218938029551c3a
BLAKE2b-256 checksum
How to use checksums
15ae4546c28d195ae630776a9aa87341c133372911886311e5c5794c442dc66e
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.15.1-cp310-cp310-manylinux_2_34_x86_64.whl

Download URL kannolo-0.15.1-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
9fd9379714192c5c903b55e0a8a0799b8e33d693d37492ff994af639a165438b
BLAKE2b-256 checksum
How to use checksums
c66a04e688d0be74f8c870f4703832ddf371d1e0e7e67e98621e16aa99772d05
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.15.1-cp310-cp310-macosx_11_0_arm64.whl

Download URL kannolo-0.15.1-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
a76b97b0c0fc480737c45592a075a79c67e237c65d5dc78c48cce793f8d33d7d
BLAKE2b-256 checksum
How to use checksums
60ee9b7224a2b4875323432e0f079d9ad657e0436b12048149dd9e317e72722a
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.15.1-cp310-cp310-macosx_10_12_x86_64.whl

Download URL kannolo-0.15.1-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
e526db78ed798eba365a101681d357c94456418caf604ac47a06ba3e1796e8c3
BLAKE2b-256 checksum
How to use checksums
08a777d9f2b68fbbe8ea8761dbe6d8e4979e0203e96c942696986aec5557ef50
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.15.1

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.15.1 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