How vectordb-ntu/rabitq-library works
RaBitQ is a C++17 vector-quantization and approximate-nearest-neighbor library with Python bindings. Its user workflow is to provide vectors and configuration, build or use an index, submit queries, and receive neighbor IDs and distances; indexes can also be persisted. The README identifies a standalone quantizer, IVF, HNSW, and SymphonyQG, plus architecture-specific acceleration. The bindings and several SIMD files were sampled, but most index implementations were not; the graph therefore follows documented capabilities and omits uncertain internal call chains.
Main entry points: rabitq.hpp RaBitQ encoding · ivf.hpp IVF index · dispatch.cpp SIMD dispatch · ivf_bindings.cpp IVF binding
Components 17
Python API
- IVF binding
python_bindings/ivf_bindings.cpp - HNSW binding
python_bindings/hnsw_bindings.cpp - SymphonyQG binding
python_bindings/symqg_bindings.cpp - Quantizer binding
python_bindings/rabitq_bindings.cpp
Indexes
- IVF index
include/rabitqlib/index/ivf/ivf.hpp - HNSW index
include/rabitqlib/index/hnsw/hnsw.hpp - SymphonyQG
include/rabitqlib/index/symqg/qg.hpp - IVF clustering
include/rabitqlib/index/ivf/cluster.hpp
Quantization
- Query preparation
include/rabitqlib/index/query.hpp - RaBitQ encoding
include/rabitqlib/quantization/rabitq.hpp - Packed code layout
include/rabitqlib/quantization/data_layout.hpp
CPU acceleration
- FastScan
include/rabitqlib/fastscan/fastscan.hpp - SIMD dispatch
src/simd/dispatch.cpp - SIMD kernels
src/simd/fastscan_avx2.cpp - CPU detection
src/utils/cpu_features.cpp
Other components
- Python caller
- Neighbor results
Connections 21
- Python caller → IVF binding: build / search
- Python caller → HNSW binding: build / search
- Python caller → SymphonyQG binding: build / search
- Python caller → Quantizer binding: quantize vectors
- IVF binding → IVF index: invokes
- HNSW binding → HNSW index: invokes
- SymphonyQG binding → SymphonyQG: invokes
- Quantizer binding → RaBitQ encoding: invokes
- IVF index → IVF clustering: uses partitions
- IVF index → RaBitQ encoding: encodes vectors
- HNSW index → RaBitQ encoding: stores compact codes
- SymphonyQG → RaBitQ encoding: optional packed codes
- RaBitQ encoding → Packed code layout: packs codes
- IVF index → FastScan: batched estimates
- SymphonyQG → FastScan: batched estimates
- HNSW index → SIMD dispatch: selects search kernels
- FastScan → SIMD dispatch: dispatches kernels
- SIMD dispatch → CPU detection: checks capabilities
- SIMD dispatch → SIMD kernels: selects backend
- IVF binding → Neighbor results: returns IDs and distances
- HNSW binding → Neighbor results: returns IDs and distances