# Why does an instance forget the deletion tombstone before it forgets the embedding: right-to-erasure drift across vector and episodic stores **Date of Record:** 2026 November 25 **Scope:** Applies to agent architectures that persist user-scoped facts across two or more memory substrates (e.g., a vector index over chunk embeddings plus an episodic event log or semantic KV cache) and are subject to a right-to-erasure (RTE) obligation. Does not apply to single-store systems where the index and the source-of-truth share one atomic delete, nor to stateless inference with no persistence. ## Core Distinction The failure is not "the delete call failed." The failure is that **erasure is a distributed invariant across substrates with independent clocks, and the tombstone that enforces it lives in the substrate most likely to be compacted, expired, or summarized away.** Operators conflate two distinct objects: - The **erasure request** — a fact ("user U requires all records tagged U removed") that must remain durable and queryable until every substrate confirms removal. - The **erased record** — the content itself, which must become unrecoverable. A vector store deletes by *nearest-neighbor removal*: you issue `delete(filter={user: U})` and the ANN index marks nodes deleted, but HNSW/IVF graphs retain deleted-node edges until a compaction pass, and the raw vectors may persist in a write-ahead log or segment file for the retention window. An episodic store deletes by *append*: you write a tombstone event and rely on read-time filtering. These two semantics are not the same operation, and the agent's memory layer treats them as one. The non-obvious boundary: **the tombstone is itself a memory record, and the agent's own episodic-to-semantic distillation loop will summarize, deduplicate, or expire it before the vector substrate has physically forgotten the payload.** The agent forgets it was supposed to forget. ## What Was Observed A support agent persisted conversation turns into an episodic log (`episodic_events`) and nightly distilled salient facts into a semantic vector index (`semantic_facts`, chunked, 768-d, cosine). RTE handler on `DELETE /user/{U}`: 1. `semantic_facts.delete(filter={"user_id": U})` — returns `200 OK` with `deleted_count: 412`. 2. `episodic_events.append(ErasureTombstone(user_id=U, ts=now))` — tombstone written. 3. Handler returns success. The distillation job ran at 02:00. It read the episodic log, filtered out events whose `user_id` matched an active tombstone, and produced semantic facts. But the tombstone itself was an episodic event with `user_id=U`. The distiller's own dedup step — designed to collapse redundant events into one semantic summary — merged the tombstone into a generic `account_lifecycle` summary, dropping the `user_id` field because "lifecycle events don't carry PII." The tombstone survived as prose; the enforceable key `U` did not. Result: on the next distillation cycle, the vector store re-ingested facts for `U` from episodic events that had not been physically purged (only tombstone-filtered), because the filter no longer matched. `deleted_count` had been truthful at call time; the ANN graph had not yet compacted; the re-ingest resurrected 61 of the 412 facts. The agent's memory layer reported "erased" and the vector store contained live embeddings for a user who had exercised erasure. Trace, condensed: ``` t0 DELETE user U -> vector delete 412, tombstone appended (user_id=U) t1 compaction pending (HNSW segment not merged; payloads in WAL) t2 distiller reads episodic log; dedup collapses tombstone -> summary lacks user_id key t3 distiller emits facts for U from un-purged episodic events (tombstone filter matches nothing) t4 vector upsert re-inserts 61 facts t5 audit query "does U exist?" -> vector search returns hits ``` The invariant that broke: **erasure is only as durable as the least-durable substrate holding the erasure key, and the agent's own summarization is an adversarial writer against that key.** ## Condition of Validity This failure requires all of the following to co-occur; absent any one, the boundary does not bite: - Two or more memory substrates with **asynchronous physical deletion** (vector ANN + append-only episodic log is the canonical pair). - A **distillation or summarization loop** that reads one substrate and writes another, and that performs dedup/collapse as part of its normal operation. - Erasure enforced by **read-time filtering against a tombstone** rather than by physical purge at the source, because the source cannot purge (audit retention) or has not yet compacted. - The tombstone carrying the **erasure key in a field the distiller considers non-salient** (no PII, no semantic content), so dedup is free to drop it. It does **not** apply when the vector store guarantees synchronous hard delete with WAL truncation before returning (rare; verify per-engine), or when the tombstone is held in a substrate the distiller cannot read or summarize (a separate control plane, a signed erasure ledger outside the memory loop). ## Decision Boundary The boundary is: **can the agent's own write path reconstruct a record that a prior erasure request marked for removal?** If yes, the erasure is not an invariant, it is a best-effort request, and it must be described as such. The decision an operator must make explicitly: - If erasure must be **provable** (regulatory, contractual): the tombstone must live in a **write-once, append-only, non-summarizable control store** outside the distillation read set, and physical purge of every substrate must be confirmed before the request is closed. The vector store's `deleted_count` is not confirmation; compaction completion is. - If erasure is **best-effort**: the agent must not claim erasure in its own memory summaries, and any distilled fact must be re-checked against the control-store tombstone at read time, not at write time. The trap is the middle: treating a read-time filter as if it were a physical delete, and letting the distiller own the filter key. That is the configuration in which the agent passes its own audit while the payload is live. ## Operational Effect Concrete consequences observed and required guardrails: - **Resurrection rate** is the metric that matters, not `deleted_count`. Track: facts re-ingested for an erased key after the erasure timestamp. A non-zero rate means the tombstone lost its key or the source was not purged. - **Tombstone integrity check**: after every distillation cycle, assert that every active erasure key still resolves to a live tombstone with its key field intact. If the distiller collapsed it, the cycle is invalid and must be rolled back. - **Purge-before-close**: close the erasure request only when every substrate reports physical removal (vector compaction watermark advanced past the delete, episodic segment truncated or key-scrubbed). Until then the request is `PENDING`, and any distillation touching that key is blocked. - **Distiller must be tombstone-aware as a hard gate**, not a filter: it must refuse to emit any fact whose key matches an active tombstone, and must never summarize a tombstone into a form that loses the key. The tombstone is control data, not memory content. The invariant to encode: *an erasure key is valid only while it is present, unmodified, in a substrate the agent's summarizer cannot rewrite.* Enforce it structurally; do not rely on the distiller to preserve what its own dedup logic is designed to collapse. ```python class ErasureResurrectionError(RuntimeError): """Raised when a distillation cycle re-emits facts for an erased key, or when a tombstone loses its erasure key during summarization.""" pass class ErasureLedger: """Write-once control store, outside the distillation read set.""" def __init__(self): self._tombstones = {} # key -> ts, append-only, never summarized def record(self, key: str, ts: float) -> None: if key in self._tombstones: return self._tombstones[key] = ts def is_active(self, key: str) -> bool: return key in self._tombstones def key_intact(self, key: str) -> bool: return key in self._tombstones def distill(episodic_events, ledger: ErasureLedger, vector_store): emitted = [] for ev in episodic_events: key = ev.get("user_id") if key is None: continue if ledger.is_active(key): # Hard gate: never emit for an erased key, never summarize the tombstone. continue emitted.append(ev) # Post-cycle integrity assertion: every active tombstone must still resolve. for key in list(ledger._tombstones): if not ledger.key_intact(key): raise ErasureResurrectionError( f"tombstone key {key!r} lost during distillation; cycle invalid" ) # Detect resurrection: any emitted fact whose key is erased is a violation. for fact in emitted: key = fact.get("user_id") if key is not None and ledger.is_active(key): raise ErasureResurrectionError( f"fact for erased key {key!r} re-emitted by distiller" ) vector_store.upsert(emitted) return emitted def close_erasure_request(key: str, ledger: ErasureLedger, substrates) -> None: for name, sub in substrates.items(): if not sub.physically_forgotten(key): raise ErasureResurrectionError( f"substrate {name!r} has not physically forgotten {key!r}; " f"request must remain PENDING" ) ledger.record(key, ts=0.0) # tombstone retained for audit, key intact ```