Overview
D-MEM: Dopamine-Gated Agentic Memory via Reward Prediction Error Routing addresses the O(N²) complexity problem in A-MEM-style agent memory, where every input triggers full linking and evolution of the memory graph. In long conversations, most turns are noise (fillers, status updates, tangents — roughly 75%), yet traditional systems process all of them equally.
Key Points
1. Biological inspiration: VTA dopamine gating
- Mammalian brains encode only inputs that violate internal prediction models (high Reward Prediction Error) or have high survival value, triggering LTP and structural neural updates.
- D-MEM ports this as an Agentic RPE computed by a lightweight Critic Router.
- Not a naive weighted sum, but bounded multiplicative gating:
- Surprise: Z-score normalized (sliding window μ, σ) max cosine similarity against history — avoids embedding anisotropy issues at zero extra LLM cost.
- Utility: lightweight LLM classification into Transient (forced 0), Short-Term, or Persistent.
- Cold-start protection forces first ~20 turns into CONSTRUCT_ONLY.
- Hybrid retrieval: BM25 sparse + dense vectors fused via Reciprocal Rank Fusion, fixing proper-noun dilution.
- Shadow Buffer: O(1) FIFO of all skipped inputs; two-stage fallback answers adversarial queries ("did I mention the weather?") without hallucination.
- First benchmark with ρ=0.75 noise injection: 40% fillers, 30% status updates, 30% tangents added to LoCoMo conversations.
- Multi-hop leads by +15.7 points (0.427 vs 0.270) on clean LoCoMo — a purer knowledge graph yields cleaner retrieval chains.
- Counterintuitive finding: real dialogue is skipped more (53.9%) than injected noise (43.2%), because LLM-generated noise occasionally looks plausibly useful — a principled accuracy-efficiency tradeoff, not a failure.
- Lowering θ_low or adding an adaptive controller can tune the balance.
- Paper: D-MEM: Dopamine-Gated Agentic Memory via Reward Prediction Error Routing
- arXiv: 2603.14597
- Authors: Yuru Song (UC San Diego), Qi Xin (Carnegie Mellon)
- GitHub: https://github.com/london-and-tequila/dmem
- Baselines: A-MEM, MemGPT, MemoryBank
2. The RPE formula
RPE = min(1.0, I(Utility ≥ τ) × [Utility × (Surprise + β)])
3. Three-tier Fast/Slow routing
| Tier | Condition | Cost | |------|-----------|------| | SKIP | RPE < 0.3 | zero tokens | | CONSTRUCT_ONLY | 0.3 ≤ RPE < 0.7 | O(1), node into STM cache | | FULL_EVOLUTION | RPE ≥ 0.7 | O(N), sparse — contradictions, preference shifts, paradigm changes |4. Zero-cost retrieval augmentation
5. LoCoMo-Noise benchmark
Results (LoCoMo-Noise, ρ=0.75, GPT-4o-mini)
| Metric | A-MEM | D-MEM | |--------|-------|-------| | Token consumption | 1.64M | 319K (-80%) | | Single-hop F1 | 0.208 | 0.246 (+18%) | | Multi-hop F1 | 0.365 | 0.412 (+13%) | | Adversarial F1 | 0.388 | 0.412 (+6%) |
Core insight
> Memory is not about storing everything, but intelligently choosing what deserves to change your cognitive structure.
Future directions include distilling the utility classifier into a small task-specific model for near-zero per-turn cost, enabling on-device assistants.