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//! - `SoarConfig` / `MultiAssignment` - SOAR geometry-aware assignment
10//!
11//! - `quantization` - TurboQuant training-free codec
12//! - `TqCodec` - derived rotation/codebook, no trained artifacts
13//!
14//! - `index` - Segment payloads for the production ANN implementations
15//! - `IvfTqIndex` - float vectors with TQ-coded centroid residuals
16//! - `BinaryIvfIndex` - exact packed binary vectors
17//!
18//! ## SOAR (Spilling with Orthogonality-Amplified Residuals)
19//!
20//! The IVF module includes Google's SOAR algorithm for improved recall:
21//! - Assigns vectors to multiple clusters (primary + secondary)
22//! - Secondary clusters chosen to have orthogonal residuals
23//! - Improves recall by 5-15% with ~1.3-2x storage overhead
24
25pub mod index;
26pub mod ivf;
27mod kmeans;
28pub mod quantization;
29
30// IVF core
31pub use ivf::{CoarseCentroids, CoarseConfig, IvfProbePlan, MultiAssignment, SoarConfig};
32
33// Quantization
34#[cfg(feature = "native")]
35pub use quantization::TqFlatBuilder;
36pub use quantization::{TqCodec, TqQueryPlan};
37
38// Indexes
39pub use index::{
40 BinaryCoarseQuantizer, BinaryIvfConfig, BinaryIvfIndex, IvfTqIndex, TqIvfEncodeScratch,
41 TqIvfQueryPlan,
42};