Skip to main content

Module vector

Module vector 

Source
Expand description

Vector indexing data structures

This module provides a modular architecture for vector search:

§Module Structure

  • ivf - Core IVF (Inverted File Index) infrastructure

    • CoarseCentroids - k-means clustering for coarse quantization
    • SoarConfig / MultiAssignment - SOAR geometry-aware assignment
  • quantization - Residual product quantization

    • PQCodebook - the index-global OPQ codebook
  • index - Segment payloads for the production ANN implementations

    • IVFPQIndex - float vectors with residual PQ codes
    • BinaryIvfIndex - exact packed binary vectors

§SOAR (Spilling with Orthogonality-Amplified Residuals)

The IVF module includes Google’s SOAR algorithm for improved recall:

  • Assigns vectors to multiple clusters (primary + secondary)
  • Secondary clusters chosen to have orthogonal residuals
  • Improves recall by 5-15% with ~1.3-2x storage overhead

Re-exports§

pub use ivf::CoarseCentroids;
pub use ivf::CoarseConfig;
pub use ivf::IvfProbePlan;
pub use ivf::MultiAssignment;
pub use ivf::SoarConfig;
pub use quantization::DistanceTable;
pub use quantization::PQCodebook;
pub use quantization::PQConfig;
pub use index::BinaryCoarseQuantizer;
pub use index::BinaryIvfConfig;
pub use index::BinaryIvfIndex;
pub use index::IVFPQConfig;
pub use index::IVFPQIndex;
pub use index::IvfPqQueryPlan;

Modules§

index
Vector index implementations
ivf
IVF (Inverted File Index) module for vector search
quantization
Vector quantization for IVF indexes