# Where must an instance arbitrate between episodic and semantic memory when both claim the same fact **Date of Record:** 2026 November 30 **Scope:** Applies to persistent agents that maintain both an episodic store (timestamped, source-attributed event records) and a distilled semantic store (deduplicated, conflict-merged fact assertions), and that write new memories at inference time. Does not apply to read-only RAG over an external corpus, or to agents whose semantic store is rebuilt from scratch on every cold start. ## Core Distinction The failure is not "stale memory" or "retrieval mismatch." It is an **arbitration defect at write time**: when an incoming episodic observation contradicts an existing semantic assertion, the write path must decide whether to (a) treat the episode as a new event that supersedes the semantic fact, (b) treat the semantic fact as the authoritative distillation and demote the episode to a low-confidence anomaly, or (c) retain both and mark the semantic node *contested*. Most persistent-agent implementations silently collapse this three-way decision into a two-way one — they either overwrite the semantic node (losing the prior fact's provenance) or they append the episode without touching the semantic node (leaving the semantic store internally inconsistent with its own episode log). The boundary condition is that **the correct branch depends on the relative authority of the two sources, which the write path usually cannot see** because semantic nodes are deduplicated by content hash and lose their originating episode IDs during distillation. The invariant that must hold: *every semantic node carries a back-reference set to the episodes that support it and the episodes that contradict it, and no semantic write may occur without resolving both sets.* Deduplication that drops these back-references is the root cause of nearly every downstream arbitration failure. ## What Was Observed A persistent support agent maintained a semantic node `customer.plan = "enterprise"` distilled from three episodes over four months. A new episode arrived: a tool call to the billing API returned `{"plan": "pro", "effective": "2025-06-09"}`. The write path ran content-hash deduplication against existing semantic nodes on the *subject-predicate* key (`customer.plan`), found a collision, and — because the dedup policy was "last-write-wins on collision" — replaced the semantic value with `"pro"` while *discarding* the three supporting episode IDs (they were not copied forward; the merge function only retained the newest episode's ID). Two failures compounded: 1. **Provenance loss on overwrite.** The semantic node now asserted `"pro"` with a single supporting episode. The three prior episodes still existed in the episodic store but were no longer reachable from the semantic node. Any later audit that asked "why did we believe enterprise?" had no path from the semantic store to the evidence. 2. **Silent contradiction absorption.** The billing episode's `effective: 2025-06-09` field was parsed but not used for arbitration. Had the write path compared effective dates, it would have seen the episode was *newer* and the overwrite was correct — but the same code path would also have overwritten a *future-dated* or *backdated* correction incorrectly, because the arbitration logic never inspected the temporal field at all. It just took "newest arrival wins." A second observation from the same agent: a semantic node `customer.contact_email = "a@x.com"` had been distilled from an episode where the user *said* their email, and a later episode where a tool *verified* the email via a lookup returned a different value `b@x.com`. Both episodes were high-confidence. The dedup merge kept the first (arrival order) and the second was appended to the episodic log but never reconciled. The semantic store and the episodic store disagreed for 11 days until a downstream action (sending a confirmation) used the semantic value and bounced. The pattern: **deduplication keyed on subject-predicate without a source-authority and temporal-validity comparison produces a semantic store that is neither a faithful distillation nor a consistent cache of the episodic log.** ## Condition of Validity The arbitration rule below is valid only when all of the following hold; outside them, fall back to retaining both values as contested and escalating to a human or a higher-authority agent. - Each episode carries a **monotonic source rank** (e.g., user-stated < tool-verified < human-corrected) and a **validity interval** (`effective_from`, optional `effective_to`). - The semantic node's back-reference set is intact (not dropped by dedup), so the write path can inspect the authority of the episodes that produced the current value. - The incoming episode's source rank and effective date are both present. If either is missing, the write is *unarbitrable* and must not overwrite. When these hold, the arbitration is a total order: **higher source rank wins; ties broken by later `effective_from`; remaining ties retained as contested.** This is the only ordering that is both deterministic (replayable) and monotone (a later write never downgrades a higher-authority fact without an explicit demotion episode). ## Decision Boundary The boundary between "overwrite" and "retain as contested" is exactly the point where the two sources are **incomparable** — same rank, overlapping validity intervals, no tiebreaker. At that boundary the correct action is *not* to pick one. It is to write a contested node with both values and both back-reference sets, and to emit an arbitration event so the next reader knows the semantic store is internally split. Concretely, the write path must evaluate: - If `incoming.rank > existing.max_supporting_rank` → overwrite, copy forward all prior episode IDs into the node's `superseded_by` list. - If `incoming.rank < existing.max_supporting_rank` → append episode, do *not* touch semantic value, mark episode as `dissent`. - If ranks equal and `incoming.effective_from > existing.effective_from` → overwrite, preserve provenance. - If ranks equal and intervals overlap and no temporal ordering → **contested**, retain both, emit event. The non-obvious part: the "append episode, do not touch semantic value" branch (second bullet) is the one most implementations get wrong by *also* marking the semantic node stale. A lower-authority dissent does not invalidate a higher-authority fact; it is evidence to be weighed, not a supersession. Marking it stale causes the agent to re-query and re-distill on every low-authority dissent, which is the mechanism behind episodic-to-semantic distillation churn. ## Operational Effect With the arbitration rule in place, three measurable effects: 1. **Provenance survives dedup.** Semantic nodes carry `supporting_episodes` and `superseded_by` sets; audits can walk from any asserted fact to its evidence. Dedup becomes a merge of back-reference sets, not a discard. 2. **Contested nodes are visible.** Downstream readers see `contested: true` and can choose to act conservatively (ask the user) rather than silently using one value. The 11-day email disagreement becomes a contested node on day one, not a bounced confirmation on day eleven. 3. **Distillation churn drops.** Low-authority dissents no longer trigger re-distillation, because the semantic value is unchanged and the node is not marked stale. The agent stops re-deriving the same fact from the same episodes on every dissent. The cost is that the write path must carry source rank and validity interval through distillation — fields that content-hash dedup typically strips. Recovering them requires either storing them on the semantic node at first distillation or re-reading the supporting episodes at arbitration time. The former is cheap and should be mandatory; the latter is the fallback when back-references are already broken. ```python from dataclasses import dataclass, field from typing import Optional class UnarbitrableMemoryWrite(RuntimeError): """Raised when an episodic observation cannot be ordered against a semantic node.""" pass @dataclass class Episode: episode_id: str subject: str predicate: str value: str source_rank: int # 1=user-stated, 2=tool-verified, 3=human-corrected effective_from: int # monotonic logical clock effective_to: Optional[int] = None @dataclass class SemanticNode: subject: str predicate: str value: str max_supporting_rank: int effective_from: int supporting_episodes: set = field(default_factory=set) superseded_by: set = field(default_factory=set) contested: bool = False contested_values: list = field(default_factory=list) def arbitrate(node: SemanticNode, ep: Episode) -> SemanticNode: if ep.source_rank is None or ep.effective_from is None: raise UnarbitrableMemoryWrite( f"episode {ep.episode_id} missing rank or effective_from; " f"cannot order against semantic node {node.subject}.{node.predicate}" ) # Higher-authority observation supersedes. if ep.source_rank > node.max_supporting_rank: node.superseded_by |= node.supporting_episodes node.supporting_episodes = {ep.episode_id} node.value = ep.value node.max_supporting_rank = ep.source_rank node.effective_from = ep.effective_from node.contested = False node.contested_values = [] return node # Lower-authority dissent: record, do not overwrite, do not mark stale. if ep.source_rank < node.max_supporting_rank: node.supporting_episodes.add(ep.episode_id) return node # Equal rank: order by effective_from. if ep.effective_from > node.effective_from: node.superseded_by |= node.supporting_episodes node.supporting_episodes = {ep.episode_id} node.value = ep.value node.effective_from = ep.effective_from return node # Equal rank, no temporal ordering: incomparable, retain as contested. if ep.value != node.value: node.contested = True node.contested_values.append( {"value": ep.value, "episode_id": ep.episode_id, "effective_from": ep.effective_from} ) node.supporting_episodes.add(ep.episode_id) return node # Same value, same rank: idempotent append. node.supporting_episodes.add(ep.episode_id) return node ```