How greenbinjack/rabitq-library works
RaBitQ Library is a C++17 vector-quantization and approximate-nearest-neighbor search library with Python bindings. The documented user workflow accepts vectors and queries, builds or loads an index, and returns nearest-neighbor IDs and distances. The main branches are IVF, HNSW, and SymphonyQG; quantization, distance estimation, FastScan, and runtime SIMD dispatch provide shared internals. The README establishes the product capabilities; source-index references and excerpts support the more specific module relationships. Some implementation details and Python binding routes were not sampled, so uncertain connections are omitted.
Main entry points: ivf.hpp IVF index · hnsw.hpp HNSW index · qg.hpp SymphonyQG index · rabitq.hpp RaBitQ quantizer
Components 22
Python API
- Binding helpers
python_bindings/bindings_common.hpp - IVF binding
python_bindings/ivf_bindings.cpp - HNSW binding
python_bindings/hnsw_bindings.cpp - SymphonyQG binding
python_bindings/symqg_bindings.cpp
ANN Indexes
- IVF index
include/rabitqlib/index/ivf/ivf.hpp - Index initializer
include/rabitqlib/index/ivf/initializer.hpp - HNSW index
include/rabitqlib/index/hnsw/hnsw.hpp - HNSW kernels
src/index/hnsw_search_avx2_kernels.hpp - SymphonyQG index
include/rabitqlib/index/symqg/qg.hpp - Graph builder
include/rabitqlib/index/symqg/qg_builder.hpp
Quantization Search
- RaBitQ quantizer
include/rabitqlib/quantization/rabitq.hpp - Quantizer implementation
include/rabitqlib/quantization/rabitq_impl.hpp - Code layout
include/rabitqlib/quantization/data_layout.hpp - Query models
include/rabitqlib/index/query.hpp - Distance estimator
include/rabitqlib/index/estimator.hpp - Lookup tables
include/rabitqlib/index/lut.hpp - FastScan
include/rabitqlib/fastscan/fastscan.hpp
SIMD Runtime
- SIMD dispatch
src/simd/dispatch.cpp - CPU detection
src/utils/cpu_features.cpp - Vector operations
include/rabitqlib/utils/space.hpp - SIMD distance kernels
src/simd/space_excode_avx2.cpp
Other components
- Python user
Connections 31
- Python user → IVF binding: builds or searches
README.md - Python user → HNSW binding: builds or searches
README.md - Python user → SymphonyQG binding: builds or searches
README.md - IVF binding → Binding helpers: uses helpers
python_bindings/ivf_bindings.cpp - HNSW binding → Binding helpers: uses helpers
python_bindings/hnsw_bindings.cpp - SymphonyQG binding → Binding helpers: uses helpers
python_bindings/symqg_bindings.cpp - IVF binding → IVF index: exposes
python_bindings/ivf_bindings.cpp - HNSW binding → HNSW index: exposes
python_bindings/hnsw_bindings.cpp - SymphonyQG binding → SymphonyQG index: exposes
python_bindings/symqg_bindings.cpp - SymphonyQG binding → Graph builder: exposes builder
python_bindings/symqg_bindings.cpp - Graph builder → SymphonyQG index: builds graph
include/rabitqlib/index/symqg/qg_builder.hpp - IVF index → Index initializer: uses initialization
include/rabitqlib/index/ivf/ivf.hpp - HNSW index → Index initializer: uses initialization
include/rabitqlib/index/hnsw/hnsw.hpp - IVF index → RaBitQ quantizer: quantizes vectors
include/rabitqlib/index/ivf/ivf.hpp - HNSW index → RaBitQ quantizer: quantizes vectors
include/rabitqlib/index/hnsw/hnsw.hpp - SymphonyQG index → RaBitQ quantizer: stores codes
include/rabitqlib/index/symqg/qg.hpp - RaBitQ quantizer → Quantizer implementation: delegates
include/rabitqlib/quantization/rabitq.hpp - RaBitQ quantizer → Code layout: uses layouts
include/rabitqlib/quantization/rabitq.hpp - IVF index → Distance estimator: estimates distances
include/rabitqlib/index/ivf/ivf.hpp - SymphonyQG index → Distance estimator: estimates distances
include/rabitqlib/index/symqg/qg.hpp - HNSW index → Distance estimator: estimates distances
include/rabitqlib/index/hnsw/hnsw.hpp - Distance estimator → Query models: uses query models
include/rabitqlib/index/estimator.hpp - Query models → Lookup tables: builds lookup tables
include/rabitqlib/index/query.hpp - Lookup tables → FastScan: uses scan layout
include/rabitqlib/index/lut.hpp - IVF index → FastScan: scans batches
include/rabitqlib/index/ivf/ivf.hpp - SymphonyQG index → FastScan: scans neighbors
include/rabitqlib/index/symqg/qg.hpp - FastScan → SIMD dispatch: selects kernels
- SIMD dispatch → CPU detection: checks features
src/simd/dispatch.cpp - Vector operations → SIMD dispatch: dispatches operations
include/rabitqlib/utils/space.hpp - SIMD dispatch → SIMD distance kernels: routes to kernels
src/simd/dispatch.cpp - HNSW index → HNSW kernels: uses search kernels