I built memory decay for AI agents using the Ebbinghaus forgetting curve

Published: (March 15, 2026 at 04:35 AM EDT)
2 min read
Source: Dev.to

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).

MetricYourMemoryMem0
[Insert specific metric values here][value][value]

Implementation

YourMemory provides three MCP tools:

  • recall_memory
  • store_memory
  • update_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 + pgvector for 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.

  • GitHub repository:
  • Full benchmark methodology:
0 views
Back to Blog

Related posts

Read more »

Travigo

Travel as fast as you speak with Gemini! Where live agents meet immersive storytelling & 3D navigation. This project was created for entering the Gemini Live Ag...

Micro games

Hey Gamers! 👾 As part of the Rapid Games Prototyping module, we are tasked with reviewing a peer's game. The challenge is to analyse a prototype built in just...