cd /news/artificial-intelligence/usage-reinforced-decay-engine-outper… · home topics artificial-intelligence article
[ARTICLE · art-72032] src=insideai.news ↗ pub= topic=artificial-intelligence verified=true sentiment=· neutral

Usage-Reinforced Decay Engine Outperforms Recency Windows for AI Memory

A new memory engine for AI agents using the Ebbinghaus forgetting curve achieved a 100% Foundational Recall Rate across 150-turn sessions while a recency-window baseline scored 0%, developer E.P. Alexander reported on July 24, 2026. The deterministic, dependency-free system scores retention based on recall frequency and evicts items when the score drops below 0.20, but its advantage vanishes when facts are never recalled. The complete code is available on GitHub.

read3 min views1 publishedJul 24, 2026
Usage-Reinforced Decay Engine Outperforms Recency Windows for AI Memory
Image: Insideai (auto-discovered)

July 24, 2026, (Inside AI) — A new memory engine for AI agents uses the 140-year-old Ebbinghaus forgetting curve to keep foundational facts alive across hundreds of turns, outperforming standard recency-window pruning in long-running sessions. The system, built by developer E.P. Alexander, is fully deterministic and requires no external dependencies, yet it exposes a hard limit where its advantage vanishes entirely.

Most production AI agents evict old context with a sliding window: if an item hasn't been touched in N turns, it's deleted. This treats a critical instruction from turn 1 identically to a debug log from turn 40. Alexander's engine scores retention based on recall frequency, where each use reinforces an item's stability and pushes its eviction horizon out non-linearly. In tests across 50 seeded sessions, the engine maintained a 100% Foundational Recall Rate while the recency-only baseline scored 0%.

The core math comes from Hermann Ebbinghaus's 1885 experiments on human memory, which showed that retention drops sharply at first but flattens with review. Alexander is not the first to apply this to AI agents—projects like YourMemory and Stanford's Generative Agents have used similar concepts—but this implementation is stripped to a minimal, verifiable core. "I just wanted to see if I could build the absolute smallest, fully deterministic version of this myself with zero dependencies, run it against the basic sliding window most systems actually use, and find the exact point where it breaks," Alexander writes.

The engine uses two classes with identical interfaces, differing only in eviction logic. Retention is scored as R = e^(-d/s), where d is turns since last recall and s is stability. Each recall updates stability via s_new = s_old * (1 + 0.5 * log(1 + r)), with r being the recall count. An item is evicted when its score drops below 0.20. The baseline simply checks if d > window_size.

Alexander tested the system on 150-turn sessions with three foundational facts and three noise items per turn. Both engines pruned about 90% of noise, but the decay engine kept all foundational facts while the baseline lost them all. The result held across noise levels from 3 to 60 items per turn and across 15 threshold-window combinations. Even a window size of 50—triple the default—couldn't recover the baseline's performance.

However, the advantage disappears when a fact is never recalled. In a failure-case test, both engines scored 0%. "The mechanism does not rescue facts that nobody ever uses again," Alexander notes. "It specifically, and only, rewards the facts that actually get reused."

Two bugs nearly invalidated the benchmarks. First, a default stability of 2.0 caused items to decay past the threshold before their first scheduled recall; raising it to 8.0 gave a 13-turn grace period. Second, uniform-random recall scheduling made success structurally impossible because recalls almost always arrived after both engines' grace periods expired. Alexander fixed this by using spaced-repetition intervals with jitter, modeled on how facts are actually used in real sessions.

The engine is not a silver bullet. It treats all items as equal token weight, requires explicit recall triggers, and uses defaults tuned for a specific session shape—early establishment, a quiet middle, and late resurfacing. It also doesn't resolve conflicting memories. "A recency window is not a bad idea implemented poorly," Alexander concludes. "It is a simple, cheap policy designed to answer exactly one question: when was this last touched? That works perfectly for sessions where importance and recency happen to align. It quietly breaks the moment they do not."

The complete code is available on GitHub, and the underlying research on spaced repetition is detailed in a 2006 meta-analysis by Cepeda et al.

── more in #artificial-intelligence 4 stories · sorted by recency
── more on @e.p. alexander 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/usage-reinforced-dec…] indexed:0 read:3min 2026-07-24 ·