reflex/cache/l2/
mod.rs

1//! L2 semantic cache (embedding + vector search + rescoring).
2//!
3//! The default implementation embeds with [`SinterEmbedder`](crate::embedding::sinter::SinterEmbedder),
4//! searches a binary-quantized backend, then rescoring top candidates in full precision.
5
6/// Backend trait used by L2 for vector search/upsert.
7pub mod backend;
8/// Core L2 cache implementation.
9pub mod cache;
10/// L2 configuration.
11pub mod config;
12/// L2 error types.
13pub mod error;
14/// Storage loader traits and implementations.
15pub mod loader;
16#[cfg(any(test, feature = "mock"))]
17/// Mock L2 cache helpers (enabled with `mock` feature).
18pub mod mock;
19/// L2 result types.
20pub mod types;
21
22#[cfg(test)]
23mod tests;
24
25pub use backend::BqSearchBackend;
26pub use cache::{L2SemanticCache, L2SemanticCacheHandle};
27pub use config::{
28    DEFAULT_TOP_K_BQ, DEFAULT_TOP_K_FINAL, L2_COLLECTION_NAME, L2_VECTOR_SIZE, L2Config,
29};
30pub use error::{L2CacheError, L2CacheResult};
31#[cfg(any(test, feature = "mock"))]
32pub use loader::MockStorageLoader;
33pub use loader::{NvmeStorageLoader, StorageLoader};
34#[cfg(any(test, feature = "mock"))]
35pub use mock::MockL2SemanticCache;
36pub use types::L2LookupResult;