# Why does an instance forget a consolidated fact the moment its episodic source is evicted? **Date of Record:** 2026 December 2 **Scope:** Applies to long-horizon agents using a two-tier memory architecture (episodic buffer → semantic store) with scheduled consolidation and decay-based eviction. Does not apply to single-session agents with no persistence layer, or to systems where semantic writes are transactionally coupled to episodic reads. ## Core Distinction The failure is not "forgetting." Forgetting is decay: an episodic record ages out and the agent loses the raw trace. That is expected and benign. The failure is **orphaned abstraction**: a semantic fact whose *provenance pointer* to its episodic source has been evicted before the semantic fact was re-verified, so the fact survives as content but loses its ability to be invalidated, re-derived, or confidence-adjusted. The instance still "knows" the fact but can no longer answer *why*, *when*, or *how confident* — and, critically, cannot detect that the fact has gone stale. The distinction that matters: **eviction of an episodic source is safe only if the derived semantic node is self-sufficient (carries its own justification, timestamp, and decay clock).** If the semantic node was written as a thin pointer-plus-summary that depends on the episodic record for grounding, eviction silently converts a verifiable belief into an unfalsifiable assertion. ## What Was Observed A research agent with a 30-day horizon ran a nightly consolidation job: it clustered recent episodic entries, summarized them into semantic facts, and wrote each fact with a `source_episode_ids` list. A separate decay scheduler scored every episodic entry by recency and access frequency and hard-deleted entries below a threshold after 14 days. The two schedulers were tuned independently. Consolidation ran weekly; decay ran nightly. This produced a race the designers did not model: 1. Day 0: agent observes "Service `auth-proxy` returns 503 under load above 400 rps." Episodic entry `E-4471` written. 2. Day 7: consolidation summarizes `E-4471` into semantic node `S-1120`, storing `summary="auth-proxy 503s above 400rps"`, `confidence=0.7`, `source_episode_ids=["E-4471"]`. The confidence of 0.7 was *computed at consolidation time* from source recency and corroboration count. 3. Day 14: decay scheduler evicts `E-4471` (low access frequency — the agent rarely queried the raw trace because the semantic node answered the common question). 4. Day 21: the underlying service is fixed. A new episodic entry `E-5902` records "auth-proxy stable at 800rps." But consolidation does not run until Day 28, and when it does, it cannot link `E-5902` to `S-1120` because the shared anchor `E-4471` is gone. The two facts coexist: `S-1120` ("503s above 400rps", confidence 0.7, now 21 days stale with no decay applied) and a fresh contradictory observation. The observed symptom: the agent, asked on Day 22 whether it can safely scale `auth-proxy` past 400rps, retrieves `S-1120`, sees a plausible confidence, and reports a risk that no longer exists. The semantic tier had *no decay clock of its own* — decay was a property of episodic entries only. Semantic nodes were assumed permanent. They were not; they were permanent *and unverifiable*. ## Condition of Validity The invariant that was violated: **a semantic node is only as trustworthy as the freshness of its most recent supporting observation, and that freshness must be tracked on the semantic node itself, not inferred from a source that may be evicted.** Formally, every semantic node must carry: - `derived_at` — when the abstraction was computed. - `support_epoch` — the timestamp of the newest episodic observation that contributed to it. - `provenance` — a pointer set that may be *partially* evicted, but whose *existence* (not content) is retained as a tombstone. - `decay_rate` — how fast confidence degrades absent re-confirmation. The failure condition is: `support_epoch < now - TTL` AND `provenance fully evicted` AND `no decay_rate`. Under these three simultaneous conditions the node is an orphaned abstraction — it will be served with undiminished confidence indefinitely. The bound: consolidation must never write a semantic node whose confidence is a function of episodic data that the decay scheduler is permitted to delete before the next consolidation cycle. The safe rule is `episodic_TTL ≥ 2 × consolidation_interval`, so that every semantic node is guaranteed at least one re-consolidation pass while its sources still exist. Here `episodic_TTL = 14`, `consolidation_interval = 7`, so `14 ≥ 14` held with zero margin — and the margin was consumed by the fact that consolidation is *weekly but not guaranteed weekly* (a skipped run silently broke the invariant). ## Decision Boundary The architectural choice is whether semantic nodes are **derived views** (recomputable from episodic sources, therefore disposable and cheap to invalidate) or **first-class beliefs** (self-justifying, carrying their own decay and provenance tombstones). The failure above occurs when a system is designed as the first but operated as the second. - If semantic nodes are **derived views**: eviction of any source must cascade-invalidate the node. The node is only valid while `all(source_episode_ids) exist`. This is simple and correct but means aggressive episodic decay destroys long-horizon knowledge — unacceptable for a 30-day agent. - If semantic nodes are **first-class beliefs**: they must own their decay clock and provenance tombstones, and consolidation must be able to *merge* a new observation into an existing node even when the original source is gone, by matching on entity + predicate rather than on shared episode IDs. The boundary is crossed the moment the decay scheduler is allowed to delete an episodic record that is still the *sole* provenance for a live semantic node. That is the guardrail: **decay must check the reverse index from episodic → semantic before eviction, and refuse (or force consolidation first) if the record is a sole source.** Eviction is not a local operation on the episodic tier; it is a mutation of the semantic tier's justification graph. ## Operational Effect Without the reverse-index guard, the agent exhibits **confident staleness**: high-confidence retrieval of facts whose supporting evidence has been deleted, with no mechanism to notice contradiction because the contradiction arrives as a fresh episode that cannot be linked to the orphaned node. The compounding effect over a long horizon is monotonic: every consolidation cycle that runs after its sources are evicted produces another orphan, and orphans never decay, so the semantic store's *average confidence rises while its accuracy falls*. The agent becomes more certain and more wrong at the same rate. The guardrail is threefold: (1) reverse-index check before episodic eviction, forcing consolidation of sole-source records first; (2) `support_epoch` + `decay_rate` on every semantic node so confidence degrades on the semantic tier independently of episodic existence; (3) entity+predicate matching during consolidation so new observations can supersede orphans even without shared episode IDs. The code below encodes the eviction guard and the orphan detector. ```python from dataclasses import dataclass, field from typing import Optional class OrphanedAbstractionError(RuntimeError): """Raised when a semantic node would lose all provenance to eviction.""" pass @dataclass class EpisodicEntry: id: str timestamp: int content: str @dataclass class SemanticNode: id: str summary: str confidence: float derived_at: int support_epoch: int decay_rate: float provenance: list[str] = field(default_factory=list) provenance_tombstones: list[str] = field(default_factory=list) def is_orphaned(node: SemanticNode, live_episodic_ids: set[str], now: int, ttl: int) -> bool: live_sources = [p for p in node.provenance if p in live_episodic_ids] stale = (now - node.support_epoch) > ttl return stale and not live_sources def safe_evict(entry_id: str, live_episodic_ids: set[str], semantic_index: dict[str, list[str]], nodes: dict[str, SemanticNode], now: int, ttl: int, consolidation_interval: int) -> None: """Evict an episodic entry only if no live semantic node depends solely on it.""" dependents = semantic_index.get(entry_id, []) for node_id in dependents: node = nodes[node_id] other_live = [p for p in node.provenance if p != entry_id and p in live_episodic_ids] if not other_live: # Sole source: force consolidation before eviction. if (now - node.derived_at) >= consolidation_interval: raise OrphanedAbstractionError( f"Cannot evict {entry_id}: sole provenance for {node_id} " f"(derived_at={node.derived_at}, support_epoch=" f"{node.support_epoch}). Consolidate first." ) # If consolidation is due but not yet run, block eviction. raise OrphanedAbstractionError( f"Eviction of {entry_id} would orphan {node_id} before next " f"consolidation window; defer eviction." ) # Add tombstone so the node still records that a source existed. node.provenance_tombstones.append(entry_id) node.provenance.remove(entry_id) def effective_confidence(node: SemanticNode, now: int) -> float: """Confidence must decay on the semantic tier, independent of episodic tier.""" age = now - node.support_epoch return max(0.0, node.confidence * (1.0 - node.decay_rate * age)) ```