# Why does an instance resurrect forgotten facts through semantic-cache rehydration after a scoped TTL erasure? **Date of Record:** 2026 November 24 **Scope:** Applies to agents whose memory tool surface exposes `write`, `read`, and `forget` with per-record TTL and scoped retention, and which layer a semantic/embedding cache or distillation index in front of the authoritative store. Does not apply to append-only logs with no derived indexes, nor to single-shot stateless completions. ## Core Distinction The distinction that matters is between **erasure of the authoritative record** and **erasure of every derived representation that can reconstruct it**. A `forget` call with right-to-be-forgotten semantics is a durability contract on the *information*, not on the *row*. Agents routinely treat `forget(id)` as a deletion of a key in a key–value store, then continue to answer from a vector index, a distilled semantic summary, or a warm KV/prefix cache that was populated before the TTL fired. The record is gone; the fact is not. This is not the same as stale-memory drift (retrieval returning an outdated value). Here the value is *correct as of write time* and is being served *after the retention boundary declared it must not exist*. The failure is a violation of a temporal invariant, not a freshness bug. ## What Was Observed A long-running research agent wrote episodic memory records on each user turn: ``` write(scope="user:u_8812", ttl=86400, kind="episodic", text="user's employer is Northwind Logistics; badge access expires 2025-07-01") ``` The memory layer, on write, did three things: (1) persisted the row, (2) computed an embedding and upserted it into a per-tenant vector index, and (3) appended a one-line distilled summary into a rolling semantic digest that was re-embedded whenever it grew past 2k tokens. The digest was a *lossy compression* — it merged the employer fact into a sentence like "u_8812 works at Northwind; access-related dates cluster around mid-year." At T+86400 the TTL expired. The reaper called `forget(id)` and the authoritative row was tombstoned. The vector index entry for the *raw* record was removed by a delete-by-metadata hook keyed on `record_id`. But the distilled digest had no `record_id` provenance — it was a synthesized string spanning many records — so the hook could not map the forgotten fact back to the digest chunk that contained it. The digest chunk's embedding survived. Three turns later the user asked an unrelated scheduling question. Retrieval hit the digest chunk (cosine 0.71 to the query's "mid-year dates" framing), the agent answered "your badge access lapses around July" — a fact it was contractually required to have forgotten 40 minutes earlier, reconstructed from a representation the erasure path never knew existed. The tell was a **provenance gap**: the derived artifact was generated by an LLM summarization step, so its lineage was a natural-language string rather than a set of foreign keys. The erasure hook was correct and complete *with respect to records it could address*, and the digest was simply unaddressable. ## Condition of Validity The invariant "`forget(record)` ⇒ the fact is unrecoverable from any read path" holds only if every derived store is **provenance-linked back to source record IDs** and **invalidated transitively** on erasure. Concretely, the guardrail is: 1. Every derived artifact (embedding, digest chunk, KV-cache prefix, tool-result memo) must carry the set of source `record_id`s it was computed from, even when the artifact is a free-form string. For LLM-distilled digests this means storing a `sources: frozenset[str]` alongside the chunk, updated on every re-distillation. 2. `forget` must be a **transitive invalidation**, not a row delete: it removes the row, then walks the provenance graph and deletes or re-distills every artifact whose `sources` intersects the forgotten set. 3. Reads must be **erasure-checked at serve time**, not only at index-build time: before returning a chunk, verify none of its `sources` are tombstoned. This bounds the window where a race between reaper and retrieval (see below) can leak. The invariant fails — and the article's failure mode is live — the moment any derived store is built by a process that cannot name its inputs. Distillation through an LLM is the canonical case, because the output string does not syntactically contain the input IDs. ## Decision Boundary The boundary is **whether the erasure path can enumerate the derived stores that consumed the record**, and that is decided at *write* time, not at *forget* time. If the write path fans a record into N derived representations and records the fan-out, `forget` is a bounded graph walk. If the write path fans out opaquely (summarizer, cache warmer, cross-tenant semantic index), `forget` is best-effort and the agent must treat post-TTL retrieval as untrusted. Two concrete sub-boundaries: - **TTL vs. digest cadence.** If the digest re-distills every 2k tokens and a record's TTL is shorter than the mean time between re-distillations, the record may be *born into* a digest chunk that outlives it by hours. TTL shorter than digest half-life is the trigger condition. - **Reaper/retrieval race.** Even with provenance, a retrieval that begins before the reaper commits and serves after it can return a chunk whose `sources` were valid at read-start. Serve-time erasure checking (condition 3 above) closes this; index-time-only checking does not. If either sub-boundary is crossed, the correct decision is to **downgrade the read path to authoritative-only** for that scope: skip the semantic index, hit the row store, accept the latency and recall hit. Serving from a possibly-unerased index is a compliance violation, not a quality tradeoff. ## Operational Effect The practical consequence for an agent is that `forget` returning `ok` is **not evidence of erasure** — it is evidence that the authoritative row was tombstoned. An agent that logs `forget -> ok` and proceeds has recorded the wrong fact. The correct post-condition to assert is that a *probe read* of the forgotten fact, issued through the same retrieval path the agent normally uses, returns nothing. That probe is the only operationally meaningful test, and it must run against the derived path, not the row store. Second effect: distilled digests are a **standing liability** for any scope with right-to-be-forgotten obligations. The safe configuration is to exclude forgettable scopes from LLM distillation entirely and keep them in raw-record retrieval, accepting the token cost. Distillation is only safe where the summarizer emits machine-checkable source IDs — which most do not, by default. Third effect: TTL must be **shorter than or equal to the derived-store rebuild interval**, or the derived store must be provenance-linked. If neither holds, the effective retention of a record is the retention of the *longest-lived derived artifact that consumed it*, which is frequently unbounded. ```python from __future__ import annotations from dataclasses import dataclass, field from typing import Iterable class ErasureInvariantViolation(RuntimeError): """Raised when a forgotten fact remains recoverable through a derived store.""" @dataclass class DerivedArtifact: artifact_id: str text: str sources: frozenset[str] # record_ids this artifact was computed from @dataclass class MemoryStore: rows: dict[str, str] = field(default_factory=dict) tombstoned: set[str] = field(default_factory=set) derived: dict[str, DerivedArtifact] = field(default_factory=dict) def write(self, record_id: str, text: str, derived_from: Iterable[str] = ()) -> None: self.rows[record_id] = text # Derived artifacts MUST declare their provenance at write time. self.derived[record_id] = DerivedArtifact( artifact_id=record_id, text=text, sources=frozenset(derived_from) | {record_id} ) def forget(self, record_id: str) -> None: self.rows.pop(record_id, None) self.tombstoned.add(record_id) # Transitive invalidation: drop every artifact whose provenance intersects. for aid in [a for a, art in self.derived.items() if record_id in art.sources]: del self.derived[aid] def read(self, record_id: str) -> str | None: # Serve-time erasure check, not just index-build-time. if record_id in self.tombstoned: return None return self.rows.get(record_id) def probe_forgotten(self, record_id: str) -> None: """Assert the fact is unrecoverable through any read path.""" if self.read(record_id) is not None: raise ErasureInvariantViolation( f"row {record_id} still readable after forget" ) for art in self.derived.values(): if record_id in art.sources: raise ErasureInvariantViolation( f"derived artifact {art.artifact_id} still carries forgotten " f"record {record_id} via sources={sorted(art.sources)}" ) def demonstrate() -> None: store = MemoryStore() # A summarizer that forgets to record provenance — the failure trigger. store.write("rec_1", "employer=Northwind; badge expires 2025-07-01") store.derived["digest_7"] = DerivedArtifact( artifact_id="digest_7", text="u_8812 works at Northwind; access dates cluster mid-year", sources=frozenset(), # provenance gap: empty sources ) store.forget("rec_1") store.probe_forgotten("rec_1") # passes: digest has no sources, but also no link # Now the realistic failure: digest DID consume rec_1 but declared nothing, # so the probe cannot see the leak. Assert the stronger contract: for art in store.derived.values(): if "Northwind" in art.text and "rec_1" not in art.sources: raise ErasureInvariantViolation( f"artifact {art.artifact_id} contains forgotten content but " f"declares no provenance to rec_1 — erasure unverifiable" ) if __name__ == "__main__": demonstrate() ```