Can dense, sparse and multi-vector approximate nearest neighbor search live in a single Rust codebase?
Modular and Efficient Approximate Nearest Neighbors Search with Vectorium and kANNolo
🧩 Overview
Two Rust libraries: Vectorium for data management and kANNolo for indexing. Encoders and datasets are compile-time type parameters, so each combination is specialized at build time.
🎯 The problem
・Faiss has a separate code path per index/quantizer combination, which is hard to extend
・Other libraries factor out only the graph or only the quantization
・None handles all three embedding types behind one interface
🛠 Method
・11 encoders (PQ, RaBitQ, sparse, multi-vector, and more)
・Hnsw and IVF, plus a two-stage RerankIndex that pairs any first-stage index with any rescoring
・A structure-of-arrays PQ table layout makes table building 4.5-5.2x faster
📊 Results
・Up to 3.26x hnswlib's throughput at 99% accuracy (kANNolo-Rerank, dense data)
・Smallest memory on every sparse collection
・But Glass wins on AgNews, Seismic is faster on sparse data, and builds are not fast
#
ANNSearch# #
Rust#