1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
//! # Umi Memory
//!
//! A production-ready memory library for AI agents with deterministic simulation testing.
//!
//! ## Features
//!
//! - **π§ Smart Memory Management**: Core, working, and archival memory tiers with automatic eviction
//! - **π Dual Retrieval**: Fast vector search + LLM-powered semantic query expansion
//! - **π Evolution Tracking**: Automatically detect updates, contradictions, and derived insights
//! - **β
Graceful Degradation**: System continues operating even when LLM/storage components fail
//! - **π― Deterministic Testing**: Full DST (Deterministic Simulation Testing) for reproducible fault injection
//! - **π Production Backends**: LanceDB for embedded vectors, Postgres for persistence
//!
//! ## Quick Start
//!
//! ```rust
//! use umi_memory::umi::{Memory, RememberOptions, RecallOptions};
//!
//! # #[tokio::main]
//! # async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! // Create memory with simulation providers (deterministic, seed 42)
//! let mut memory = Memory::sim(42);
//!
//! // Remember information
//! memory.remember(
//! "Alice is a software engineer at Acme Corp",
//! RememberOptions::default()
//! ).await?;
//!
//! // Recall information
//! let results = memory.recall("Who works at Acme?", RecallOptions::default()).await?;
//!
//! for entity in results {
//! println!("Found: {} - {}", entity.name, entity.content);
//! }
//! # Ok(())
//! # }
//! ```
//!
//! ## Architecture
//!
//! ```text
//! βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
//! β Memory Orchestrator β
//! βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
//! β EntityExtractor β DualRetriever β EvolutionTracker β
//! βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
//! β Core Memory (32KB) β Always loaded, persistent β
//! β Working Memory (1MB) β TTL-based eviction, cache β
//! β Archival Memory β Vector search + storage β
//! βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
//! β DST Framework β Fault injection + simulationβ
//! βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
//! ```
//!
//! ## Core Components
//!
//! - [`Memory`](umi::Memory) - Main orchestrator, coordinates all components
//! - [`EntityExtractor`](extraction::EntityExtractor) - Extracts structured entities from text
//! - [`DualRetriever`](retrieval::DualRetriever) - Fast + semantic search with RRF merging
//! - [`EvolutionTracker`](evolution::EvolutionTracker) - Detects memory evolution patterns
//!
//! ## Simulation-First Philosophy
//!
//! > "If you're not testing with fault injection, you're not testing."
//!
//! Every component has a deterministic simulation implementation:
//!
//! ```rust
//! use umi_memory::dst::{Simulation, SimConfig, FaultConfig, FaultType};
//!
//! # #[tokio::test]
//! # async fn test_example() {
//! let sim = Simulation::new(SimConfig::with_seed(42))
//! .with_fault(FaultConfig::new(FaultType::LlmTimeout, 0.1));
//!
//! sim.run(|env| async move {
//! // Test code with deterministic fault injection
//! // Same seed = same faults = reproducible bugs
//! Ok::<_, anyhow::Error>(())
//! }).await.unwrap();
//! # }
//! ```
//!
//! ## Feature Flags
//!
//! - `lance` - LanceDB storage backend
//! - `postgres` - PostgreSQL storage backend
//! - `anthropic` - Anthropic LLM provider (Claude)
//! - `openai` - OpenAI LLM provider (GPT, embeddings)
//! - `llm-providers` - All LLM providers
//! - `embedding-providers` - All embedding providers
//!
//! ## Examples
//!
//! See the [examples directory](https://github.com/rita-aga/umi/tree/main/umi-memory/examples) for:
//!
//! - `quick_start.rs` - Basic remember/recall workflow
//! - `production_setup.rs` - Production configuration
//! - `configuration.rs` - Custom memory settings
//!
//! ## Documentation
//!
//! - [GitHub Repository](https://github.com/rita-aga/umi)
//! - [Architecture Decision Records](https://github.com/rita-aga/umi/tree/main/docs/adr)
//! - [Development Guide](https://github.com/rita-aga/umi/blob/main/CLAUDE.md)
// Re-export common types
pub use *;
pub use ;
pub use ;
pub use ;
// Note: storage::StorageError not re-exported to avoid conflict with dst::StorageError
// Use `umi_memory::storage::StorageError` explicitly if needed
pub use LanceStorageBackend;
// LLM Provider exports
pub use ;
pub use AnthropicProvider;
pub use OpenAIProvider;
// Embedding Provider exports
pub use ;
pub use OpenAIEmbeddingProvider;
// Extraction exports
pub use ;
// Note: extraction::EntityType and extraction::RelationType not re-exported
// to avoid conflict with storage::EntityType. Use explicit paths if needed.
// Retrieval exports
pub use ;
// Evolution exports
pub use ;
// Umi Memory exports (main API)
pub use ;