SimpleMem: An Efficient Lifelong Memory System for LLM Agents
SimpleMem is a memory architecture for LLM agents that maximizes information density within a fixed token budget, replacing the passive "store everything" paradigm of traditional RAG with an active, metabolism-like process of ingestion, consolidation, and archival. Its design is grounded in the Complementary Learning Systems (CLS) theory, mapping a fast "hippocampal" active memory buffer and a slow "neocortical" consolidated memory store onto a layered storage architecture.
Key points
- Three-stage pipeline: 1. Semantic structured compression (write-time): sliding-window segmentation (512 tokens, 50% overlap), entropy-aware filtering, and memory atomization (coreference resolution + temporal anchoring to ISO 8601 timestamps) produce self-contained memory units. Atomization alone raised time-reasoning F1 from 25.40 to 58.62 (+130.8%). 2. Recursive memory consolidation (asynchronous background): an affinity score ω_ij = γ·sim(m_i, m_j) + (1−γ)·temporal_proximity(m_i, m_j) clusters related memories; when density exceeds a threshold τ_cluster, a synthesis function generates abstract memories (e.g., 30 "8 AM coffee" records become one "morning coffee habit" insight, ~97% compression). Originals are soft-archived, not deleted, enabling abstraction-to-detail backtracking. 3. Adaptive query-aware retrieval (read-time): query complexity C_q drives dynamic retrieval depth k_dyn = ⌊k_base·(1+δ·C_q)⌋ with k_base = 3, δ ≈ 5.67; scoring fuses semantic similarity, BM25, and constraint satisfaction with default weights λ = (0.5, 0.3, 0.2). Simple greetings trigger near-zero retrieval; complex multi-hop queries expand to ~20 retrieved units.
- Information scoring function: H(W_t) = α·|E_new|/|W_t| + (1−α)·(1 − cos(E(W_t), E(H_prev))) combining entity novelty and semantic divergence; redundancy threshold τ_redundant = 0.35 was optimal on LoCoMo.
- Multi-view indexing: dense vectors (OpenAI text-embedding-3-small, 1024-dim) for semantic matching, BM25 sparse index for exact keyword hits, and symbolic metadata (timestamps, entity types) for deterministic filtering.
- SimpleMem outperforms Mem0 by +26.4% relative F1, with the largest gain in temporal reasoning (48.67 vs 37.12, +31.1%).
- Token consumption: 531 vs 973 (Mem0, −45%) and vs 16,910 (full context, ~30× compression).
- Latency: 480.9s end-to-end vs 1,934.3s for Mem0 (~4× faster) and 5,937.2s for A-Mem (~12.5× faster); memory construction 92.6s/sample vs 1,350.9s (Mem0).
- vs. traditional RAG: SimpleMem performs disambiguation at write time (schema-on-write style) instead of at retrieval time, builds hierarchical abstractions instead of flat chunks, and uses dynamic retrieval depth instead of fixed Top-K.
- vs. graph databases: graph approaches (e.g., Neo4j) face relation-extraction bottlenecks; SimpleMem relies on lightweight clustering and LLM-based abstraction instead of explicit knowledge-graph construction.
- Key design insight: the experiments argue that signal-to-noise ratio — not ever-larger context windows — determines long-term memory performance. Loss of detail is mitigated by a "soft forgetting" mechanism: originals are archived and remain retrievable for evidence-backed deep queries.
- Personal assistants: accurate answers to specific historical questions after thousands of turns; implicit, continuous learning of user preferences; cross-session coherence via persistent identifiers, temporal anchoring, and summary inheritance.
- Long-term companion AI: extensions for emotional annotation, relationship timelines, and adaptive interaction styles (verbosity, formality, proactivity, humor).
- Economics: at roughly one million queries per day with GPT-4-class pricing, the token savings translate to hundreds of thousands of dollars in annual API cost reduction.
Benchmark results (LoCoMo, GPT-4.1-mini backend)
| Method | Avg F1 | Tokens/query | |---|---|---| | Full context | 18.70 | 16,910 | | MemGPT | 20.91 | 16,910 | | A-Mem | 32.58 | 1,200+ | | Mem0 | 34.20 | 973 | | SimpleMem | 43.24 | 531 |
Comparison with existing approaches
Application scenarios
Tunable parameters
| Parameter | Default | Role | |---|---|---| | α | 0.5 | Balance entity novelty vs semantic divergence | | τ_redundant | 0.35 | Filtering decision threshold | | γ | 0.5 | Semantic vs temporal weighting in affinity score | | τ_cluster | 0.7 → 0.3 (hierarchical) | Cluster density threshold | | k_base, δ | 3, 5.67 | Base and sensitivity of dynamic retrieval depth | | λ_1, λ_2, λ_3 | 0.5, 0.3, 0.2 | Fusion weights for semantic, BM25, constraint scores |