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.
If you want to compile the package optimized for your CPU, you need to install the package from the Source Distribution. In order to do that you need to have the Rust toolchain installed. Use the following commands:
Install Rust (via rustup):
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shActivate nightly:
rustup install nightly
rustup default nightlyRUSTFLAGS="-C target-cpu=native" pip install --no-binary :all: kannoloThis will compile the Rust code tailored for your machine, providing maximum performance.
If you are not interested in obtaining the maximum performance, you can install the package from a prebuilt Wheel.
If a compatible wheel exists for your platform, pip will download and install it directly, avoiding the compilation phase.
If no compatible wheel exists, pip will download the source distribution and attempt to compile it using the Rust compiler (rustc).
pip install kannoloThis command allows you to compile all the Rust binaries contained in src/bin
RUSTFLAGS="-C target-cpu=native" cargo build --releaseDetails 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.
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.
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.
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"
}