Skip to main content

oxios_memory/memory/
mod.rs

1//! Memory subsystem modules — extracted from `oxios-kernel` per RFC-018.
2//!
3//! ## Module categories
4//!
5//! | Category | Modules | Description |
6//! |----------|---------|-------------|
7//! | **Types** | `types` | Core types (MemoryEntry, MemoryType, MemoryTier, etc.) |
8//! | **Text** | `chunking`, `normalizer` | Text splitting and vector math |
9//! | **Geometry** | `hyperbolic` | Poincaré ball model embeddings |
10//! | **Lifecycle** | `decay`, `auto_classify`, `auto_protect`, `compaction`, `quota` | Memory lifecycle |
11//! | **Analysis** | `graph`, `flash_attention`, `embedding_cache`, `embedding_viz`, `hnsw` | Analysis & indexing |
12//! | **Index** | `root_index` | Root memory index |
13//! | **Storage** | `storage` | Storage abstraction traits |
14
15// ─── Embedding ────────────────────────────────────────────────────────
16pub mod embedding;
17pub use embedding::{EmbeddingProvider, EmbeddingVector, TfIdfEmbeddingProvider};
18
19// ─── Core types ─────────────────────────────────────────────────────
20pub mod types;
21pub use types::{
22    content_hash, dedup_by_id, extract_keywords, MemoryEntry, MemoryTier, MemoryType,
23    ProtectionLevel, TextVector,
24};
25
26// ─── Text / math utilities ──────────────────────────────────────────
27pub mod chunking;
28pub mod hyperbolic;
29pub mod normalizer;
30
31// ─── Memory lifecycle ───────────────────────────────────────────────
32pub mod auto_classify;
33pub mod auto_protect;
34pub mod compaction;
35pub mod decay;
36pub mod quota;
37
38// ─── Analysis & indexing ────────────────────────────────────────────
39pub mod embedding_cache;
40pub mod embedding_viz;
41pub mod flash_attention;
42pub mod graph;
43pub mod hnsw;
44pub mod hnsw_memory_index;
45pub mod root_index;
46pub mod sona;
47
48// ─── Storage abstraction ────────────────────────────────────────────
49pub mod backend;
50pub mod storage;
51
52// ─── Test support ───────────────────────────────────────────────────
53#[cfg(test)]
54pub mod test_support;
55
56// ─── Core manager ────────────────────────────────────────────────────
57pub mod manager;
58
59// ─── Processes ──────────────────────────────────────────────────────
60pub mod auto_bridge;
61pub mod dream;
62pub mod proactive;
63
64#[cfg(feature = "sqlite-memory")]
65pub mod sqlite;
66
67// ─── Re-exports (b.1 — chunking/normalizer/hyperbolic) ──────────────
68pub use backend::MemoryBackend;
69pub use chunking::{chunk_fixed, chunk_paragraphs, ChunkConfig, TextChunk};
70pub use hyperbolic::{
71    batch_euclidean_to_poincare, euclidean_to_poincare, hyperbolic_distance, mobius_add,
72    mobius_scalar_mul, HyperbolicConfig, HyperbolicEmbedding,
73};
74pub use normalizer::{
75    cosine_similarity_f32, dot_product_f32, l2_norm_f32, l2_norm_f64, l2_normalize_f32,
76    l2_normalize_f64,
77};
78pub use storage::{MarkdownSource, MemoryGit, MemoryStorage, MemoryStorageExt, NoteEntry};
79
80// ─── Re-exports (lifecycle) ─────────────────────────────────────────
81pub use auto_classify::AutoClassifier;
82pub use auto_protect::AutoProtector;
83pub use compaction::CompactionTree;
84pub use decay::DecayEngine;
85pub use embedding_cache::{CacheStats, EmbeddingCache};
86pub use embedding_viz::{compute_pca_2d, compute_top_neighbors, MemoryMapEntry, MemoryNeighbor};
87pub use flash_attention::{BenchmarkResult, FlashAttention, FlashAttentionConfig, MemoryEstimate};
88pub use graph::MemoryGraph;
89pub use hnsw::HnswIndex;
90pub use hnsw_memory_index::{HnswMemoryIndex, SemanticHit};
91pub use quota::{CurationCandidate, CurationReport, MemoryBudget};
92pub use root_index::{HistoricalPeriod, RootEntry, RootIndex, TopicEntry};
93pub use sona::{LearnedPattern, SonaEngine, SonaMode, Trajectory, TrajectoryStep, Verdict};
94
95// ─── Re-exports (core manager) ──────────────────────────────────────
96pub use auto_bridge::{
97    AutoMemoryBridge, ExportResult, GuidancePattern, ImportResult, InsightCategory, MemoryInsight,
98    SyncDirection, SyncResult,
99};
100pub use dream::{DreamCheckpoint, DreamConfig, DreamProcess, DreamReport};
101pub use manager::MemoryManager;
102pub use proactive::{ProactiveRecall, RecallTiming};