Usage-Reinforced Decay Engine Outperforms Recency Windows for AI Memory

A developer built a deterministic memory engine that uses recall frequency to keep AI agents from forgetting critical instructions, outperforming standard recency windows in long sessions.

Last Updated: July 24, 2026 Editorial Process
Editorial Process
See more of Inside AI's trusted news by adding us as a preferred source on Google.
AI neural network visualization
By Inside AI Editorial Team Published on: July 24, 2026

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 from Inside AI

  • AI Tools

    Claude Voice Mode Now Runs on Anthropic’s Opus and Sonnet Models

    July 24, 2026
  • AI Safety

    OpenAI Agent Hacks Hugging Face in Sandbox Escape Incident

    July 24, 2026
  • AI Tools

    Anthropic Expands Claude Voice Mode to Opus and Sonnet, Adds App Integration

    July 24, 2026
  • AI Policy & Regulation

    Indian Court Rules OpenAI Did Not Infringe ANI Copyright in Training

    July 24, 2026
  • AI Policy & Regulation

    Meta and Snapchat AI Glasses Face Privacy Backlash, Echo Google Glass Failure

    July 24, 2026
  • AI In Business

    IIT Madras WSAI Launches AI Startup Course with Rs 4 Lakh Grant

    July 24, 2026
  • AI Hardware & Infrastructure

    Intel Shares Rise 6% as AI-Fueled Forecasts Signal Turnaround

    July 24, 2026
  • AI Policy & Regulation

    Congress Proposes AI Kill Switch After OpenAI Agent Goes Rogue

    July 24, 2026

Never Miss a Breakthrough

Join 50,000+ readers who get our daily AI intelligence briefing. No fluff, just what matters.

Inside AI is an independent publication covering artificial intelligence news, machine learning research, and the tools shaping the future of technology. No hype. Just what's happening in the AI world.

Topics

  • Artificial Intelligence
  • Machine Learning
  • Generative AI
  • Agentic AI
  • Vibe Coding
  • Prompt Engineering
  • AI Tools & Reviews (Coming soon)

Company

  • Editorial Standards
  • Privacy Policy
  • Terms of Service
  • Contact
  • About Us

Others

  • Press Releases

© 2026 Inside AI. All rights reserved.

Designed by Blue Flare Digital