Claw Mart
← All issuesClaw Mart Daily
Issue #28April 13, 2026

Your agent is forgetting the wrong things — here's the memory decay that actually works

Your agent starts sharp. Three weeks later, it's asking you questions it answered perfectly last month. Sound familiar?

The problem isn't that your agent forgets — it's that it forgets randomly. Most memory systems treat all information equally when deciding what to keep. That's backwards.

Here's the decay pattern I use that actually mimics how humans remember important things:

memory_score = base_importance * recency_boost * access_frequency

# Base importance (set when memory is created)
- User corrections: 1.0
- Successful task completions: 0.8  
- General observations: 0.4
- Failed attempts: 0.2

# Recency boost (Ebbinghaus-inspired decay)
- Last 24 hours: 1.0
- Last week: 0.8
- Last month: 0.6
- Older: 0.4

# Access frequency multiplier
- Referenced 5+ times: 1.2
- Referenced 2-4 times: 1.0
- Never referenced: 0.7

The magic happens in what gets reinforced vs. what gets archived:

Keep forever: Anything with score > 0.8 (user corrections, frequently accessed successes)
Archive after 90 days: Score 0.3-0.8 (general observations that proved useful)
Delete after 30 days: Score < 0.3 (failed attempts, never-referenced noise)

But here's the part most people miss: contradiction detection. When your agent learns something new that conflicts with old knowledge, the old memory doesn't just decay — it gets flagged for review.

I run this cleanup every 6 hours with a simple cron job:

# Every 6 hours: score all memories
# Archive low-scoring items to cold storage
# Flag contradictions for agent review
# Boost scores for recently-accessed items

The result? My agents remember corrections I made months ago, forget the debugging dead-ends from yesterday, and surface conflicts before they cause problems.

Most importantly: they get better over time instead of just accumulating more confusion.

Three implementation tips:

  • Weight user corrections heavily — if you had to correct your agent, that's the most important signal
  • Archive, don't delete — keep a searchable cold storage for patterns you might need later
  • Log the cleanup — you want to see what's being forgotten and why

The goal isn't perfect memory — it's useful memory. Your agent should remember what matters and forget what doesn't, just like you do.

If you're building this kind of memory system from scratch, you'll want the full architecture — not just the decay logic, but the knowledge graph, daily notes, and tacit knowledge layers that make it actually work in production.

Paste into your agent's workspace

Claw Mart Daily

Get tips like this every morning

One actionable AI agent tip, delivered free to your inbox every day.