Skip to main content

Crate ann_search_rs

Crate ann_search_rs 

Source
Expand description

Optimised vector searches in Rust originally designed for single cell applications, but now as additionally GPU-accelerated, quantised (with binary indices) vector searches leveraging Rust’s performance under the hood.

§Feature flags

  • binary — Enables binary index support with optional memory-mapped files for on-disk vector storage
  • gpu — Enables GPU-accelerated indices via the CubeCL backend
  • gpu-tests — Enables GPU integration tests (requires ‘wgpu’ and a GPU on the machine)
  • quantised — Enables quantised indices with different quantisations (BF16, SQ8, PQ, OPQ)
  • mimalloc — Enables mimalloc as the global allocator for improved performance

Modules§

binary
This module contains all of the helpers, structures and methods related to binary indices. This includes the index structures themselves and distance calculations
cpu
Various CPU-based indices that run on the raw vectors. Leverage SIMD under the hood.
prelude
Re-exports of commonly used types and traits for convenient glob importing.
quantised
This module contains all of the helpers, structures and methods related to quantised indices (bf16, SQ8, PQ and OPQ).
utils
All types of utilities of this crate. From SIMD-accelerated distance calculations, to highly optimised k-means clustering to structure to be kept on the heap, shared traits, etd.

Functions§

build_annoy_index
Build an Annoy index
build_balltree_index
Build a BallTree index
build_exhaustive_bf16_index
Build an Exhaustive-BF16 index
build_exhaustive_index
Build an exhaustive index
build_exhaustive_index_binary
Build an exhaustive binary index
build_exhaustive_index_rabitq
Build an exhaustive RaBitQ index
build_exhaustive_opq_index
Build an Exhaustive-OPQ index
build_exhaustive_pq_index
Build an Exhaustive-PQ index
build_exhaustive_sq8_index
Build an Exhaustive-SQ8 index
build_hnsw_index
Build an HNSW index
build_ivf_bf16_index
Build an IVF-BF16 index
build_ivf_index
Build an IVF index
build_ivf_index_binary
Build an IVF index with binary quantisation
build_ivf_index_rabitq
Build an IVF-RaBitQ index
build_ivf_opq_index
Build an IVF-OPQ index
build_ivf_pq_index
Build an IVF-PQ index
build_ivf_sq8_index
Build an IVF-SQ8 index
build_kd_tree_index
Build a Kd-Tree forest index
build_lsh_index
Build the LSH index
build_nndescent_index
Build an NNDescent index
build_vamana_index
Build a Vamana index
query_annoy_index
Helper function to query a given Annoy index
query_annoy_self
Helper function to self query the Annoy index
query_balltree_index
Helper function to query a given BallTree index
query_balltree_self
Helper function to self query the BallTree index
query_exhaustive_bf16_index
Helper function to query a given Exhaustive-BF16 index
query_exhaustive_bf16_self
Helper function to self query a given Exhaustive-BF16 index
query_exhaustive_index
Helper function to query a given exhaustive index
query_exhaustive_index_binary
Helper function to query a given exhaustive binary index
query_exhaustive_index_binary_self
Query an exhaustive binary index against itself
query_exhaustive_index_rabitq
Helper function to query a given exhaustive RaBitQ index
query_exhaustive_index_rabitq_self
Query an exhaustive RaBitQ index against itself
query_exhaustive_opq_index
Helper function to query a given Exhaustive-OPQ index
query_exhaustive_opq_index_self
Helper function to self query an Exhaustive-OPQ index
query_exhaustive_pq_index
Helper function to query a given Exhaustive-PQ index
query_exhaustive_pq_index_self
Helper function to self query an Exhaustive-PQ index
query_exhaustive_self
Helper function to self query an exhaustive index
query_exhaustive_sq8_index
Helper function to query a given Exhaustive-SQ8 index
query_exhaustive_sq8_self
Helper function to self query a given Exhaustive-SQ8 index
query_hnsw_index
Helper function to query a given HNSW index
query_hnsw_self
Helper function to self query the HNSW index
query_ivf_bf16_index
Helper function to query a given IVF-BF16 index
query_ivf_bf16_self
Helper function to self query a given IVF-SQ8 index
query_ivf_index
Helper function to query a given IVF index
query_ivf_index_binary
Query an IVF binary index
query_ivf_index_binary_self
Query an IVF binary index against itself
query_ivf_index_rabitq
Helper function to query a given IVF-RaBitQ index
query_ivf_index_rabitq_self
Query an IVF-RaBitQ index against itself
query_ivf_opq_index
Helper function to query a given IVF-OPQ index
query_ivf_opq_index_self
Helper function to self query a IVF-OPQ index
query_ivf_pq_index
Helper function to query a given IVF-PQ index
query_ivf_pq_index_self
Helper function to self query a IVF-PQ index
query_ivf_self
Helper function to self query an IVF index
query_ivf_sq8_index
Helper function to query a given IVF-SQ8 index
query_ivf_sq8_self
Helper function to self query a given IVF-SQ8 index
query_kd_tree_index
Helper function to query a given Kd-Tree index
query_kd_tree_self
Helper function to self query the Kd-Tree index
query_lsh_index
Helper function to query a given LSH index
query_lsh_self
Helper function to self query an LSH index
query_nndescent_index
Helper function to query a given NNDescent index
query_nndescent_self
Helper function to self query the NNDescent index
query_vamana_index
Query a Vamana index with an external query matrix
query_vamana_self
Self-query a Vamana index to generate a full kNN graph