From Neurons to Code Engineering: The Forgetting Design of the PowerMem Memory System

Nature designed memory and forgetting systems for living organisms. We want to translate that design into code you can configure and tune.

🧠 If you’d like to give your own AI Agent a “token-efficient, smarter” memory, come check out https://github.com/oceanbase/powermem. PowerMem has already turned the science of forgetting into tunable, ready-to-use code!

Why We Need Forgetting

What would it look like if an AI Agent remembered every single thing I ever said? At first glance it sounds reasonable. But the truth is, a genuinely reliable memory isn’t one that simply hoards everything. Forgetting matters just as much as remembering. The same holds for an Agent’s memory system: forgetting isn’t a defect, it’s a capability.

Conceptual illustration of AI Agent memory and forgetting capabilities

You’re welcome to follow the OceanBase community WeChat account “Lao Ji’s Tech Talk.” Both cognitive science and engineering practice reach the same conclusion: a memory system without forgetting isn’t more powerful, it’s less efficient. The reasons are simple:

  1. Retrieval quality decays: old and new memories interfere with each other in the semantic space, and a flood of irrelevant high-frequency results dilutes precise matches. As the memory volume grows, the signal-to-noise ratio of retrieval keeps dropping.
  2. Storage cost becomes uncontrollable: endlessly accumulating memories require endless storage, and most low-value information is never retrieved at all, wasting resources.

PowerMem has an elegant design for its forgetting mechanism: it determines when a memory dies and how it is weighted when ranked during retrieval.

1. Nature’s Forgetting Design, From Neurons to the Cognitive System

1.1 Synaptic Plasticity

At the neuroscience level, the physical substrate of memory is the synaptic connections between neurons.

Diagram of synaptic connections between neurons

These connections aren’t static; they are continuously regulated by two opposing mechanisms:

  • Long-Term Potentiation (LTP): when a neural pathway is used frequently, the corresponding synaptic connection is strengthened. This is the biological basis of memory.
  • Long-Term Depression (LTD): when a neural pathway is used infrequently, the corresponding synaptic connection is weakened. This is the biological basis of forgetting.

If every synapse were strengthened equally, the neural network would completely lose its ability to distinguish signal from noise. LTD selectively weakens inactive connections, concentrating limited synaptic resources on the active pathways. Forgetting is the price a memory system pays for discernment.

1.2 Filtering From the Hippocampus to the Neocortex

A further mechanism is memory consolidation. Newly formed memories are first held temporarily in the hippocampus; then, during sleep, the brain gradually transfers these memories from the hippocampus to the neocortex for long-term storage through memory replay.

The hippocampus is like a computer’s RAM: limited in capacity, fast to read and write, but short in retention.

Diagram of the memory consolidation process transferring from the hippocampus to the neocortex

But this transfer isn’t wholesale. Only information that is repeatedly activated while awake, richly associated with existing knowledge, or accompanied by strong emotional experience earns priority for transfer. Isolated, one-off information that lacks emotional markers naturally falls away during the transfer.

This mechanism is the biological blueprint for PowerMem’s three-tier memory model (working → short_term → long_term).

1.3 Forgetting Isn’t About Failing to Store, but Failing to Retrieve

The core insight of interference theory is that memory retrieval fails not because information was never stored, but because it cannot be retrieved. And as the amount of stored information grows, the cross-interference between memories increases exponentially. The role of the forgetting mechanism is to decay low-value memories, reducing the interference density within the retrieval space.

2. Shannon’s Information-Theoretic View: Forgetting Is an Information Filter

2.1 The Mathematical Definition of Information

1
I(x) = -log₂(p(x))

The amount of information in an event is inversely proportional to its probability of occurrence: the rarer and more surprising the event, the more information it carries.

2.2 Mapping It to a Memory System

  • What you ate for breakfast yesterday → happens every day, probability p≈1 → not worth long-term storage
  • The master password of the company database → rarely asked about, p is tiny → must be persisted

So a well-designed forgetting mechanism is essentially an information filter.

3. The Ebbinghaus Forgetting Curve

3.1 Turning Memory Into Measurable Data

In 1885, Ebbinghaus used himself as the test subject and invented around 2,300 nonsense syllables for his experiments:

Time Interval Retention Rate
Just learned 100%
20 minutes ~58%
1 hour ~44%
9 hours ~36%
1 day ~33%
2 days ~28%
6 days ~25%
31 days ~21%

Two conclusions that still stand to this day: forgetting is an exponential curve, fast at first and slow later; and review can rewrite the curve.

3.2 The Modern Exponential Decay Model

1
R(t) = e^(-λt)

The core characteristic of forgetting is that the rate of forgetting is proportional to the amount of memory still retained.

Diagram of the exponential decay model of the Ebbinghaus forgetting curve

3.3 Spaced Repetition and Desirable Difficulty

Ebbinghaus made another discovery: spaced repetition can reset the forgetting curve, and the decay rate after each reset is slower than the one before. The concept of “Desirable Difficulty”, proposed by Robert Bjork in 1994, precisely describes this phenomenon: retrieval that is just effortful enough to stimulate adaptation is the most efficient way to learn.

4. PowerMem’s Three-Tier Memory Architecture

4.1 Mapping From Biology to Code

Tier Biological Analogy Decay Rate Multiplier Typical Lifespan Promotion Condition
working (working memory) Prefrontal cortex ×2.0 Hours to 1 day access≥3 or importance≥0.6
short_term (short-term memory) Hippocampus ×1.5 Days to weeks access≥3 or importance≥0.6
long_term (long-term memory) Neocortex ×1.0 Weeks to months — (already at the top tier)

Classification logic: importance≥0.8→long_term, ≥0.6→short_term, <0.6→working. The decay multiplier is the core differentiating parameter.

4.2 The Overall Architecture of Forgetting Management

  • ImportanceEvaluator: judges the importance of information, outputting a score from 0.0 to 1.0
  • EbbinghausAlgorithm: decay computation, review scheduling, and forget/promote/archive decisions
  • EbbinghausIntelligencePlugin: injects management logic at the key nodes of memory creation, access, and search
  • MemoryOptimizer: exact deduplication (MD5) + semantic deduplication (cosine similarity) + memory compression (LLM)

Overall architecture diagram of PowerMem forgetting management

4.3 Forgetting Is Not Just Deletion

Search results are ranked by the following formula: final_score = relevance_score × decay_factor

Forgetting isn’t merely a delete switch; it’s a regulator of retrieval quality.

Conclusion: Why We Need Forgetting

Forgetting is the foundation of ranking, creating differentiation through decay. Forgetting lets memory evolve, as frequently accessed memories are continually consolidated. Forgetting is continuous, not binary—a continuous decay spectrum from 1.0 to 0.0, which more closely matches how human memory works.

This is how nature designed it, and PowerMem has translated that design into code you can configure, tune, and understand.

PowerMem on GitHub: https://github.com/oceanbase/powermem

This article was written based on PowerMem v1.1.1.

PowerMem open-source project promotional illustration