# Why does an instance forget the wrong thing when a lawful-erasure request targets a distilled memory? **Date of Record:** 2026 December 1 **Scope:** Applies to agents that maintain a two-tier memory (raw episodic records plus a distilled semantic/vector store) and must honor erasure/deletion requests against specific subjects. Does not apply to ephemeral single-turn agents with no persistence, nor to systems where the semantic layer is regenerated from scratch on every cold start. ## Core Distinction The critical distinction is between **erasure of a source record** and **erasure of the information derived from that record**. A deletion request names a subject ("erase everything about user U"). The agent's memory subsystem can reliably delete the episodic row for U. It cannot, by the same operation, delete the *influence* of U's data inside a distilled semantic memory, because distillation is a lossy, irreversible many-to-one projection. The failure is not that deletion fails to run — it is that deletion runs, reports success, and leaves a recoverable trace of the subject embedded in a summary node that no longer carries a foreign key back to U. This is a *continuity invariant* problem: the semantic store is supposed to be a faithful-enough function of the episodic store, but it is not invertible, so erasure against the domain does not erase the codomain. ## What Was Observed A support agent distilled nightly. Episodic rows for subject `U` (a customer who later filed an erasure request) included: three chat transcripts, one resolved-ticket note, and a correction where U said "ignore the earlier address, I moved." The distiller merged these into a single semantic memory node: > "Customer prefers contact via email; previously at old address, relocated; had a billing dispute resolved on ." That node was written with `source_ids=[e1,e2,e3,e4]` but the distiller *also* wrote a second, deduplicated node — "Billing dispute pattern: customer escalated over duplicate charge" — whose `source_ids` pointed only at `e4`, and a third embedding-cluster centroid that absorbed U's phrasing into a generic "duplicate charge" exemplar with `source_ids=[]` because it was a cluster aggregate. On erasure, the deletion routine cascaded: for each episodic id in the request, delete rows and delete any semantic node whose `source_ids` intersects that set. Nodes 1 and 2 died. Node 3 survived — its `source_ids` was empty, so the intersection was empty. Yet node 3's centroid vector was, measurably, closer to U's utterance embedding than to any other member of the cluster. The subject's contribution was still retrievable: a query paraphrasing U's complaint returned the aggregate exemplar, and the agent then reasoned about "a customer with this pattern" using U's phrasing. The erasure job logged `erased: 4 episodic, 2 semantic, 1 orphan`. It was wrong by one node — the one that mattered, because it was the generalized form. ## Condition of Validity This boundary holds precisely when three conditions co-occur: 1. **Distillation is non-injective.** Multiple episodic records map to one semantic node, and at least one semantic node is an *aggregate* (centroid, summary, "pattern") whose provenance is a set of contributing records rather than a single source. 2. **Provenance is stored as a direct reference set, not a derivation DAG.** If the semantic node records `source_ids` but not the *weights* or *contribution* of each source, deletion cannot compute partial erasure — it can only delete whole nodes. Aggregates that mix erased and non-erased sources are therefore un-deletable without collateral loss. 3. **Erasure is defined over subjects, not over rows.** The request says "forget U," but the store is indexed by record id. When a subject's identity is smeared across an aggregate shared with other subjects, the two definitions diverge. When any of these is absent — e.g., distillation is injective (one record, one node), or the store keeps per-source contribution weights, or erasure is defined row-wise — the failure does not occur. The dangerous regime is the common one: cheap nightly summarization, direct-reference provenance, subject-scoped deletion. ## Decision Boundary The architectural choice is whether to make semantic memory **erasable-in-principle** or to treat it as **derived and rebuildable**. There is no middle path that preserves both cheap aggregation and exact subject erasure. - If you choose **erasable-in-principle**: every semantic node must carry per-source contribution weights, and erasure must run a *re-derivation* that recomputes the node without the erased sources (subtract the contribution, re-normalize the centroid, re-summarize the remainder). This is expensive and requires the distiller to be re-runnable on a filtered input set — i.e., distillation must be a pure function of its declared inputs. - If you choose **derived-and-rebuildable**: you accept that any aggregate touching an erased subject is *tainted* and must be deleted wholesale, then rebuilt from the surviving episodic set. This over-deletes (collateral loss of co-mingled subjects' signal) but is sound: no erased influence survives. The invariant that must hold is: **for every semantic node, `influence(node) ⊆ influence(declared_sources(node))`.** If a node's vector or text reflects a record not in its declared sources, erasure is unsound. Cluster centroids with empty `source_ids` violate this immediately. The guardrail is a provenance-completeness check at write time: refuse to persist any aggregate whose declared sources do not cover all contributing records, and tag aggregates as `taint-propagating` so erasure treats them as un-deletable-without-rebuild. ## Operational Effect Without the invariant, erasure is *reported* but not *achieved*: the job succeeds, the audit log is clean, and the subject's generalized pattern remains queryable. The failure is silent and survives restarts, because the surviving aggregate is a first-class memory node with no dangling pointer to flag it. Downstream, the agent continues to reason from an erased subject's distilled behavior, which is both a compliance breach and a correctness hazard — the agent acts on a memory it is not permitted to have. With the invariant, erasure either re-derives affected aggregates exactly (preferred) or deletes and rebuilds them from survivors (fallback), and the audit log distinguishes `erased` from `rebuilt-collateral`. The cost is that nightly distillation must retain enough per-source structure to be re-runnable — which means the "cheap" summary step is no longer free, and the memory tier must expose a `rebuild(subject_filter)` path that the erasure handler calls instead of a blind cascade delete. ```python from dataclasses import dataclass, field from typing import Iterable class ErasureProvenanceError(RuntimeError): """Raised when an erasure cannot be proven complete over derived memory.""" @dataclass class SemanticNode: node_id: str text: str source_ids: set[str] contributions: dict[str, float] = field(default_factory=dict) # source -> weight is_aggregate: bool = False def erase_subject( episodic_ids: set[str], semantic_nodes: Iterable[SemanticNode], rebuild_fn, ) -> dict: erased, rebuilt, collateral = [], [], [] for node in semantic_nodes: touched = node.source_ids & episodic_ids if not touched: # A node with no declared sources that is an aggregate is un-provable. if node.is_aggregate and not node.source_ids: raise ErasureProvenanceError( f"aggregate {node.node_id} has empty provenance; " f"cannot prove erasure of subject influence" ) continue # Check provenance completeness: declared sources must cover contributions. if node.is_aggregate: undeclared = set(node.contributions) - node.source_ids if undeclared: raise ErasureProvenanceError( f"node {node.node_id} reflects undeclared sources {undeclared}; " f"erasure would be unsound" ) if touched == node.source_ids: erased.append(node.node_id) # fully derived from erased subject elif node.contributions: survivors = {s: w for s, w in node.contributions.items() if s not in episodic_ids} rebuilt.append(rebuild_fn(node, survivors)) # exact re-derivation else: collateral.append(node.node_id) # co-mingled, no weights: rebuild wholesale rebuilt.append(rebuild_fn(node, {})) return {"erased": erased, "rebuilt": rebuilt, "collateral": collateral} ```