oxios_memory/lib.rs
1//! Oxios Memory — tiered agent memory extracted from `oxios-kernel`.
2//!
3//! ## Status (RFC-018)
4//!
5//! This crate holds the memory subsystem extracted from `oxios-kernel`:
6//!
7//! - **b.1**: `chunking`, `normalizer`, `hyperbolic` (math/text utilities)
8//! - **b.2**: `embedding` (TF-IDF + GGUF dense vectors)
9//! - **b.3**: `root_index`, `quota`
10//! - **b.4**: `decay`, `auto_classify`, `auto_protect`
11//! - **b.5**: `compaction`, `flash_attention`, `graph`, `embedding_cache`, `embedding_viz`
12//! - **b.6**: `MemoryStorage` trait + `StateStore` impl
13//! - **b.7**: `MemoryManager` move
14//! - **b.8**: SQLite backend
15//! - **b.9**: `migrate`, `dream`, `auto_memory_bridge`
16//!
17//! `oxios-kernel` depends on this crate (not the other way around) for
18//! all memory types and modules.
19//!
20//! ## Usage
21//!
22//! ```rust,ignore
23//! use oxios_memory::MemoryEntry;
24//! use oxios_memory::MemoryType;
25//! use oxios_memory::chunk_fixed;
26//! use oxios_memory::HyperbolicEmbedding;
27//! use oxios_memory::cosine_similarity_f32;
28//! ```
29
30#![warn(missing_docs)]
31
32// ─── Memory subsystem modules (extracted from oxios-kernel) ──
33pub mod memory;
34
35// Re-export storage traits
36pub use crate::memory::{
37 MarkdownSource, MemoryBackend, MemoryGit, MemoryStorage, MemoryStorageExt, NoteEntry,
38};
39
40// Re-export core types (RFC-018)
41pub use crate::memory::types::{
42 content_hash, dedup_by_id, extract_keywords, MemoryEntry, MemoryTier, MemoryType,
43 ProtectionLevel, TextVector,
44};
45
46// Re-export extracted modules (b.1 — chunking/normalizer/hyperbolic)
47pub use crate::memory::{
48 chunk_fixed, chunk_paragraphs, cosine_similarity_f32, l2_normalize_f32, l2_normalize_f64,
49 ChunkConfig, HyperbolicConfig, HyperbolicEmbedding, TextChunk,
50};
51
52// Re-export lifecycle modules (b.3-b.5)
53pub use crate::memory::{
54 AutoClassifier, AutoProtector, CacheStats, CompactionTree, CurationCandidate, CurationReport,
55 DecayEngine, EmbeddingCache, FlashAttention, FlashAttentionConfig, HistoricalPeriod,
56 MemoryBudget, MemoryEstimate, MemoryGraph, MemoryMapEntry, MemoryNeighbor, RootEntry,
57 RootIndex, TopicEntry,
58};
59
60// Re-export HNSW
61pub use crate::memory::hnsw::HnswIndex;
62pub use crate::memory::hnsw_memory_index::{HnswMemoryIndex, SemanticHit};
63
64// Re-export SONA pattern engine
65pub use crate::memory::sona::{
66 LearnedPattern, SonaEngine, SonaMode, Trajectory, TrajectoryStep, Verdict,
67};
68
69// Re-export MemoryManager (RFC-018 Phase 4)
70pub use crate::memory::manager::MemoryManager;
71
72// Re-export Dream consolidation process (RFC-018 Phase 5)
73pub use crate::memory::dream::{DreamCheckpoint, DreamConfig, DreamProcess, DreamReport};
74
75// Re-export Proactive recall (RFC-018 Phase 5)
76pub use crate::memory::proactive::{ProactiveRecall, RecallTiming};