reflex/cache/
mod.rs

1//! Tiered caching infrastructure.
2//!
3//! Reflex uses:
4//! - **L1**: exact-match lookup (in-memory)
5//! - **L2**: semantic search (vector DB)
6//!
7//! Start at [`TieredCache`] and [`TieredLookupResult`].
8
9/// L1 exact-match cache.
10pub mod l1;
11/// L2 semantic cache.
12pub mod l2;
13/// L1+L2 tiered cache wrapper.
14pub mod tiered;
15/// Status/header types shared across the cache pipeline.
16pub mod types;
17
18#[cfg(test)]
19mod l1_tests;
20#[cfg(test)]
21mod tiered_tests;
22
23pub use l1::{L1Cache, L1CacheHandle, L1LookupResult};
24pub use l2::{
25    BqSearchBackend, DEFAULT_TOP_K_BQ, DEFAULT_TOP_K_FINAL, L2_COLLECTION_NAME, L2_VECTOR_SIZE,
26    L2CacheError, L2CacheResult, L2Config, L2LookupResult, L2SemanticCache, L2SemanticCacheHandle,
27    NvmeStorageLoader, StorageLoader,
28};
29#[cfg(any(test, feature = "mock"))]
30pub use l2::{MockL2SemanticCache, MockStorageLoader};
31
32#[cfg(any(test, feature = "mock"))]
33pub use tiered::MockTieredCache;
34pub use tiered::{TieredCache, TieredCacheHandle, TieredLookupResult};
35
36pub use types::{
37    REFLEX_STATUS_ERROR, REFLEX_STATUS_HEADER, REFLEX_STATUS_HEALTHY, REFLEX_STATUS_NOT_READY,
38    REFLEX_STATUS_READY, REFLEX_STATUS_STORED, ReflexStatus,
39};