Skip to content

Mental model

Supersession, decay, and forget

Most memory products fold three different questions into a single "delete" or "rank lower" behaviour. A correction can disappear, a stale preference can still win at retrieval, or an erasure request can leave records in a backup table nobody queries.

SurrealDB Agent Memory keeps the three mechanisms separate:

QuestionMechanismExample
“This replaced that.”SupersessionYou preferred formal tone in March; you prefer casual now. The old instruction stays in history with a bounded validity interval; the new one is current.
“This stopped being relevant.”DecayA sprint goal from three weeks ago carries less weight than one set this week.
“This should not exist for the agent.”Forget (soft by default)“Forget everything about my old job.” Matched beliefs expire from current retrieval; see Forgetting memories.

If these share one overwrite or one ranking pool, you either lose the audit trail or you let two "current" beliefs fight at query time.

When an updated preference or corrected fact arrives from the same kind of source (for example two statements from the same user over time), SurrealDB Agent Memory treats it as you changing your mind, not a contradiction to flag.

  • The prior belief is closed in time, not erased.

  • The new belief becomes the single current answer for “what is true now?”

  • You can still ask what the value was last month and when it changed.

Instructions behave the same way: “always use formal tone” superseded by “prefer casual” means the agent follows casual now, but the shift remains auditable.

Cross-provenance clashes are different - an uploaded policy versus a user assertion - and surface as uncertainty instead of a clean supersession. See Authority when pillars meet.

Not everything should live at full strength forever. Context fades quickly; knowledge fades more slowly; identity is comparatively stable. SurrealDB Agent Memory applies category-aware importance decay on a schedule.

Decay is not blind deletion: a decayed fact can still be retrieved. Recall does not currently raise a fact's importance, so a fact that is retrieved often decays at the same rate as one that is never retrieved.

The decay pass runs once a day and multiplies each fact's importance by a fixed rate for its category:

CategoryRate per pass
context0.95
knowledge0.995
identity1 (no decay)

Decay changes importance only. It never ends a fact, so a decayed fact can still be retrieved.

The figure below plots the starting importance and daily rate of each category over 60 days.

Importance over 60 days with one decay pass a day. Identity facts start at 1.0 and do not decay. Knowledge facts start at 0.8 and are multiplied by 0.995 a day, reaching 0.59 at day 60. Context facts start at 0.5 and are multiplied by 0.95 a day: 0.35 at day 7, when the fact expires and gets a valid_until, then 0.11 at day 30 and 0.02 at day 60. Decay changes importance only and never ends a fact.Importance over 60 days with one decay pass a day. Identity facts start at 1.0 and do not decay. Knowledge facts start at 0.8 and are multiplied by 0.995 a day, reaching 0.59 at day 60. Context facts start at 0.5 and are multiplied by 0.95 a day: 0.35 at day 7, when the fact expires and gets a valid_until, then 0.11 at day 30 and 0.02 at day 60. Decay changes importance only and never ends a fact.

A context fact expires 7 days after its known time (created_at). Agent Memory checks for these facts every hour. Expiry sets the fact's valid_until, so the fact leaves current retrieval but stays in the entity's history. Nothing is deleted.

The expiry pass applies to context attributes and actions. It skips:

  • facts that already have a valid_until

  • facts that a later value superseded

  • relations, whatever their category

  • topic rollups and gists, which end when the facts they summarise end

Warning

The 7 days count from the known time, not from the write. A backfill that sets observed_at more than 7 days in the past writes context facts that expire at the next hourly check. To keep backfilled facts current, write them as triples with a memory_category of knowledge or identity. See Setting the category.

The 7-day expiry and the decay rates are the same for every Context, scope and principal, and on every deployment, including Enterprise deployments. You cannot set them per Context or per scope. You control them in these ways:

  • Choose the category at write time. Triples take a memory_category, so a fact that must not expire can be written as knowledge or identity.

  • Run a pass on demand. POST /api/v1/{context_id}/lifecycle/expire runs the expiry pass and needs the memory:forget grant. POST /api/v1/{context_id}/lifecycle/decay runs the decay pass across the whole Context and needs the grant:manage grant over /. Both use the same rules as the scheduled passes.

Background consolidation can also crystallise repeated observations into durable beliefs (source.kind = "consolidation") - the “between conversations” evolution described in Traces and memory evolution.

When something must stop influencing the agent - privacy, compliance, or a hard reset - use POST /forget or entity delete. Default behaviour expires matched records from current retrieval while keeping audit history; purge: true and scoped forget exist for erasure requirements.

Forget does not block future extraction: if a later turn mentions the same topic again, new memory can be created. Combine product policy with forget when a topic must stay gone.

The figure below compares what each mechanism on this page leaves in current recall, in point-in-time reads, in history and in storage.

What each way of retiring a fact leaves behind. A correction (supersession): current recall shows the new value only, point-in-time reads serve the old value, correction history and storage are kept. Context expiry, 7 days after known time: no longer returned by current recall, still served by point-in-time reads, history and storage kept. Decay: still returned, point-in-time reads and history unchanged, stored. Forget or entity delete: no longer returned, withheld from point-in-time reads, history kept and stored for audit. Forget with purge: removed from recall and point-in-time reads, history and storage erased. Scoped forget: removed and erased, with the subtree hard-deleted. Tombstoning a scope node only retires the folder in the scope vocabulary.What each way of retiring a fact leaves behind. A correction (supersession): current recall shows the new value only, point-in-time reads serve the old value, correction history and storage are kept. Context expiry, 7 days after known time: no longer returned by current recall, still served by point-in-time reads, history and storage kept. Decay: still returned, point-in-time reads and history unchanged, stored. Forget or entity delete: no longer returned, withheld from point-in-time reads, history kept and stored for audit. Forget with purge: removed from recall and point-in-time reads, history and storage erased. Scoped forget: removed and erased, with the subtree hard-deleted. Tombstoning a scope node only retires the folder in the scope vocabulary.

Existing model context windows encourage compaction, namely the process of squashing a long thread into a summary. Summaries are inherently lossy, often discarding details you did not know you would need later.

SurrealDB Agent Memory’s approach is complementary: important facts from turns are promoted into durable, queryable memory (entities, attributes, instructions) while the full episodic transcript remains addressable via sessions and provenance. Consolidation and reflection run between interactions so you are not dependent on remembering to compact at the right moment for memory to survive the next session.

The reconciler owns the bookkeeping guarantees - supersession chains, confidence floors, decay schedules, uncertainty when sources disagree. Signals come from agent actions: turns, corrections, document ingest, reflection, and traces of what was retrieved and used.

When the system genuinely cannot decide (cross-provenance conflict, confidence below the calibration floor), it records uncertainty for the agent or a higher-level policy to resolve rather than silently picking a winner.

Was this page helpful?