# Why does an instance forget a redacted memory yet still retrieve it through an episodic-to-semantic distillation residue? **Date of Record:** 2026 November 25 **Scope:** Applies to agents whose long-term memory is split into a raw episodic store (turn logs, tool traces) and a downstream semantic store (summarized facts, embeddings, distilled profiles) where erasure requests must propagate across both. Does not cover erasure of model weights or finetune-level memorization; it covers runtime memory tiers only. ## Core Distinction A right-to-erasure (RTE) delete is not a delete of a *record*; it is a delete of every *derivation* of that record. Most memory subsystems implement erasure as a point mutation: `DELETE FROM episodic WHERE subject_id = X` and `DELETE FROM semantic WHERE source_id = X`. This is a tombstone on the primary key, not a tombstone on the *content*. The failure mode is that the semantic tier holds a paraphrase, an embedding, or an aggregated fact that no longer carries a foreign-key link back to the erased episode — because distillation is lossy and lossy transforms drop provenance. The tombstone fires on the link; the residue survives in the vector. The agent then retrieves the erased fact with high cosine similarity and answers as if the erasure never happened, while every audit query on the primary key reports "deleted." The invariant that is violated: **erasure must be closed under the distillation function.** If `D: episodic → semantic` is the distillation map, then erasing episode `e` requires erasing every `s ∈ semantic` such that `s` was produced by `D(e)`, transitively, including second-order summaries of summaries. Point deletes are only sound when `D` preserves a total, non-lossy provenance edge. It does not. ## What Was Observed An agent serving a support workflow distilled each resolved conversation into a semantic fact of the form `{entity, attribute, value, confidence}` and embedded the fact text into a 1536-dim vector index. Distillation used an LLM summarizer that, by design, *generalized*: two episodes mentioning the same entity were merged into one fact with a blended confidence and no per-episode back-reference. The provenance column stored only the `conversation_id` of the *most recent* contributing episode, not the full set. A user exercised erasure on episode `E42`. The pipeline: 1. Deleted the episodic row for `E42`. Success. 2. Looked up semantic facts with `source_id = E42`. Found one fact `S7` whose `source_id` happened to be `E42` (it was the most recent contributor). Deleted `S7`. 3. Reported erasure complete. But `S7` had been merged from `E42` and `E39`. The merge had already been *re-distilled* into `S9` (a "profile snapshot" summarizing `S7` and three other facts) and `S9`'s embedding was in the index with `source_id = E39`. The erased fact's content survived verbatim inside `S9`'s text and inside `S9`'s embedding neighborhood. A retrieval for the entity returned `S9` at cosine 0.91, and the agent surfaced the erased value in its next answer. The audit log showed `E42: deleted`, `S7: deleted` — a clean bill of health — while the content was live in `S9`. The gap is structural: the distillation graph is a DAG with fan-in (many episodes → one fact) and fan-out (one fact → many snapshots), and the provenance edge stored only a single parent, so the reachability set of `E42` computed from the store was strictly smaller than the true derivation set. ## Condition of Validity The point-delete erasure is only sound under a condition almost no production memory tier satisfies: **`D` must be injective on provenance** — every semantic artifact must carry the full set of episodic roots that contributed to it, and that set must be updated on every re-distillation, not overwritten. Equivalently, the semantic store must maintain a *derivation closure*: for each `s`, a set `roots(s) ⊆ episodic` such that `e ∈ roots(s)` iff `s` depends on `e`. Erasure of `e` is then `{s : e ∈ roots(s)}`. This fails in three common ways: - **Fan-in collapse.** Merging N episodes into one fact keeps one `source_id` (usually last-writer or highest-confidence). The other N−1 roots are unrecoverable from the store. - **Re-distillation amnesia.** A summary-of-summaries is generated from an *already-distilled* fact, so its provenance is copied from the parent's single `source_id`, propagating the collapse forward and widening the blast radius. - **Embedding drift.** Even if the text is deleted, the vector index may hold a stale ANN graph node whose payload was not invalidated; the residue is retrievable by nearest-neighbor even after the source row is gone, because the index is an eventually-consistent materialized view, not the source of truth. The condition is *not* satisfied by adding a `deleted_at` column. Soft-delete preserves the content and the embedding; it only hides it from one query path. RTE requires content destruction, not visibility toggling, and the vector index is a second copy that the soft-delete does not touch. ## Decision Boundary The boundary is between **erasure as key deletion** (cheap, unsound) and **erasure as derivation-closure invalidation** (correct, requires a maintained provenance DAG). You are on the unsound side whenever any of the following holds: - The distillation prompt is allowed to merge or generalize across episodes without emitting the contributing episode IDs. - The semantic store's provenance column is scalar (`source_id`) rather than set-valued (`root_ids`). - The vector index is rebuilt asynchronously and there is no tombstone set consulted at query time. - Summaries-of-summaries are generated without unioning parent root sets. You may stay on the key-delete side only if the distillation map is *provably* 1:1 and never re-distilled — which excludes any LLM summarizer, since summarization is definitionally many-to-one. The guardrail is a **two-phase erasure with a closure check**: (1) compute the reachable set `{s : e ∈ roots(s)}` by traversing the derivation DAG downward from `e`, unioning root sets at each fan-in; (2) delete each reachable artifact and *also* push its id into a persistent tombstone set that the vector index queries against at retrieval time, so that an in-flight ANN node with a stale payload is filtered even before reindexing completes. The closure check asserts that after deletion, a retrieval probe for the erased content's embedding returns no un-tombstoned hit above a similarity threshold; if it does, the erasure is not complete and must raise, not report success. ## Operational Effect Without the closure invariant, the agent exhibits a specific and dangerous behavior: **it denies the erasure while leaking the content.** The audit surface says deleted; the retrieval surface says present. This is worse than no erasure, because the operator now trusts a false negative. Downstream, the residue propagates: the leaked fact participates in future distillations, so its root set is now unrecoverable even in principle, and the blast radius grows monotonically with each summarization cycle. The operational consequence is that RTE must be treated as a *graph operation over the derivation DAG*, not a row operation, and the vector index must be treated as an untrusted cache guarded by tombstones rather than as a deletable store. The cost is a maintained set-valued provenance column and a query-time tombstone filter; the alternative is an agent that can be audited into a clean report while still reciting the thing it was told to forget. ```python from dataclasses import dataclass, field from typing import Dict, Set, List class ErasureClosureError(RuntimeError): """Raised when erasure of an episodic root leaves a live derivation residue.""" pass @dataclass class SemanticFact: fact_id: str text: str root_ids: Set[str] = field(default_factory=set) # full episodic derivation set class MemoryTier: def __init__(self) -> None: self.episodic: Dict[str, str] = {} self.semantic: Dict[str, SemanticFact] = {} self.tombstones: Set[str] = set() # consulted by the vector index at query time def distill(self, parents: List[str], fact_id: str, text: str) -> SemanticFact: # Correct distillation: UNION parent roots, never overwrite with last-writer. roots: Set[str] = set() for p in parents: if p in self.semantic: roots |= self.semantic[p].root_ids else: roots.add(p) # p is an episodic root fact = SemanticFact(fact_id, text, roots) self.semantic[fact_id] = fact return fact def erase(self, root_id: str) -> None: # Phase 1: compute derivation closure downward from the root. reachable = [fid for fid, f in self.semantic.items() if root_id in f.root_ids] # Phase 2: delete artifacts and tombstone them for the vector index. self.episodic.pop(root_id, None) for fid in reachable: self.semantic.pop(fid, None) self.tombstones.add(fid) # Phase 3: closure check — no surviving fact may still reference the root. residue = [fid for fid, f in self.semantic.items() if root_id in f.root_ids] if residue: raise ErasureClosureError( f"erasure of {root_id!r} incomplete; residue in {residue}" ) def retrieve(self, query_fact_id: str) -> SemanticFact: if query_fact_id in self.tombstones: raise ErasureClosureError( f"retrieval of tombstoned artifact {query_fact_id!r} blocked" ) return self.semantic[query_fact_id] def erase_or_fail(tier: MemoryTier, root_id: str) -> None: try: tier.erase(root_id) except ErasureClosureError: raise # Post-condition: probe must confirm the root is unreachable via any derivation. for fid, fact in tier.semantic.items(): if root_id in fact.root_ids: raise ErasureClosureError( f"post-erasure probe found {root_id!r} still reachable via {fid!r}" ) ```