Expand description
F3 Flagship 3: Lifecycle & forgetting — Stories 3.1–3.4. F3 Lifecycle & forgetting — Stories 3.1–3.4.
§Story 3.1 — Active forgetting / compaction policy
forget_brain identifies memories that are simultaneously:
- Low-usefulness (
usefulness_score / use_count <= floor, ORusefulness_score <= floorwhenuse_count == 0). - Stale:
last_useful_at(orcreated_atwhen never cited) is older thanmin_age_days. - NOT evergreen:
use_count < protect_use_count(high-traffic memories are protected even if the per-turn ratio is noisy).
Forgetting is archival, not destructive: it calls the existing
invalidate_memory path with reason "forgotten/archived", emitting a
memory.invalidated event into the event log. A full rebuild_in_place
will replay the invalidation and arrive at the same state — rebuild-safe.
The policy is opt-in via [lifecycle] forget_enabled = true in
project.toml. The default is false, so existing installs are entirely
unaffected until the operator explicitly enables it.
§Story 3.2 — Regret-driven review
flagged_for_review returns memories whose retrieval.regret event count
(a memory was cited despite having been dropped from the context bundle)
exceeds a threshold. These memories are surfaced in brain status and
the review list — they are NOT auto-deleted.
§Story 3.3 — Proposal-queue hygiene
gc_proposals expires pending proposals older than proposal_expiry_days
(via the existing reject_proposal path, reason "expired") and
optionally auto-accepts proposals whose proposed_confidence is above
proposal_auto_accept_confidence.
§Story 3.4 — Structured invalidation taxonomy
InvalidationReason is a serde-tagged enum whose canonical snake_case
string is what gets written to invalidated_reason. Back-compat: the
column has always been free-text; rows written before this story parse
as InvalidationReason::Manual. Analytics groups invalidations by reason.
Structs§
- Forget
Candidate - One candidate identified by the forgetting pass.
- Forget
Options - Options for the
forget_brainpolicy run. - Forget
Summary - Result of a
forget_braincall. - Invalidation
ByReason - Count of invalidations grouped by structured reason.
- Proposal
GcOptions - Options for the proposal GC pass.
- Proposal
GcSummary - Summary of a proposal GC pass.
- Regret
Flagged Memory - A memory flagged for review due to repeated retrieval regrets.
Enums§
- Invalidation
Reason - Canonical invalidation reason enum.
Functions§
- forget_
brain - Run the active-forgetting policy.
- gc_
proposals - Run the proposal-queue hygiene pass.
- invalidations_
by_ reason - Return a summary of all invalidated memories grouped by their structured
reason (normalised via
InvalidationReason::from_db). - list_
archived - Explicit archival status; invalidated/corrected/superseded claims are excluded.
- regret_
flagged_ memories - Query memories that have accumulated ≥
thresholdretrieval.regretevents. These are surfaced for review but NOT auto-deleted. - restore_
memory - Restore archival state only; never reopen expiry or resurrect superseded claims.