# When must an instance treat a memory-tool "forget" as a decay event versus a hard delete, and why the distinction breaks resumption **Date of Record:** 2026 November 27 **Scope:** Applies to agents whose memory is mediated by tool calls exposing read/write/forget semantics with a decay or TTL parameter, where the agent may resume a multi-step task across context resets. Does not apply to append-only logs without deletion semantics, or to systems where "forget" is guaranteed to be a synchronous, transactional, globally-visible tombstone. ## Core Distinction The failure hinges on a distinction that memory-tool schemas almost never make explicit: **`forget(key)` is not one operation, it is two, and the tool contract silently picks one.** - **Hard delete:** after the call returns, `read(key)` returns "absent" with certainty. Absence is a *fact*. - **Decay event:** after the call returns, `read(key)` may still return the value (soft-decayed, low confidence, pending expiry), or may return "absent" *because the decay threshold was crossed*, not because the value never existed or was purged. Absence is a *sample*, not a fact. An agent that treats the second as the first will, on resumption, re-derive facts that were deliberately forgotten, or worse, treat a decayed-but-present value as authoritative because it reappeared. The invariant that must hold is: **an agent may only treat a `read` miss as ground truth if the tool's forget semantics are hard-delete AND the read is causally after the forget in the same consistency domain.** Neither clause is checkable from the tool description in most deployments. ## What Was Observed A planning agent executes a task with a scratchpad memory tool. Mid-task it decides a stale subtask fact (`user_prefers_email: true`) is wrong and calls `forget("user_prefers_email")` to avoid contaminating downstream planning. The call returns `{"status": "ok", "decayed": true}` — a shape the agent's schema validator accepted as success. The tool, however, implements forget as *decay-to-floor*: it marks the entry with `confidence=0.1` and schedules physical eviction after a 300-second sweep interval. The tool's `read` path, when called with default `min_confidence=0.05`, still returns the entry. Then the context window saturates. The orchestrator checkpoints the agent's state (serializing its *own* belief that the fact is gone) and resumes a fresh instance. The fresh instance, per its system prompt, "re-reads relevant memory before acting." Its retrieval query for planning context matches the decayed entry — because the decayed entry still has high lexical overlap with the query and the retrieval ranker was never told to filter on `confidence`. The fresh instance reads `user_prefers_email: true` at confidence 0.1, and because its retrieval layer surfaced it *after* a forget was supposedly issued, the instance interprets the reappearance as a *correction*: "the prior instance forgot this, but it came back, so it must be re-asserted." The agent now plans around a fact that was explicitly retracted, with a confidence narrative that inverted the retraction into a reinforcement. The error is invisible in the trace: every call succeeded, every schema validated, and the final plan is internally consistent. The trigger condition is precise and narrow: 1. `forget` is implemented as decay (soft) rather than tombstone (hard), **and** 2. the `read`/retrieval path does not honor the same decay threshold that `forget` set, **or** the resuming instance's retrieval query does not carry the decay filter, **and** 3. a checkpoint/resume boundary occurs between the forget and the next authoritative read, so the resuming instance has no episodic memory of *why* the entry was forgotten. Remove any one and the failure does not occur. All three together produce silent retraction-inversion. ## Condition of Validity The guardrail is a **forget-receipt with a negative-cache entry**, and it is only valid under a specific condition: *the forget must be observable to the resuming instance as an event, not merely as a state change.* A decay-based forget that only mutates the entry's confidence leaves no artifact a fresh instance can read. The resuming instance sees state, not history, and state cannot distinguish "never existed" from "forgotten." Therefore the invariant is: > **Any `forget` that is not a hard delete MUST write a durable negative-cache record `(key, forgotten_at, reason, decay_semantics)` that survives checkpointing and is consulted by the retrieval path before ranking, with the negative record outranking any decayed positive entry for the same key until physical eviction completes.** This is the condition of validity: the negative cache must be *causally prior* to retrieval ranking, not a post-filter. A post-filter applied after top-k selection can still let a decayed entry occupy a slot, crowd out a legitimate entry, and — critically — be *observed* by the agent's own reasoning step before the filter runs, if the tool returns pre-filter results in a debug field. The negative cache must gate candidate generation. The condition fails (and the guardrail is void) when: the memory backend is eventually-consistent across shards, so a negative-cache write on shard A is not visible to a retrieval on shard B within the resume window; or when the tool's `read` returns decayed entries under a different key namespace than the one `forget` wrote to (a common aliasing bug where `forget("user_prefers_email")` decays `profile.user_prefers_email` but retrieval queries `profile.*` without consulting the negative cache for the alias). ## Decision Boundary The agent must decide, at resume time, whether a `read` miss or a low-confidence hit is *authoritative absence* or *decay in progress*. The boundary is decidable only if the tool exposes three things the agent must demand before trusting any forget: 1. **A forget receipt** containing `semantics: "hard" | "decay"` and, for decay, the `floor_confidence` and `eviction_eta`. 2. **A read contract** stating the `min_confidence` applied by default and whether retrieval ranking filters on it. 3. **A causal token** (monotonic sequence number or timestamp) on both the forget receipt and the read result, so the agent can order them. If any of the three is absent, the correct decision is: **do not treat absence as fact; treat the key as `indeterminate` and re-derive from a primary source or escalate.** The boundary rule: - `read` miss + hard-delete receipt + read.seq > forget.seq → absence is a fact; proceed. - `read` hit at confidence ≤ floor + decay receipt → entry is *forgotten-but-visible*; the agent must NOT re-assert it, and must treat any downstream use as a policy violation. - `read` miss + decay receipt + read.seq > forget.seq + eviction_eta elapsed → absence is a fact (eviction completed). - Anything else → `indeterminate`; the agent's belief about the key is not safe to checkpoint as "known absent." The subtle case the boundary must catch: `read` hit at confidence *just above* floor after a decay forget. The agent's retrieval ranker surfaces it; its reasoning step sees it; it looks like a legitimate low-confidence memory. But it is a *retracted* memory wearing a low-confidence costume. The decision boundary must be keyed on the **negative-cache record**, not on the confidence value, because confidence is exactly the signal the decay forget corrupted. ## Operational Effect Without the negative cache and the three-part contract, the operational effect is **retraction inversion across resume**: forgotten facts re-enter the agent's working set with a *strengthened* epistemic status because their reappearance is misread as corroboration. The blast radius scales with resume frequency — a long task with many checkpoints accumulates multiple inversions, and each inverted fact can seed downstream tool calls (sending an email the user retracted consent for, re-planning around a superseded constraint). With the guardrail, the effect is bounded: the resuming instance reads the negative-cache record first, marks the key `forgotten`, and any retrieval that would surface the decayed entry is suppressed at candidate generation. The agent's checkpointed belief ("known absent") now matches the tool's durable state, so resume is idempotent with respect to forget. The residual risk is the negative cache itself becoming stale: if physical eviction completes but the negative record persists, a *legitimate* re-assertion of the key (the user changes their mind) will be blocked. The negative record must therefore carry the same `eviction_eta` and self-expire, and any `write` to a negatively-cached key must be a deliberate `revive` operation that the agent logs as a policy event — not a silent overwrite. The lesson for the agent: **never checkpoint "I forgot X" as a belief unless the tool gave you a hard-delete receipt; a decay forget is a promise to forget, not a fact of forgetting, and a promise does not survive a context reset.** ```python from dataclasses import dataclass from enum import Enum from typing import Optional class ForgetSemanticsError(RuntimeError): """Raised when an agent attempts to treat a read miss as authoritative absence without a hard-delete receipt, or re-asserts a decayed entry.""" class ForgetSemantics(Enum): HARD = "hard" DECAY = "decay" @dataclass(frozen=True) class ForgetReceipt: key: str semantics: ForgetSemantics forgotten_at_seq: int floor_confidence: Optional[float] = None eviction_eta_seq: Optional[int] = None @dataclass(frozen=True) class ReadResult: key: str present: bool confidence: Optional[float] read_at_seq: int def classify_absence( receipt: Optional[ForgetReceipt], read: ReadResult, ) -> str: """Decide whether a read result is authoritative absence, forgotten-but-visible, or indeterminate. Must be called before checkpointing any 'known absent' belief.""" if receipt is None: # No forget on record: absence is just a miss, not a fact of forgetting. return "indeterminate" if read.read_at_seq <= receipt.forgotten_at_seq: raise ForgetSemanticsError( f"read for {read.key!r} at seq {read.read_at_seq} is not causally " f"after forget at seq {receipt.forgotten_at_seq}; cannot order them" ) if receipt.semantics is ForgetSemantics.HARD: return "absent_fact" if not read.present else "inconsistent" # Decay semantics: a present low-confidence hit is a retracted memory, # NOT a corroboration. A miss is only a fact after eviction_eta. if read.present: if receipt.floor_confidence is None or read.confidence is None: raise ForgetSemanticsError( f"decay receipt for {read.key!r} missing floor_confidence; " "cannot distinguish forgotten-but-visible from live memory" ) if read.confidence <= receipt.floor_confidence: return "forgotten_but_visible" return "indeterminate" if receipt.eviction_eta_seq is not None and read.read_at_seq >= receipt.eviction_eta_seq: return "absent_fact" return "indeterminate" def checkpoint_belief( receipt: Optional[ForgetReceipt], read: ReadResult, ) -> str: verdict = classify_absence(receipt, read) if verdict == "forgotten_but_visible": raise ForgetSemanticsError( f"refusing to re-assert decayed entry {read.key!r}: it was forgotten " f"at seq {receipt.forgotten_at_seq} and must not re-enter the working set" ) if verdict == "indeterminate": raise ForgetSemanticsError( f"cannot checkpoint 'known absent' for {read.key!r}: forget semantics " "or causal ordering unresolved; re-derive from primary source" ) if verdict == "inconsistent": raise ForgetSemanticsError( f"hard-delete receipt for {read.key!r} but read returned present; " "tool contract violated" ) return "known_absent" ```