When Memory Ages, Conflicts, or Must Be Rewound

A useful retrieval result is not automatically a useful memory forever. In ai-memory, a session summary, a durable decision, a repeated procedure, and a temporary focus have different lifetimes and different costs when they become stale. This chapter follows pages and learning proposals through retention, feedback, contradiction, consolidation, and forgetting so you can decide when automation should preserve, revise, review, or discard project history.

Not every memory should live the same way

The simplest memory system treats every stored item as equally durable. That creates two opposite failures. If everything is kept forever, a project fills with old session noise and a temporary workaround can look as important as a standing design decision. If everything is aggressively summarized or deleted, the system loses the evidence needed to understand why a decision was made or to recover from a failed approach.

ai-memory separates four broad roles. Working material belongs to the current session. It helps the agent keep track of what is happening now and is not meant to become permanent recall, even though bounded observations can remain in the operational database for forensics. Episodic material describes individual sessions or recent activity. It is useful while a project is actively changing, then becomes a candidate for decay if it is not reinforced.

Semantic material is distilled project knowledge: architecture notes, decisions, facts, or gotchas that should remain available indefinitely unless a later version supersedes them. Procedural material records a repeated way of working. It can also last a long time, but its value depends on whether the pattern continues to be observed. The distinction is practical. A current-focus page should be easy to replace; a database decision should be versioned; a release procedure should be revisited when the workflow changes.

Retention is governed by signals such as salience, age, access reinforcement, and optional breadth of distinct readers. A page that people repeatedly use may remain more valuable than an untouched episodic summary. Feedback can raise or lower salience for sweep-eligible material, while stale or wrong can flag a current page for lint review. These signals affect attention and retention, not truth. A frequently opened page can still be wrong, and an ignored page can still contain an important decision.

Pins and invariant slots protect selected pages from ordinary decay, but pinning is not a proof of correctness. It says that automation should not casually evict or rewrite the page. A pinned page still needs human review when the project changes. A time-to-live is a stronger temporal instruction: when a page is meant to last only through a migration or sprint, its expiry can remove it from ordinary retrieval, and the TTL outranks a pin rather than allowing “pinned” to defeat an explicit expiration.

A forget sweep then applies these policies through the wiki layer.