The problem with permanent memory
A memory system that never forgets will eventually degrade. Stale facts accumulate at equal weight to recent ones. The agent’s knowledge doesn’t mature — it just grows noisier. Engram implements a lifecycle where memories decay, consolidate, and evolve — modelled on cognitive science interference theory.Decay
Memories decay when unused. The base formula:effective_multiplier is where Engram’s competition-aware decay comes in.
Competition-aware decay
Semantically similar memories suppress each other’s confidence over time — inspired by interference theory from cognitive psychology. Two memories about “programming language preference” compete:- Memories in crowded semantic neighbourhoods decay faster
- Distinct, unique memories decay more slowly
- The agent’s knowledge naturally consolidates toward the most reinforced beliefs
Consolidation pipeline
The 5-stage background consolidation pipeline runs periodically:Episode clustering
Raw episodic memories are grouped by semantic similarity into coherent experience clusters.
Belief extraction
Repeated patterns in episode clusters are extracted as semantic beliefs with confidence derived from cluster size and consistency.
Procedure detection
Successful trigger-action patterns from episodes are promoted to procedural memories.
Schema derivation
Dense clusters of consistent semantic memories are promoted to schema memories — high-level mental models of the user.