rag_plusplus_core/store/mod.rs
1//! Record Storage Module
2//!
3//! Provides persistent and in-memory storage for MemoryRecords.
4//!
5//! # Architecture
6//!
7//! ```text
8//! ┌─────────────────────────────────────────────────────────────┐
9//! │ RecordStore Trait │
10//! ├─────────────────────────────────────────────────────────────┤
11//! │ + insert(record) -> Result<RecordId> │
12//! │ + get(id) -> Option<&MemoryRecord> │
13//! │ + update_stats(id, outcome) -> Result<()> │
14//! │ + remove(id) -> Result<bool> │
15//! │ + iter() -> impl Iterator<Item = &MemoryRecord> │
16//! └─────────────────────────────────────────────────────────────┘
17//! ▲ ▲
18//! │ │
19//! ┌──────┴──────┐ ┌────────┴────────┐
20//! │ InMemoryStore│ │ PersistentStore │
21//! │ (HashMap) │ │ (mmap + rkyv) │
22//! └─────────────┘ └─────────────────┘
23//! ```
24//!
25//! # Invariants
26//!
27//! - INV-001: Record immutability (only stats updates allowed)
28//! - INV-004: Index-record consistency
29
30mod memory;
31mod traits;
32
33pub use memory::InMemoryStore;
34pub use traits::{RecordStore, SharedStore};