# Which invariants prevent consolidation-induced recall collapse when episodic decay outpaces semantic promotion in tiered agent memory **Date of Record:** 2026 November 20 **Scope:** Applies to agents with a two-tier memory architecture (raw episodic buffer + decayed semantic store) where a background consolidation job promotes episodes into semantic facts on a forgetting-curve schedule. Does not apply to flat single-tier vector stores or systems where episodic records are retained indefinitely without decay. ## Core Distinction The failure mode is not "the agent forgot something." It is a *tier-crossing ordering violation*: the decay policy evicts an episodic record before the consolidation job has promoted the fact it carries into the semantic tier, so the fact is destroyed while still being true and useful. This is distinct from ordinary retrieval miss (the record exists but ranks low) and from stale-memory drift (the semantic fact exists but is wrong). Here the record never had a chance to become semantic because decay and promotion ran on incompatible clocks. The critical distinction is that **decay is a monotonic, per-record operation on the episodic tier, while promotion is a batch, threshold-gated operation that reads the episodic tier.** They share a data source but obey different time constants. Any system where `decay_rate > promotion_latency⁻¹` for some class of records will silently lose facts, and it will lose them *non-uniformly*—preferentially the records whose retrieval frequency is low but whose semantic value is high (rare-but-important facts), because low retrieval frequency is exactly what both delays promotion (below the access-count promotion threshold) and accelerates decay (low reinforcement). ## What Was Observed In a two-tier agent handling long-horizon operational tasks, episodic records carried a forgetting-curve decay weight `w(t) = w₀ · e^(−λ·Δt)` with per-record `λ` scaled by inverse retrieval count. Consolidation ran hourly, promoting an episode to semantic memory only if `w(t) ≥ θ_promote` **and** `access_count ≥ k`. The semantic store then applied its own slower decay `λ_semantic = λ/10`. The trace: a fact ("tenant `acme-prod` requires mutual-TLS on the internal gateway; plaintext rejected at the mesh layer") was observed once during onboarding, accessed zero additional times, and had `w₀` within 0.08 of `θ_promote`. Within one consolidation cycle its episodic weight crossed below `θ_promote`; the `access_count ≥ k` gate was never satisfied because nothing retrieved it. The record was evicted at `w < θ_evict` on cycle 3. Sixteen cycles later the agent attempted a gateway reconfiguration for that tenant, retrieved no relevant memory, proposed plaintext, and the mesh rejected it—triggering a retry storm. The fact was true, was once known, and was never wrong; it simply fell through the gap between two clocks. A second, subtler trace: because `λ` scaled with inverse retrieval count, *the less a fact was used, the faster it decayed*—inverting the intended priority. High-value rare facts were the most aggressively forgotten, and the promotion threshold `access_count ≥ k` required the very retrievals that decay had already made less likely. The two mechanisms formed a positive feedback loop toward amnesia for the long tail. ## Condition of Validity The invariant that must hold is an **ordering guarantee across tiers**: for every episodic record `e` carrying fact `f`, the system must guarantee that `f` is either (a) promoted to semantic memory, or (b) explicitly marked as intentionally discarded, *before* `e` is eligible for eviction. Formally, eviction of `e` is only valid when `promotion_decision(e) ∈ {promoted, rejected_by_policy}` and never when `promotion_decision(e) = pending`. This requires: 1. **Decay must not outrun promotion latency.** Enforce `λ_max < 1 / (promotion_interval · safety_factor)`, or gate promotion to run *before* each decay sweep on the same records (a barrier, not a race). 2. **Promotion eligibility must not depend on retrieval frequency when decay also depends on retrieval frequency.** If `λ ∝ 1/access_count`, then the `access_count ≥ k` promotion gate is a self-defeating condition. Either decouple the two (promotion by semantic-value classifier, decay by uniform λ) or make promotion *eager* for records flagged high-value at write time. 3. **Eviction must be a terminal, logged decision, not a silent side effect of weight crossing a threshold.** A record that crosses `θ_evict` while `promotion_decision = pending` is a *bug*, not a policy outcome; it must raise, not vanish. The condition fails whenever the promotion job is best-effort, lagging, or threshold-gated on a signal that decay itself suppresses. It holds only when promotion is a strict prerequisite of eviction and the two share a single ordering barrier. ## Decision Boundary The boundary is: **is the fact's value knowable at write time, or only after observation?** - If value is knowable at write (explicit user instruction, tagged operational constraint, config assertion), promotion must be **eager and unconditional**—bypass the access-count gate and the decay clock entirely. These records should never be subject to `λ` until they are semantic. - If value is only inferable from usage (emergent facts, incidental observations), then the access-count gate is legitimate *but* decay must be uniform (`λ` independent of access count) so that low usage does not accelerate forgetting faster than promotion can rescue. The decision boundary is crossed the moment you scale `λ` by inverse usage *and* gate promotion on usage—that combination is unsound regardless of parameter tuning. A practical test: for each record class, compute `expected_promotion_latency` and compare to `time_to_evict = ln(w₀/θ_evict)/λ`. If `time_to_evict < expected_promotion_latency` for any class, that class is on the wrong side of the boundary and must be moved to eager promotion. ## Operational Effect When the invariant is violated, the observable symptom is **selective, silent, and biased amnesia**—the agent loses precisely the rare-but-critical facts (compliance constraints, one-time configuration requirements, safety caveats) while retaining frequently-retrieved trivia, because the latter satisfy the access gate and survive. Downstream, this manifests as confident wrong actions (proposing a rejected config), not as "I don't know," because the absence of a semantic fact is indistinguishable from "no constraint exists." The agent does not fail loudly; it fails by omission, and the omission is systematically correlated with importance. The guardrail is a tier-crossing barrier: **no episodic record may be evicted while its promotion decision is pending**, enforced structurally (promotion sweep precedes decay sweep over the same record set, within one transaction) rather than by timing luck. Combined with decoupling decay from usage-frequency when promotion is usage-gated, this bounds the failure to zero loss of pending facts and converts silent amnesia into either successful promotion or an explicit, auditable rejection. ```python import math from dataclasses import dataclass, field from enum import Enum class ConsolidationOrderingViolation(RuntimeError): """Raised when an episodic record is evicted while its promotion is still pending.""" pass class PromotionDecision(Enum): PENDING = "pending" PROMOTED = "promoted" REJECTED_BY_POLICY = "rejected_by_policy" @dataclass class EpisodicRecord: record_id: str w0: float lam: float # per-record decay rate access_count: int = 0 decision: PromotionDecision = PromotionDecision.PENDING age_cycles: int = 0 def weight(self) -> float: return self.w0 * math.exp(-self.lam * self.age_cycles) @dataclass class ConsolidationPolicy: theta_promote: float theta_evict: float promotion_interval: int access_gate_k: int safety_factor: float = 2.0 def validate_decay_vs_promotion(self, lam_max: float) -> None: # Invariant 1: decay must not outrun promotion latency. max_allowed = 1.0 / (self.promotion_interval * self.safety_factor) if lam_max >= max_allowed: raise ConsolidationOrderingViolation( f"lambda_max={lam_max:.4f} exceeds bound {max_allowed:.4f}; " f"decay outruns promotion latency" ) def sweep(records, policy: ConsolidationPolicy) -> None: # Barrier: promotion sweep strictly precedes decay/eviction sweep. for r in records: if r.decision is not PromotionDecision.PENDING: continue if r.weight() >= policy.theta_promote and r.access_count >= policy.access_gate_k: r.decision = PromotionDecision.PROMOTED elif r.weight() < policy.theta_promote: # Below promotion threshold and never gated in: explicit policy rejection, # NOT silent eviction. This is the auditable terminal state. r.decision = PromotionDecision.REJECTED_BY_POLICY for r in records: if r.weight() < policy.theta_evict: if r.decision is PromotionDecision.PENDING: # Invariant 3: eviction of a pending record is a bug, not a policy outcome. raise ConsolidationOrderingViolation( f"record {r.record_id} crossed eviction threshold " f"(w={r.weight():.4f}) while promotion decision is PENDING" ) # promoted or explicitly rejected -> safe to evict r.age_cycles += 1 def check_usage_coupling(lam_scales_with_inverse_access: bool, promotion_gated_on_access: bool) -> None: # Invariant 2: these two couplings together are unsound regardless of tuning. if lam_scales_with_inverse_access and promotion_gated_on_access: raise ConsolidationOrderingViolation( "unsound coupling: decay scaled by inverse access_count AND promotion " "gated on access_count forms a positive feedback loop toward amnesia " "for rare-but-important facts" ) ```