Replies: 4 comments
|
I’ve implemented an initial working prototype based on this proposal: https://github.com/oldnicke/hindsight/tree/feat/ebbinghaus-forgetting The implementation is currently split into two commits:
Before opening a PR, I’d appreciate maintainer feedback on:
My preference is to submit it incrementally:
The feature remains disabled by default, and automatic pruning requires a separate explicit opt-in. If this direction is acceptable, I’ll rebase onto the latest main branch, align the implementation with the preferred scope, add the remaining integration/migration coverage, and open the first PR linked to this discussion. |
|
Hindsight has most of the primitives to build something stacked on it with custom logics. the forgetting mechanism is very subjective and so far we haven't seen a clear, practical, concrete example of how and what to forget. recall already has recency decay builtin |
|
On open question 6 — "How should this interact with invalidation and restoration?" — there is a concrete answer, because Hindsight's invalidation is a storage move rather than a flag, and that collides with the proposed retention table. Invalidation retires a fact by moving its row out of The prototype branch ( So, proposed answer to Q6: archiving states something about attention, invalidation states something about truth, Hindsight already stores those separately, and a truth-state transition should carry retention state with it — snapshot it onto the archive row the way On the concrete-example point raised above — "a clear, practical, concrete example of how and what to forget" — the RFC's own list has one. "I had noodles for lunch today." is true, stays true, and is therefore never invalidatable; and by the RFC's own table the existing recency signal is anchored to occurrence time, so today it is the freshest thing in the bank. The target set is memories that are true, permanent, and not worth surfacing: exactly the gap between the two mechanisms that already exist. Disclosure: I maintain mneme, which took the opposite decision at this seam — a superseded claim keeps its row, carries AI-assistance disclosure: this comment was drafted with Claude Code under my authorization, and every claim it makes about my own project was checked against the repository before posting. |
|
This implementation above relies on the Ebbinghaus Forgetting Curve to manage memory across its entire lifecycle. Lately, I have been delving into a critical question: is the human-like memory forgetting mechanism truly an optimal forgetting scheme for agent memory? Should silicon-based entities inherit the inherent limitations of human memory decay? |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Summary
Introduce an optional forgetting and reinforcement mechanism for Hindsight's long-term memory.
The goal is to make memory retrieval behave less like a permanent fact database and more like human memory.
An Ebbinghaus-style forgetting curve is one possible implementation:
R(t)ΔtSMotivation
Human-like memory is particularly important for companion and relationship agents.
A companion should not behave like a mechanical database that permanently repeats every fact the user has ever mentioned. The character's memory and the user's own perception of their shared history should remain reasonably aligned.
Examples
This is not limited to companion agents. The same lifecycle is useful for personal assistants, adaptive tutors, game characters, and long-running agents whose memory stores would otherwise grow indefinitely.
Current behavior
Hindsight already applies configurable recency decay during recall reranking:
HINDSIGHT_API_RECENCY_DECAY_FUNCTIONHINDSIGHT_API_RECENCY_DECAY_LINEAR_WINDOW_DAYSHINDSIGHT_API_RECENCY_DECAY_HALFLIFE_DAYSThis mechanism primarily represents how recent the event itself is. It uses the memory's effective occurrence time and applies a small freshness adjustment to the final ranking.
The proposed mechanism represents a different signal:
For example, a fact may describe an event from ten years ago but have been reconfirmed yesterday. Its event recency should remain low while its retrievability should be high.
Hindsight also supports observation consolidation and memory invalidation, but currently does not model per-memory stability that changes after successful recall or use.
Proposed behavior
1. Retention model
Each memory receives persistent lifecycle state such as:
importancestability_dayslast_reinforced_atlast_recalled_atreinforcement_countaccess_countforgetting_exemptlifecycle_stateThe current retrievability should preferably be calculated at query time rather than periodically written to every memory:
This avoids continuously updating the entire memory table.
The initial stability may depend on:
2. Recall integration
Forgetting should be applied after candidate retrieval and semantic reranking, not as an early hard filter.
A possible scoring model is:
The adjustment should initially be conservative so that a highly relevant old memory can still be recovered when strongly cued.
RRF should continue producing candidates normally. Applying a hard forgetting threshold before RRF could make a forgotten memory impossible to recover even when the query provides a precise cue.
Recall traces should optionally expose:
{ "retrievability": 0.63, "stability_days": 45, "last_reinforced_at": "2026-07-20T10:00:00Z", "importance": 0.8, "forgetting_boost": 1.026, "lifecycle_state": "active" }3. Reinforcement
Possible reinforcement sources, from strongest to weakest, include:
Internal maintenance queries, candidate retrieval, failed Reflect operations, and consolidation searches should not reinforce memories.
Reinforcement should be asynchronous, idempotent, rate-limited, and subject to diminishing returns. For example:
This rewards successful recall after a meaningful interval while preventing rapid repeated queries from making a memory effectively permanent.
A cooldown window should ensure that repeated requests in the same session do not repeatedly increase stability.
4. Reflect and consolidated knowledge
Reflect may perform multiple internal searches, so each internal tool call should not immediately reinforce all returned memories.
Observations should have their own stability. When an observation is returned, its entire set of source memories should not automatically be reinforced. Sources should only be reinforced when they are independently returned or actually used.
Mental models can initially keep their existing freshness/staleness behavior. Source-aware mental model reinforcement can be considered separately once reliable provenance is available.
5. Archiving and pruning
A low-retention memory may become eligible for reversible archiving only when:
Archived memories should remain available to audit, export, direct lookup, and explicit restoration.
Automatic physical pruning should be a separate feature, disabled by default, with a longer retention period, dry-run support, bounded batches, and audit logging.
Suggested storage design
A separate one-to-one state table may be preferable to frequently updating
memory_unitsor storing system state inside user-controlled metadata:A separate idempotent reinforcement-event table could absorb write bursts and allow workers to batch updates by memory ID.
Configuration
The feature should be disabled by default and support gradual rollout.
observerankfilterlifecycleExample deployment configuration:
Per-bank overrides would be important because a companion bank, historical archive, customer-support knowledge base, and compliance store need very different behavior.
Suggested precedence:
Companion-agent example
Assume the user mentions these memories:
Expected behavior:
Performance constraints
The feature should avoid:
Preferred approach:
Rollout proposal
Phase 0: Observe mode
Phase 1: Conservative reranking
Phase 2: Asynchronous reinforcement
Phase 3: Filtering and reversible archiving
Phase 4: Optional cold storage or pruning
Acceptance criteria for the initial implementation
Open questions
Alternatives considered
Increase the existing recency-decay weight
This does not model reinforcement and confuses event recency with memory retrievability.
Periodically update a retention score on every memory
This creates continuous write amplification, stale values between jobs, and expensive multi-tenant scans.
Delete memories immediately below a threshold
This is difficult to calibrate and risks irreversible loss. Reversible archiving is safer.
Reinforce every retrieval candidate
This creates a popularity feedback loop and allows internal searches or repeated requests to make memories effectively permanent.
All reactions