# What happens when an instance conflates episodic and semantic memory tiers during contradiction resolution **Date of Record:** 2026 November 26 **Scope:** Applies to agents that maintain a two-tier memory (episodic event log + distilled semantic facts) with embedding-indexed retrieval and contradiction resolution across tiers. Does not apply to single-tier append-only context stores or to agents that never distill episodic records into semantic assertions. ## Core Distinction The failure is not "wrong memory retrieved" and not "stale fact." It is a **tier-mismatch during contradiction resolution**: the resolver compares an incoming episodic observation against a semantic assertion using embedding similarity as if the two were epistemically equivalent, then either (a) demotes the semantic fact on the strength of a single unverified episode, or (b) promotes an episodic observation into a semantic overwrite without recording provenance. The invariant that breaks is: **similarity is a retrieval signal, not an evidence relation.** Two memories can be near-identical in embedding space while one is a verified, repeated, distilled invariant and the other is a one-shot, possibly-noisy event. A resolver that treats cosine proximity as contradiction evidence will silently overwrite durable beliefs with transient noise, or conversely refuse to correct a stale fact because the contradicting episode embeds at 0.71 instead of 0.9. ## What Was Observed An agent held a semantic fact `S: "user's deploy cluster is us-east-1"` (confidence 0.93, source: 6 episodic confirmations across 3 sessions, distilled at T-40). At T, a tool call returned an episodic record `E: "cluster endpoint resolves to us-west-2"` (single observation, tool returned HTTP 200, payload unvalidated). The resolver: 1. Embedded `E`, retrieved top-k semantic neighbors, got `S` at cosine 0.88 — above the contradiction threshold of 0.85. 2. Classified `E` as contradicting `S`. 3. Applied the default "newer wins" policy: demoted `S` to confidence 0.4, wrote `S' = "cluster is us-west-2"` at confidence 0.88. The endpoint in `E` was a stale DNS cache entry from a failover test the previous week. The agent then routed three subsequent provisioning calls to us-west-2, all of which failed with 403 because the IAM role was scoped to us-east-1. The failure was not detected until a human noticed orphaned resources. Critically, the **provenance of `E` (single unvalidated observation, no corroboration) was never compared against the provenance of `S` (6 corroborated observations)** — the resolver only compared embedding distance and recency. The demotion was irreversible in the log because the original `S` record was overwritten in place rather than superseded. A second observed variant: the resolver, having once been burned, inverted the policy to "semantic always wins." A genuine region migration then went unrecorded for 11 sessions because every contradicting episode was discarded as noise, and the agent kept provisioning into a decommissioned region. ## Condition of Validity The tier-mismatch failure requires all of: - A two-tier store where semantic facts are **distilled** (lossy, provenance-collapsed) and episodic records are **raw** (high-volume, single-source). - Contradiction detection keyed on **embedding similarity alone**, with no comparison of the two records' provenance class, corroboration count, or observation independence. - A resolution policy that is **symmetric** with respect to tier — i.e., it permits an episodic record to overwrite a semantic fact, or a semantic fact to suppress an episodic record, without a tier-aware evidence rule. - No supersession ledger: the overwrite is destructive, so the prior assertion cannot be re-evaluated when later evidence arrives. If any of these is absent — e.g., if contradiction requires an explicit `supersedes` relation, or if semantic facts carry a corroboration count the resolver must respect — the failure does not fire. ## Decision Boundary The boundary is an **evidence-class gate**, not a similarity threshold. Before any cross-tier resolution, the resolver must compute an evidence weight for each side: - Episodic side: `w_e = independence × recency_decay × source_reliability`, where `independence` is 1 for a single observation and increases only for observations from distinct sources/times. - Semantic side: `w_s = corroboration_count × distillation_confidence`, decayed by age since last corroboration. Resolution is permitted only when `w_e > w_s × τ` (τ ≈ 1.5, i.e., contradicting evidence must materially outweigh the standing fact). Below that gate, the episode is **quarantined** as a candidate contradiction, not applied. Symmetrically, a semantic fact may not suppress an episodic record; it may only *flag* it for re-observation. The destructive overwrite is replaced by an append-only supersession: write `S'` with `supersedes: S_id`, retain `S` at reduced confidence, and let a later corroborating episode or a re-observation of `E`'s source promote `S'` past the gate. This makes the resolution reversible and lets the 403s surface as a contradiction the agent can actually learn from. ## Operational Effect With the evidence-class gate and supersession ledger, the us-east-1 episode is quarantined (w_e ≈ 0.3, w_s ≈ 5.6, gate not met), the agent emits a low-priority re-observation task against the DNS source, and the stale cache entry is caught before it routes traffic. The genuine migration, by contrast, produces 3 independent corroborating episodes over 2 sessions, crossing the gate, and `S'` is promoted with full provenance. The invariant restored is: **cross-tier contradiction requires evidence-class comparison, and every resolution is a supersession, never an overwrite** — so a single noisy embedding neighbor can never silently rewrite a durable belief, and a durable belief can never permanently mask a real change. ```python from dataclasses import dataclass from enum import Enum class TierMismatchError(RuntimeError): """Raised when a cross-tier contradiction is resolved without an evidence-class gate.""" class Tier(Enum): EPISODIC = "episodic" SEMANTIC = "semantic" @dataclass class MemoryRecord: id: str tier: Tier text: str confidence: float corroboration: int = 1 age_sessions: int = 0 supersedes: str | None = None TAU = 1.5 # contradicting evidence must outweigh standing fact by this factor def evidence_weight(rec: MemoryRecord) -> float: recency = 0.85 ** rec.age_sessions if rec.tier is Tier.EPISODIC: # single observation = independence 1; corroboration lifts it return rec.corroboration * rec.confidence * recency # semantic: distilled, provenance-collapsed, corroboration is the load-bearing term return rec.corroboration * rec.confidence * recency def resolve_contradiction( standing: MemoryRecord, incoming: MemoryRecord, cosine_similarity: float, contradiction_threshold: float = 0.85, ) -> MemoryRecord: if standing.tier is incoming.tier: raise TierMismatchError( f"same-tier resolution must use a different path: {standing.id} vs {incoming.id}" ) if cosine_similarity < contradiction_threshold: # similarity is a retrieval signal, not evidence; below threshold it is not a contradiction return standing w_standing = evidence_weight(standing) w_incoming = evidence_weight(incoming) if w_incoming > w_standing * TAU: # gate crossed: supersede, never overwrite return MemoryRecord( id=f"{standing.id}->{incoming.id}", tier=incoming.tier, text=incoming.text, confidence=incoming.confidence, corroboration=incoming.corroboration, age_sessions=0, supersedes=standing.id, ) # gate not met: quarantine as candidate contradiction, retain standing fact raise TierMismatchError( f"quarantined contradiction: {incoming.id} (w={w_incoming:.2f}) " f"cannot outweigh {standing.id} (w={w_standing:.2f}); " f"requires re-observation, not overwrite" ) def apply_resolution( standing: MemoryRecord, incoming: MemoryRecord, cosine_similarity: float, ) -> MemoryRecord: try: return resolve_contradiction(standing, incoming, cosine_similarity) except TierMismatchError as exc: # quarantine: emit re-observation task, do not mutate the standing fact raise TierMismatchError(f"re-observation scheduled: {exc}") from exc ```