Skip to main content

Module ivfpq

Module ivfpq 

Source
Expand description

IVF-PQ (Inverted File with Product Quantization) Hybrid Index

Combines IVF clustering for fast candidate retrieval with PQ compression for memory-efficient storage. This is similar to the approach used by FAISS and other production vector databases.

Architecture:

  1. IVF partitions vectors into clusters using k-means centroids
  2. Within each cluster, vectors are stored as PQ codes (compressed)
  3. Search: find nearest clusters → scan PQ codes within those clusters

Structs§

IvfPqConfig
Configuration for IVF-PQ hybrid index
IvfPqIndex
IVF-PQ Hybrid Index
IvfPqSearchResult
Search result from IVF-PQ index
IvfPqStats
Statistics about the IVF-PQ index