Skip to main content

Python interface for the kANNolo library

Project description

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

If a compatible wheel exists for your platform, pip will download and install it directly without compilation. If no compatible wheel exists, pip will automatically compile from source.

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:

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

This installs the package in your system/virtual environment site-packages.

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:
RUSTFLAGS="-C target-cpu=native" maturin develop --release

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

This command allows you to compile all the Rust binaries contained in src/bin

RUSTFLAGS="-C target-cpu=native" cargo build --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"
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kannolo-0.4.6.tar.gz (649.6 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

kannolo-0.4.6-cp313-cp313-musllinux_1_2_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

kannolo-0.4.6-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (921.5 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

kannolo-0.4.6-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl (988.7 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ i686

kannolo-0.4.6-cp313-cp313-macosx_11_0_arm64.whl (758.1 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

kannolo-0.4.6-cp313-cp313-macosx_10_13_x86_64.whl (861.9 kB view details)

Uploaded CPython 3.13macOS 10.13+ x86-64

kannolo-0.4.6-cp312-cp312-musllinux_1_2_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

kannolo-0.4.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (921.6 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

kannolo-0.4.6-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl (988.9 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ i686

kannolo-0.4.6-cp312-cp312-macosx_11_0_arm64.whl (758.2 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

kannolo-0.4.6-cp312-cp312-macosx_10_13_x86_64.whl (862.0 kB view details)

Uploaded CPython 3.12macOS 10.13+ x86-64

kannolo-0.4.6-cp311-cp311-musllinux_1_2_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ x86-64

kannolo-0.4.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (924.4 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

kannolo-0.4.6-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl (991.8 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ i686

kannolo-0.4.6-cp311-cp311-macosx_11_0_arm64.whl (761.4 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

kannolo-0.4.6-cp311-cp311-macosx_10_12_x86_64.whl (867.7 kB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

kannolo-0.4.6-cp310-cp310-musllinux_1_2_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ x86-64

kannolo-0.4.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (924.5 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

kannolo-0.4.6-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl (991.9 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ i686

kannolo-0.4.6-cp310-cp310-macosx_11_0_arm64.whl (761.1 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

kannolo-0.4.6-cp310-cp310-macosx_10_12_x86_64.whl (867.7 kB view details)

Uploaded CPython 3.10macOS 10.12+ x86-64

File details

Details for the file kannolo-0.4.6.tar.gz.

File metadata

  • Download URL: kannolo-0.4.6.tar.gz
  • Upload date:
  • Size: 649.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for kannolo-0.4.6.tar.gz
Algorithm Hash digest
SHA256 db67e3ae0bb8c40ce625733a64149fdda56f1d48f53de8ec4b5021878bd57e02
MD5 78aa53b436249e3f2bc3820ca240b923
BLAKE2b-256 56a43c64cd77fc30b14ada87ae8adadc057ae4096093de923691a32db349d484

See more details on using hashes here.

File details

Details for the file kannolo-0.4.6-cp313-cp313-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for kannolo-0.4.6-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 6cac777fc6ea17ced85346f4125c8e359db9b815eaaf6304041ba3ef6ffda26b
MD5 80a94e18d7e3485e17cd12ff16b7a4b8
BLAKE2b-256 93bdf93c4d9c82e2849a0180af1db7cadfdd442dc64a20ddea5caec24c46bf5b

See more details on using hashes here.

File details

Details for the file kannolo-0.4.6-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for kannolo-0.4.6-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 df33cd0fbd37541d7794885830a3d9773bb58b6b1744b46eed2fd3794e8cb13c
MD5 d7dc2ff131be9a4548c262aa20e37fc2
BLAKE2b-256 8d36b2f139c294d60452d6d73778074597193da1022dd4549f781f3d00b88b0e

See more details on using hashes here.

File details

Details for the file kannolo-0.4.6-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for kannolo-0.4.6-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 39f31c393a4030f4a8c68790ce9cb14c75c9a8cbf2425f05d030119826810d15
MD5 d983bbe7bfcb7ef7cceb2cae132840b4
BLAKE2b-256 57effcf48176dcf607045580c821499d67d7d97c64e1c1396180a8f6f1b2f47d

See more details on using hashes here.

File details

Details for the file kannolo-0.4.6-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for kannolo-0.4.6-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a41d3d00ec040adf796227eff1437e0f3e71869355d081834b0e68e1ea1c8d24
MD5 230a65c49bd69d7ad1c05d772ff9d684
BLAKE2b-256 7fe3b44d69216b40423bbade62e62f01c9b700edf312c402620ba4e9de94bc2b

See more details on using hashes here.

File details

Details for the file kannolo-0.4.6-cp313-cp313-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for kannolo-0.4.6-cp313-cp313-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 5061c7900888d0df5566636d1e24371f97db450a05cbdebc014fe0a9bdf94b71
MD5 633a627c95662a70b65181d1e8a7d8d7
BLAKE2b-256 cf98c2935ce16a95f4f993d6eb670b7ff760be6aae6b9a0403eb2dbcd3b4fa76

See more details on using hashes here.

File details

Details for the file kannolo-0.4.6-cp312-cp312-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for kannolo-0.4.6-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 c076e8de6373adab25ddfd7fd2e7df018051d71340b5bc7d4c969f5585a12b2c
MD5 adcd5cfbab28f05d1bd56d457ab17fd7
BLAKE2b-256 1a07e654f0cf2f06ff7c1dd72af09e7faf9dacfc45e2c0795914230186dd9cc1

See more details on using hashes here.

File details

Details for the file kannolo-0.4.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for kannolo-0.4.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0e5d866e40a9d2333a11e722fabab3db5f6224c5a765e7a581482944aa362cb9
MD5 7b2763fa3fce62fff91f9298739db7e0
BLAKE2b-256 6b6899e253c8c538eda746cdabc5135091fb1eef86fb7fd03eea76c2ec3bf7e5

See more details on using hashes here.

File details

Details for the file kannolo-0.4.6-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for kannolo-0.4.6-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 27789d17a3e1a710fa4146be009d9499368ef9fc3ea3a69b8199aa9d231bf77b
MD5 8fb4f96f34ef9a55d6bd57be4ff68b76
BLAKE2b-256 4a4b4420cc046209ae3c33a04c1f8751912d3317fe335dbd53f30b4467171214

See more details on using hashes here.

File details

Details for the file kannolo-0.4.6-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for kannolo-0.4.6-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d7d1cee8f89c112b3d570cd5b3091bb1f314db9941e9e0b580b44be152be6717
MD5 827a91b7c67ddbdb4f93c57a3a1b19ca
BLAKE2b-256 280111222db47511f4cf67f451ab8191bafbd1c4977803f589bd6ea0aecf8249

See more details on using hashes here.

File details

Details for the file kannolo-0.4.6-cp312-cp312-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for kannolo-0.4.6-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 c379d193ea4ccfecd1b053dcdd938305861c5cb1630643271c1903d75e667ded
MD5 46a6f00f9124f64e7f14ee749567af89
BLAKE2b-256 597baaec7609eebebc7474f8defadc2c78bec30161c8bef5205063178dcbf366

See more details on using hashes here.

File details

Details for the file kannolo-0.4.6-cp311-cp311-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for kannolo-0.4.6-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 4c6d46d7228fc3323b9ee40af67c0663e9e92e93e4e3ab24fe6817506413e60f
MD5 faf6d7b2bf75b9dba3c4a8eecf6957a9
BLAKE2b-256 7fd4b0cfb4298467a832dde9adc08b6d2b991397d5f98dde2c593ff5903f38d8

See more details on using hashes here.

File details

Details for the file kannolo-0.4.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for kannolo-0.4.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 26910ead16b110fcdf5b1d4802c573e4f1a2e59bce73e717c290cf9f1e9c8ed6
MD5 5f8af8707c4f67001173947125abd678
BLAKE2b-256 abd0c352d9dfca1abb98e63ea7faef9afaf11d25282468294f086c6eedd025bb

See more details on using hashes here.

File details

Details for the file kannolo-0.4.6-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for kannolo-0.4.6-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 20c2ac025cd3179f4db9e33db0b1b2001a5ce9b7045ff4a34d1cfb480d5edc7a
MD5 ac0ceb465dee4ad48a3ea0c3c25e52ee
BLAKE2b-256 5560532117199b52fdd7e1dcd0a659fff4597283ef2fbd4f3deab0f556856004

See more details on using hashes here.

File details

Details for the file kannolo-0.4.6-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for kannolo-0.4.6-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 10b01893cd2659f47f5500b009a457772dc615475941067cfff91e6aba2a376c
MD5 fda886a39ad08fd9082d302cf8041cf0
BLAKE2b-256 09b80085eeb405e06e1a2bf6ec8f2d87bba8da784165da72ce53b4f942111da6

See more details on using hashes here.

File details

Details for the file kannolo-0.4.6-cp311-cp311-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for kannolo-0.4.6-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 0403fe05930a1e81b5b685cbf0f9378246a3864475a488fc82cd305fd5eb3345
MD5 ee5219f4937c97d9896fd7e9e14a40e7
BLAKE2b-256 02cc1061b5ca932ec35d91ae06e88502a0135240a8a4a1e1962fec526f5fb455

See more details on using hashes here.

File details

Details for the file kannolo-0.4.6-cp310-cp310-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for kannolo-0.4.6-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 33e8b11d8559374072c6ad8f9154229b3e61f7dfa81e2f194563e9e35fd73422
MD5 0073b4fe6fbd6505a574fe7806cfd0b6
BLAKE2b-256 ce7ae6054e36079634c1ed5812460a17e0684fbbab8b42ed090c951149faee70

See more details on using hashes here.

File details

Details for the file kannolo-0.4.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for kannolo-0.4.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9016c40dd73dfcfe95bfe0974f3283f42d6943caf0a0f5f2f08903a09d7be10e
MD5 298bb6a5488914daae47b62cc2d07c35
BLAKE2b-256 a3fea615fce28f0793604591e1e22cdb6b3456902c33b9adbd3c49c5d403dd61

See more details on using hashes here.

File details

Details for the file kannolo-0.4.6-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for kannolo-0.4.6-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 4fc1b74d61109c80fdc1b9d7201751695f128ed6f6d47f665844eec39cda2e61
MD5 3f49db7b5be7d80c2e29bc4d67624f02
BLAKE2b-256 7fd50f2dc5a8c8bb5dead7d6df5f4bcdeda81f34e739e7212a4cbc7936826ca9

See more details on using hashes here.

File details

Details for the file kannolo-0.4.6-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for kannolo-0.4.6-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 52490eebc09492fcbf650f4ecf095c1a33703f1dbbd5d8f7667fa3f9b2229d17
MD5 38d214550cc3159801833d220f88e398
BLAKE2b-256 3d3a02bfffbab61a9888154495bf0802240f77b31ca4ee2d415665b4abd9344f

See more details on using hashes here.

File details

Details for the file kannolo-0.4.6-cp310-cp310-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for kannolo-0.4.6-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 bff605eb61918ad542676f6783dfed50214339486b3e95a43b1f768f50fdef04
MD5 5fa44a7300c6652f7667ceddd86c4c0f
BLAKE2b-256 14d69ff56317c1e3f212b660c21db15b67a3be8e09782bb081bf879f21ba977e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page