I built memory decay for AI agents using the Ebbinghaus forgetting curve
Source: Dev.to
Problem
Most AI memory systems treat every fact equally, forever.
If you tell Claude you use React, then six weeks later say you switched to Vue, both facts remain in memory with the same weight. The system has no way to know which one is current, so you either manually delete the old one or the model gets confused.
Solution – YourMemory
YourMemory is an MCP memory server that applies the Ebbinghaus forgetting curve to retrieval. Memories decay over time based on importance and how often they’re recalled. Frequently accessed memories stay strong, while memories you never revisit fade out and are pruned automatically.
Retrieval Score
score = cosine_similarity × Ebbinghaus_strength
strength = importance × e^(−λ_eff × days) × (1 + recall_count × 0.2)Benchmark
I ran YourMemory against Mem0 on the LoCoMo dataset from Snap Research (200 QA pairs across 10 multi‑month conversation samples).
| Metric | YourMemory | Mem0 |
|---|---|---|
| [Insert specific metric values here] | [value] | [value] |
Implementation
YourMemory provides three MCP tools:
recall_memorystore_memoryupdate_memory
Add it to your Claude settings.json to persist context across sessions:
{
"mcpServers": {
"yourmemory": {
"command": "yourmemory"
}
}
}Claude then follows a recall → store → update workflow on every task. Memories it surfaces frequently get reinforced; memories it never touches decay.
Technical Stack
- PostgreSQL +
pgvectorfor vector storage - Docker + Ollama for deployment (currently a manual setup)
Current Status & Call for Feedback
- Early stage; core decay model is solid.
- Setup still requires manual steps.
I would love feedback on the decay parameters and whether this approach holds up at scale.
Links
- GitHub repository:
- Full benchmark methodology: