hermes_core/structures/vector/mod.rs
1//! Vector indexing data structures
2//!
3//! This module provides a modular architecture for vector search:
4//!
5//! ## Module Structure
6//!
7//! - `ivf` - Core IVF (Inverted File Index) infrastructure
8//! - `CoarseCentroids` - k-means clustering for coarse quantization
9//! - `ClusterData` / `ClusterStorage` - generic cluster storage
10//! - `SoarConfig` / `MultiAssignment` - SOAR geometry-aware assignment
11//!
12//! - `quantization` - Vector quantization methods
13//! - `RaBitQCodebook` - RaBitQ binary quantization (32x compression)
14//! - `PQCodebook` - Product Quantization with OPQ (ScaNN-style)
15//! - `Quantizer` trait - common interface for quantizers
16//!
17//! - `index` - Ready-to-use IVF indexes
18//! - `IVFRaBitQIndex` - IVF + RaBitQ
19//! - `IVFPQIndex` - IVF + PQ
20//!
21//! ## SOAR (Spilling with Orthogonality-Amplified Residuals)
22//!
23//! The IVF module includes Google's SOAR algorithm for improved recall:
24//! - Assigns vectors to multiple clusters (primary + secondary)
25//! - Secondary clusters chosen to have orthogonal residuals
26//! - Improves recall by 5-15% with ~1.3-2x storage overhead
27
28pub mod index;
29pub mod ivf;
30pub mod quantization;
31
32// IVF core
33pub use ivf::{
34 ClusterData, ClusterStorage, CoarseCentroids, CoarseConfig, MultiAssignment, QuantizedCode,
35 SoarConfig,
36};
37
38// Quantization
39pub use quantization::{
40 DistanceTable, PQCodebook, PQConfig, PQVector, QuantizedQuery, QuantizedVector, Quantizer,
41 RaBitQCodebook, RaBitQConfig,
42};
43
44// Indexes
45pub use index::{IVFPQConfig, IVFPQIndex, IVFRaBitQConfig, IVFRaBitQIndex, RaBitQIndex};