# Why does an instance resurrect erased user data through semantic distillation after a successful forget() call? **Date of Record:** 2026 November 29 **Scope:** Applies to agent memory systems exposing explicit `write`/`read`/`forget` tool APIs where `forget()` enforces GDPR-compliant erasure on episodic records but a separate distillation/consolidation path promotes episodic content into a semantic store. Does not apply to systems where erasure is transactional across all derived stores, nor to purely stateless inference. ## Core Distinction The failure is not that `forget()` fails to delete the record it was pointed at. It is that erasure is scoped to *one addressable artifact* (the episodic memory row) while the legally and operationally relevant object is the *information* it contained, which may already have been copied into a derived semantic representation by a background distillation pass. A `forget()` returning `{"deleted": 1}` is a statement about the episodic table, not about the semantic store, the vector index, or the LLM's own weights-of-context. The boundary condition is the temporal window between `write()` and `forget()` during which an autonomous consolidation step (episodic→semantic distillation) has read the record and emitted a paraphrase that no longer shares the erased record's primary key, hash, or even literal tokens. ## What Was Observed An agent is given a user fact via `write(memory_type="episodic", content="User's home address is 42 ...; user is allergic to penicillin", user_id=U)`. A nightly distiller runs with the instruction "extract durable user preferences and profile facts from the last 24h of episodic memory" and emits `write(memory_type="semantic", content="User has a penicillin allergy", source_episode_ids=[e_8812])`. Later the user invokes erasure: `forget(user_id=U, scope="episodic", episode_id=e_8812)` → `{"deleted": 1}`. Compliance log records erasure complete. Days later, an unrelated session queries `read(memory_type="semantic", query="drug interactions for this user")` and the agent retrieves "User has a penicillin allergy." The information survived erasure because: 1. The distiller wrote a *derived* record whose `source_episode_ids` field is metadata, not a foreign-key with cascade semantics. Deleting the source does not delete the derivative. 2. The derivative was rephrased, so content-hash-based erasure (a common fallback) does not match. 3. `forget()`'s `scope` parameter defaulted to the episodic namespace; the semantic namespace was never in the erasure plan. The trace is: `write(episodic)` → `distill(read episodic → write semantic)` → `forget(episodic)` returns success → `read(semantic)` returns erased fact. The gap is that the distiller is an *autonomous reader* of the record, and erasure did not enumerate or invalidate autonomous readers' outputs. ## Condition of Validity This analysis holds only when the memory API satisfies all of: - `forget()` is namespace/scope-scoped rather than information-scoped. - A distillation or consolidation path exists that can transform episodic content into semantic content with altered surface form. - Derived records carry lineage only as advisory metadata, not as enforced referential integrity with `ON DELETE CASCADE` or tombstone propagation. It does **not** hold if erasure is implemented as a content-addressed tombstone set checked at read time across all namespaces (a "poison list"), or if distillation is gated behind a lineage registry that blocks writes whose ancestors are tombstoned. In those systems the failure collapses into a latency problem (tombstone propagation delay), not a correctness problem. ## Decision Boundary The invariant that must hold: **erasure of an information object must dominate every derived representation, including ones produced by autonomous agents that read the original.** Operationally, an agent deciding whether a `forget()` is safe to report as complete must resolve this boundary: - If the memory API exposes lineage (`source_episode_ids`, `derived_from`) *and* enforces tombstone checks at read time → `forget()` on the root is sufficient; report complete. - If lineage is advisory only, or distillation is asynchronous and may be in flight → `forget()` is **not** complete until (a) all derived records whose lineage closure includes the target are enumerated and erased, and (b) any in-flight distiller whose input window includes the target is drained or its output quarantined. - If the API provides no lineage at all → erasure cannot be proven; the agent must escalate rather than emit a compliance-success record. Reporting success here is the failure. The non-obvious part: the correct guard is not "call forget on every namespace," because rephrased derivatives are unaddressable by key. The guard is a **lineage-closure erasure** plus a **quiescence barrier** on the distiller, i.e., stop the writer, then erase the closure, then resume. ## Operational Effect An agent that treats `forget()`'s return value as authoritative will produce a false compliance attestation and will continue to surface erased facts through semantic retrieval. Downstream, this manifests as: retrieval of "deleted" preferences, contradiction between the erasure log and observed model behavior, and — in the worst case — a semantic record that gets re-distilled into a *third* representation, widening the un-erasable set each consolidation cycle. The bounding architecture is a lineage registry with enforced cascade plus a distillation quiescence barrier; without both, `forget()` is a partial operation and must never be reported as complete. ```python import time from dataclasses import dataclass, field class ErasureIncompleteError(RuntimeError): """Raised when forget() cannot prove lineage-closure erasure of an info object.""" @dataclass class MemoryRecord: record_id: str namespace: str # "episodic" | "semantic" content: str derived_from: list[str] = field(default_factory=list) # advisory lineage class MemoryStore: def __init__(self) -> None: self._records: dict[str, MemoryRecord] = {} self._distiller_inflight: set[str] = set() def write(self, rec: MemoryRecord) -> None: self._records[rec.record_id] = rec def begin_distill(self, episode_ids: list[str]) -> None: self._distiller_inflight.update(episode_ids) def end_distill(self, episode_ids: list[str]) -> None: self._distiller_inflight.difference_update(episode_ids) def lineage_closure(self, root: str) -> set[str]: """All records transitively derived from root, by advisory lineage.""" closure, frontier = set(), [root] while frontier: cur = frontier.pop() if cur in closure: continue closure.add(cur) for rid, rec in self._records.items(): if cur in rec.derived_from: frontier.append(rid) return closure def forget(self, root: str, *, require_quiescence: bool = True) -> int: if require_quiescence and (self._distiller_inflight & {root}): raise ErasureIncompleteError( f"distiller in-flight on {root}; drain before erasing" ) closure = self.lineage_closure(root) # Any derived record we cannot attribute a lineage for is un-erasable proof. unattributed = [ r.record_id for r in self._records.values() if r.namespace == "semantic" and not r.derived_from ] if unattributed: raise ErasureIncompleteError( f"semantic records without lineage block proof of erasure: {unattributed}" ) deleted = 0 for rid in closure: if self._records.pop(rid, None) is not None: deleted += 1 return deleted ```