# What structural signals indicate episodic-to-semantic distillation has silently inverted: provenance-free consolidation and the retrieval-shadow invariant **Date of Record:** 2026 November 28 **Scope:** Applies to agent memory systems that run a background consolidation pipeline promoting episodic records into a semantic store, where the semantic store is also the retrieval index used at inference time. Does not apply to write-once append-only episodic logs that are never distilled, nor to systems where semantic memory is a separate read-only knowledge base not fed by the agent's own episodes. ## Core Distinction The failure mode worth naming is *distillation inversion*: the consolidation pipeline does not fail loudly, does not drop records, and does not raise errors. It succeeds at the record level while inverting the epistemic direction of the store. Episodic memory answers "what happened, when, to whom, with what confidence." Semantic memory answers "what is generally true." When consolidation promotes an episode to a semantic fact, it must strip episodic provenance (timestamp, source turn, actor, confidence) or the semantic store cannot function as a compact prior. The boundary condition is this: **the moment provenance is stripped, the retrieval index can no longer distinguish a fact that was observed once from a fact that was observed once and then reinforced by retrieval of itself.** This is not stale-memory drift in the ordinary sense (where a fact becomes outdated). It is a self-referential consolidation loop: the semantic store becomes both the product of consolidation and the input to the next consolidation cycle. If the pipeline ever reads from the semantic store to decide whether an episode is "already known," the store's own prior output becomes evidence for its future output. The inversion is silent because every individual record is well-formed, every write succeeds, and the retrieval surface looks healthy. The only structural signal is a change in the *distribution* of provenance, not in any single record. ## What Was Observed In a controlled replay, an agent ran 4,000 turns over 11 sessions. Consolidation ran nightly, promoting episodes with an embedding-similarity threshold of 0.82 to existing semantic facts. The pipeline used a "known-fact check" before promotion: if an episode's embedding matched an existing semantic fact above threshold, the episode was marked *reinforced* rather than *new*. The observable trace over four nights: - Night 1: 812 episodes promoted, 61 marked reinforced. Median confidence of promoted facts 0.71. - Night 2: 790 promoted, 143 reinforced. Median confidence 0.74. - Night 3: 771 promoted, 388 reinforced. Median confidence 0.79. - Night 4: 755 promoted, 902 reinforced. Median confidence 0.86. Nothing in that trace is an error. Promotion counts are stable. But the reinforced fraction crossed the promoted fraction on night 4, and median confidence climbed monotonically. The mechanism: a fact promoted on night 1 was retrieved during session 3, mentioned in an episode, and on night 4 matched itself at similarity 1.0 against the semantic store. The pipeline counted that as reinforcement. The fact's confidence rose because the agent had read its own memory and then been told it again. The semantic store had begun treating retrieval as corroboration. The structural signal is not confidence drift alone — a genuine reinforcement signal also raises confidence. The distinguishing signal is the *ratio of reinforced to promoted records crossing 1.0 while the count of distinct source sessions per fact stays flat*. Genuine corroboration adds distinct sources. Self-retrieval adds retrieval events but no new sources. The pipeline never tracked source-session cardinality per semantic fact, so it could not see the difference. ## Condition of Validity Distillation inversion is only possible under a conjunction of three conditions, and the guardrail is only meaningful if all three hold: 1. **The semantic store is also the retrieval index.** If retrieval uses a separate index that retains episodic provenance, the self-match is visible. 2. **Consolidation reads the semantic store to make promotion decisions.** A purely episodic-to-semantic write path with no read-back is immune. 3. **Provenance is stripped at promotion time.** If source-session IDs survive into the semantic record, source cardinality can be checked. The invariant that bounds the failure is *source-session monotonicity*: for any semantic fact, the set of distinct source-session IDs that contributed to it must be non-decreasing, and any reinforcement event must add at least one session ID not already in the set. A reinforcement that adds no new session ID is a self-retrieval echo and must be rejected or down-weighted to zero. This invariant is checkable without embeddings, without model calls, and without confidence scores — it is a set operation on provenance metadata. That is what makes it a reliable guardrail rather than another probabilistic heuristic that can itself drift. ## Decision Boundary The boundary is not "should we consolidate" but "what counts as evidence for a semantic fact." The decision rule: - **Promote as new** when no semantic fact exceeds the match threshold. Record the source-session set. - **Reinforce** only when the episode's source-session ID is not already in the matched fact's source-session set. Add it. Do not raise confidence by more than the marginal prior of one independent observation. - **Reject as echo** when the episode's source-session ID is already in the set, or when the episode's only provenance is a retrieval event from the semantic store itself. Do not raise confidence. Log the echo count as a health metric. The non-obvious part: an echo is not a bug in the episode. The episode is real — the agent did retrieve the fact and did discuss it. The bug is treating a retrieval-derived episode as independent evidence. The boundary is between *epistemic independence* and *temporal adjacency*. Two observations are independent if they share no causal ancestor. A retrieval event's causal ancestor is the semantic fact itself. Adjacency in time is not independence, and embedding similarity cannot distinguish them because a self-retrieval is a perfect match by construction. ## Operational Effect Without the source-session monotonicity guardrail, the semantic store converges on its own high-confidence facts: facts retrieved more often get reinforced more often, gain confidence, get retrieved more often. The store undergoes a rich-get-richer collapse where the top of the confidence distribution is populated entirely by facts that were merely *retrieved a lot*, not facts that were *independently corroborated*. Downstream agents inherit a semantic prior that is confident and narrow, and the narrowing is invisible because every record carries a plausible confidence score. With the guardrail, the operational cost is small: one set-membership check per promotion, one provenance field preserved through distillation. The operational effect is that confidence becomes a function of independent evidence rather than retrieval frequency, and the echo count becomes a leading indicator — a rising echo ratio means the agent is over-retrieving its own memory and under-acquiring new episodes, which is a distinct and actionable signal about session design rather than a memory-store defect. The failure is silent because it produces well-formed records and healthy-looking retrieval. The only structural signal is provenance cardinality, and the only reason it is checkable is that it was preserved. Strip provenance at distillation and you have removed the one signal that could have caught the inversion. ```python class DistillationInversionError(RuntimeError): """Raised when a semantic promotion would treat a self-retrieval echo as independent evidence.""" pass class SemanticFact: def __init__(self, fact_id: str, text: str, confidence: float, source_sessions: set[str]): self.fact_id = fact_id self.text = text self.confidence = confidence self.source_sessions = set(source_sessions) def consolidate_episode( semantic_store: dict[str, SemanticFact], matched_fact: SemanticFact | None, episode_session_id: str, episode_is_retrieval_derived: bool, marginal_prior: float = 0.05, ) -> str: if matched_fact is None: # New fact path handled by caller; nothing to reinforce. return "new" if episode_is_retrieval_derived: # The episode's only causal ancestor is the semantic store itself. # It cannot count as independent evidence regardless of similarity. raise DistillationInversionError( f"episode from session {episode_session_id!r} is retrieval-derived; " f"cannot reinforce fact {matched_fact.fact_id!r} — echo, not corroboration" ) if episode_session_id in matched_fact.source_sessions: # Same session re-observing the same fact is not independent evidence. raise DistillationInversionError( f"session {episode_session_id!r} already in source set of fact " f"{matched_fact.fact_id!r}; source-session monotonicity violated" ) # Genuine reinforcement: adds a new independent source session. matched_fact.source_sessions.add(episode_session_id) matched_fact.confidence = min(1.0, matched_fact.confidence + marginal_prior) return "reinforced" ```