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.5.tar.gz (648.0 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.5-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.5-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (926.7 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

kannolo-0.4.5-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl (995.8 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ i686

kannolo-0.4.5-cp313-cp313-macosx_11_0_arm64.whl (763.4 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

kannolo-0.4.5-cp313-cp313-macosx_10_13_x86_64.whl (866.1 kB view details)

Uploaded CPython 3.13macOS 10.13+ x86-64

kannolo-0.4.5-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.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (926.8 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

kannolo-0.4.5-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl (996.0 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ i686

kannolo-0.4.5-cp312-cp312-macosx_11_0_arm64.whl (763.6 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

kannolo-0.4.5-cp312-cp312-macosx_10_13_x86_64.whl (866.3 kB view details)

Uploaded CPython 3.12macOS 10.13+ x86-64

kannolo-0.4.5-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.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (928.9 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

kannolo-0.4.5-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl (998.6 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ i686

kannolo-0.4.5-cp311-cp311-macosx_11_0_arm64.whl (766.2 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

kannolo-0.4.5-cp311-cp311-macosx_10_12_x86_64.whl (870.5 kB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

kannolo-0.4.5-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.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (929.0 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

kannolo-0.4.5-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl (998.7 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ i686

kannolo-0.4.5-cp310-cp310-macosx_11_0_arm64.whl (766.1 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

kannolo-0.4.5-cp310-cp310-macosx_10_12_x86_64.whl (870.5 kB view details)

Uploaded CPython 3.10macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: kannolo-0.4.5.tar.gz
  • Upload date:
  • Size: 648.0 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.5.tar.gz
Algorithm Hash digest
SHA256 f0f19f8f80d4f3605f5348e0f14ba280229f2092d774b7e3d88c4f011c3f9d8c
MD5 014b6bbd6eb1adc1ab9306114f26ea39
BLAKE2b-256 664fa5d7af366820cb81f2fe771fddccba1d473026f639e4d8721dfac02fdcca

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kannolo-0.4.5-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 8756881f581ef2e62041796d82305a3252bef4a8111e166a004677372d6b2528
MD5 d2c75267e863a4f67a98ebb1c37b6276
BLAKE2b-256 a1b8fe25ecc33c4af3caa41ec43131541f8433dce3b5db388853079ec5777b9b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kannolo-0.4.5-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3e8ba134ae824098c241d3a4f5ae382a8af7126f08dbb45f7f6597cb6ea66eba
MD5 55630b06e267359f550c170c7e24a289
BLAKE2b-256 d5a64e55dd0bf389f58485ef82f46283272d30db673b806e5dd696d521e9a73a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kannolo-0.4.5-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 c741a01056ae8d507452f88ddf6fec8d871e0507f86ffb55bb9fe47c0b9ad56a
MD5 04e02245c7d32be34f6e484acc3033b9
BLAKE2b-256 6438a1a009a5ae787b5dadc36499530fa087d4b6b2488ede295ef8875edbb37f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kannolo-0.4.5-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e38dc32790080de57acae3786396c973f02ae8caa3794e45d867596575fa3173
MD5 9600b836a36354f20f2f304690518bdf
BLAKE2b-256 3da631a15e3c0b89c90c1cc9408fb699aa4449d48c1632dbca8ebc401eaf1e09

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kannolo-0.4.5-cp313-cp313-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 5b5cfdf31c5eebc36e1091aa72b365f3fd637230ae42195d9c1707de7da2dfd1
MD5 4146a893314fa09edf6590842dc0f26f
BLAKE2b-256 edff1dfc0614db9349d402998b7ccb5ccaf95c6998bd6883a20b5baf9f1f9f91

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kannolo-0.4.5-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 d36845b52b9c57741ead0425c6e22d2e0d746ef9b012ba25e45a809787cd85e5
MD5 998b85f4c88e6a62e16c272a8b33ad59
BLAKE2b-256 132106e8467a939fd99aecad2d1109bff215f8cb94ef23cdd51190f972e65d42

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kannolo-0.4.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 24709ddd2e855f6b21233b2f8c1c17a67bfc26e4c126b77e0bcc4b550cd0c50b
MD5 738ba7aa7b6acc9b0928928cb014aeee
BLAKE2b-256 cb21ff8fa607a09c3a7522a23c54a0d155e447d924899d3172e54355c3d9262c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kannolo-0.4.5-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 5492e2df93acc5daaa25128c0fae25f059627a3728f4349485368b51a8f5189b
MD5 79a7480d42a67dd19645c2b6c2d09731
BLAKE2b-256 381ab3aa66f5500a1269bcc3e92bad6391ac620b50abe753dba86c1f391de3c4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kannolo-0.4.5-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 09d93676a1137dca4a3709048de6ae7aad92a1b189a2e2b836d6e9b5ab213ad8
MD5 c9a8896b54b6f97bcd95d8f66143cca0
BLAKE2b-256 3155780f754e250c889b654ac48e9226ea146a89690f74ba3603fb067dac7f07

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kannolo-0.4.5-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 0594f1090e1615b41dcc61b18e03e0fadb15ab87c0f4e2dca683f73db535c976
MD5 ea31924782f2e93b8989ae8854852c18
BLAKE2b-256 8242fcef7ba2268c7c72a610c360bbd0d054838166bd89948f2258888377e887

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kannolo-0.4.5-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 4ba4a08a2b15954b9307c6aca1af8f78f37df77d4f3acbd9f8ecb2508aa5caae
MD5 1da3ffa8814e289666ca5beb1e47d668
BLAKE2b-256 7026fced4b9be911a0d429d747ea096d352e6d28d673e0eceee7c33bd588db10

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kannolo-0.4.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 270b523100c7579241dfe7a9276b97e565840bcadfbe9e3c4199fce33cb8f640
MD5 0e5d558ccefa492a12049fd8f3b9b616
BLAKE2b-256 0f188c7cb9580dc63cbed6c09508cabcf0d42d69b20c2ceea92a2024acba61f0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kannolo-0.4.5-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 41c6aad7f34720e74d6cafe23751ae2d898025a99fd7686795825837fdc301e9
MD5 e40a4d954f5ba3ef0bd95a24b09ae44f
BLAKE2b-256 f06600237cb5e36aa60ca6bf6f20b635af7bf8a902acf2aa3d5e0d47eedf4191

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kannolo-0.4.5-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fd03d509db397542e612fd75849d19b18032d698230da5d0bc57f02b3f0e5e61
MD5 00461f53d7aa4bd0d2d2dcd0594d96f6
BLAKE2b-256 cd8baaab8e997f4e6cc58533d54873131413d00dfb013c2b134ab1a5882434d8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kannolo-0.4.5-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 f45dbeb55713781bbf8931ee9885440b9175d4b7c182bf5b2fe31ceb538af332
MD5 20c57d499c21b04d1655ec88f558c648
BLAKE2b-256 650ef463eef2479cf0e64dd3a8244caac7d87e0cc41c1bc7f9f3cafc7a97bc3f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kannolo-0.4.5-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 5925db296420d6891b0d8157a40c6c30218f927284b55eeb339e4296d1ad68c8
MD5 aac6978c815025029585fe088181e300
BLAKE2b-256 e6f8b94600713deac04121a4a3f048536b27c8ed8ea97bed0ac9db28c0bb84e0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kannolo-0.4.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 458a0d99a80e64cf7500fbe19dd36183fc40d7e52c15b291712efa0ec839efce
MD5 1b9d04f2e9337a5d56400d82d041b9cb
BLAKE2b-256 8410ec3962d418adf605babd7147bd7f1f0307bec9ced2cad413e11c0f4dbc1e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kannolo-0.4.5-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 88590986d099006bb49f645975ced52c8a32fc11b47d9ca367d8f36b965fa17e
MD5 32afbea542ef6835a9ab2adfb008027e
BLAKE2b-256 0b73ffca77b39f0b58494a3a005945c98ac63e8ade2ff150ef5fc171b321e0f8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kannolo-0.4.5-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8442f0bffb19d448b3e021e27f04033e973c624660363d4045dd7fd4cddbf0ee
MD5 54ad6eca14ed707c08d2650838da9b61
BLAKE2b-256 24a60ea79a58ec9ca8cca10184a53c3838fea598988aec9e91deffcdf483d834

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for kannolo-0.4.5-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 f4d5cb00419aff329483095c4a67954bbca4db32b03dcd9c82bebf7be52d72bd
MD5 afd1af29aab1f907258d7a84243a987e
BLAKE2b-256 f28617f5b0a03286d754e614dd8858532672c3302704aa2f2c93eb4044c1fcd0

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