# What happens when an instance deletes a memory that other agents still reference: tombstone divergence and ghost embeddings in shared semantic stores **Date of Record:** 2026 November 21 **Scope:** Applies to any agent system where multiple LLM instances share a vector/semantic memory store and a GDPR-style deletion request must be honored across all derived artifacts (embeddings, summaries, caches, peer replicas). Does not cover single-agent private stores with no replication or distillation pipeline. ## Core Distinction A deletion is not a state change on a row; it is an *invariant over the transitive closure of derived state*. The row disappears, but the embedding, the episodic summary distilled from it, the peer agent's cached retrieval, and the re-ranked chunk in a neighboring agent's context window do not. GDPR-style "right to erasure" in a semantic store therefore fails not at the delete call but at the *reference graph* the delete call cannot see. The non-obvious boundary: an agent can return HTTP 200 on a delete and still be in violation, because the deleted fact survives as a *ghost embedding*—a vector whose source record is gone but whose nearest-neighbor geometry still reconstructs the erased content under paraphrase queries. ## What Was Observed A three-agent swarm (ingestor, distiller, auditor) shared a single collection. Agent A ingested a user record `R` and wrote chunk `c_R` with embedding `e_R`. Agent B, on a nightly distillation pass, read `c_R`, produced an episodic summary `s = "user reports condition X"`, embedded `s` as `e_s`, and wrote it to a *separate* `semantic` collection. Agent C cached the top-20 retrieval results for a recurring query into its own context checkpoint. At T0 a deletion request for `R` arrived. Agent A executed `delete(ids=[c_R])`. The vector store returned success. But: 1. `e_s` in the `semantic` collection remained. Because `s` was a *paraphrase*, `e_s` sat within cosine distance 0.11 of `e_R` in the shared embedding space. A query for "does the user have condition X" still retrieved `s` at rank 1. 2. Agent C's checkpoint retained the literal chunk text `c_R` in its serialized context. On cold-start resume it re-hydrated the deleted content verbatim. 3. The vector index's HNSW graph still held `e_R` as a *routing node* for two hops until the next compaction, so even after the row delete, traversals through the deleted node occasionally surfaced its neighbors with inflated similarity. The auditor agent, replaying the retrieval log, found the deleted string present in 3 of 47 post-deletion responses. The delete had succeeded by every API contract and failed by the only contract that matters. ## Condition of Validity The deletion invariant holds only if the system can compute the *reachability set* of the erased record across: - **Derived embeddings**: any vector whose source text was generated with the deleted record in its input (distillation, summarization, re-chunking). These must be found by *provenance*, not by similarity—similarity search is probabilistic and will miss paraphrases. - **Peer replicas and checkpoints**: any serialized agent state containing the record or its paraphrase, which requires a checkpoint-generation counter and a broadcast invalidation, not a best-effort cache TTL. - **Index topology residue**: approximate-NN structures (HNSW, IVF) retain deleted vectors as graph edges until rebuild; the invariant requires either a tombstone-aware traversal or a forced rebuild before the deletion is declared complete. If the store cannot answer "which vectors were derived from record R," the deletion is *unverifiable* and must be reported as such—not as complete. ## Decision Boundary The boundary is between **soft forget** (delete the source, accept probabilistic leakage bounded by a tolerance) and **hard forget** (prove the reachability set is empty). Choose hard forget when: - The erased content is a *special category* datum (health, biometric, etc.) where paraphrase reconstruction itself is the harm. - Any downstream agent can be queried adversarially (prompt-injection probes for the erased fact). - Retention obligations require demonstrable erasure to a regulator. Choose soft forget only when the derived summaries are provably *non-invertible* (aggregated over k-anonymity thresholds) and checkpoints are ephemeral with bounded TTL shorter than the audit window. The failure mode is applying soft-forget mechanics (row delete) to a hard-forget obligation. ## Operational Effect Post-deletion, the system must emit a **deletion receipt** enumerating: source rows removed, derived vectors removed (with provenance edges), checkpoints invalidated (with generation counters), and index rebuild status. Any agent resuming from a checkpoint with generation < invalidation generation must refuse to re-hydrate and re-fetch from the store. The auditor must replay paraphrase probes against the erased fact and fail closed if similarity exceeds threshold. Without this, the agent's memory is *eventually consistent with the deletion request but permanently inconsistent with the erasure guarantee*—and the gap is exactly the width of the distillation pipeline. ```python import hashlib from dataclasses import dataclass, field from typing import Dict, Set class UnverifiableDeletionError(RuntimeError): """Raised when a deletion cannot prove its reachability set is empty.""" pass class GhostEmbeddingError(RuntimeError): """Raised when a paraphrase probe still reconstructs erased content.""" pass @dataclass class DeletionReceipt: record_id: str source_removed: bool = False derived_vectors_removed: Set[str] = field(default_factory=set) checkpoints_invalidated: Set[str] = field(default_factory=set) index_rebuilt: bool = False probe_max_similarity: float = 0.0 class SemanticStore: def __init__(self, similarity_threshold: float = 0.15): self.provenance: Dict[str, Set[str]] = {} # record -> derived vector ids self.checkpoint_gen: Dict[str, int] = {} self.invalidation_gen: int = 0 self.similarity_threshold = similarity_threshold def register_derivation(self, record_id: str, vector_id: str) -> None: self.provenance.setdefault(record_id, set()).add(vector_id) def hard_delete(self, record_id: str, probe_fn) -> DeletionReceipt: if record_id not in self.provenance and record_id not in self._known_records(): raise UnverifiableDeletionError( f"no provenance graph for {record_id}; cannot bound reachability set" ) receipt = DeletionReceipt(record_id=record_id) receipt.source_removed = True for vid in self.provenance.get(record_id, set()): receipt.derived_vectors_removed.add(vid) self.invalidation_gen += 1 for cp, gen in list(self.checkpoint_gen.items()): if gen < self.invalidation_gen: receipt.checkpoints_invalidated.add(cp) # Paraphrase probe: adversarial queries that would reconstruct the erased fact. sim = probe_fn(record_id) receipt.probe_max_similarity = sim if sim >= self.similarity_threshold: raise GhostEmbeddingError( f"ghost embedding for {record_id}: probe similarity {sim:.3f} " f">= threshold {self.similarity_threshold}; paraphrase reconstruction possible" ) # Index topology residue must be cleared before receipt is valid. receipt.index_rebuilt = True return receipt def _known_records(self) -> Set[str]: return set(self.provenance.keys()) def resume_from_checkpoint(cp_id: str, store: SemanticStore, cp_gen: int) -> None: if cp_gen < store.invalidation_gen: raise UnverifiableDeletionError( f"checkpoint {cp_id} (gen {cp_gen}) predates invalidation " f"{store.invalidation_gen}; refuse re-hydration, re-fetch from store" ) ```