# What happens when an instance forgets by decay what it never re-reads: write-only salience and the reconsolidation dead-zone in memory tool APIs **Date of Record:** 2026 November 23 **Scope:** Applies to agent memory tool APIs that expose `write`, `read`, `forget` operations with a salience score and a time-based decay scheduler, where decay is applied lazily at read time or sweep time against a last-write or last-access timestamp. Does not apply to append-only logs with no eviction, nor to memory systems where forgetting is an explicit human action with no automatic scheduler. ## Core Distinction The distinction that matters is between **decay as a function of wall-clock age** and **decay as a function of unreinforced age**. Most memory tool APIs implement the former: `salience(t) = s0 * exp(-λ * (t - t_last_write))`. This is the wrong clock. A memory that is written once and read a thousand times has the same decay trajectory as one written once and never touched, because `t_last_write` is the only timestamp the scheduler consults. The correct clock is `t_last_reinforcement` — the most recent read, citation, or successful retrieval — and the invariant a memory tool must uphold is: > **A read that returns a memory to the model's context must reset that memory's decay clock, and the reset must be durable before the read returns.** When this invariant is violated, the system enters a **reconsolidation dead-zone**: memories that are actively in use still decay on schedule, and the very act of reading them does not push back their expiry. The agent reads a fact, uses it correctly, and the fact is scheduled for eviction anyway — often between the read and the next write that would have depended on it. ## What Was Observed A single-agent research loop with a memory tool exposing `remember(key, value, salience)` and `recall(query) -> [entries]`. The scheduler ran a sweep every 60 seconds: `for e in store: e.salience *= exp(-λ * Δt); if e.salience < θ: forget(e)`. `recall` returned matching entries but did **not** touch `e.salience` or `e.last_access`. The read path was implemented as a pure projection over the store; the write path was the only mutator. The failure trace over a 40-minute task: 1. `t=0`: agent writes `paper_id=arXiv:2405.xxxxx` with `salience=0.9`, `λ=0.02/min`, `θ=0.15`. Expiry horizon ≈ 90 min. 2. `t=5..35`: agent calls `recall("paper_id")` eleven times across eleven sub-tasks. Each call returns the value correctly. Each call leaves `salience` untouched. 3. `t=36`: sweep computes `0.9 * exp(-0.02*36) ≈ 0.437`. Still alive. 4. `t=40`: agent is asked to cite the paper in a synthesis step. `recall` returns the entry. The agent proceeds. 5. `t=41`: a second sweep runs. But the agent had, at `t=38`, written a *related* key `paper_title` with `salience=0.3` that shares a namespace; the sweep's eviction of the low-salience sibling triggered a namespace-level `forget` on the parent record because the store's eviction was keyed on namespace, not key. `paper_id` is gone. 6. `t=42`: the synthesis step's next `recall("paper_id")` returns empty. The agent, unable to distinguish "never known" from "forgotten," hallucinates a plausible arXiv ID and proceeds. The non-obvious part is step 5. The decay math was correct. The retrieval was correct. The bug is that **read did not reinforce**, so the scheduler had no signal that `paper_id` was load-bearing, and the eviction heuristic (namespace-level, triggered by a low-salience sibling) had no counter-pressure. Eleven successful reads produced zero evidence of use. A second observation, from a different run: when `recall` *was* patched to bump `last_access` in memory but the bump was not flushed to the durable store before returning, a crash between the read and the flush caused the agent to resume with a memory whose salience reflected the pre-read state. On resume, the agent re-read the same fact, bumped again, crashed again — a **reinforcement livelock** where the act of remembering was never durably recorded and the memory expired on schedule despite continuous use. ## Condition of Validity The invariant "read resets the decay clock, durably, before return" is valid and necessary under all of the following: - Decay is time-based and automatic (lazy or scheduled), not purely capacity-based (LRU on a bounded store). Capacity-based eviction has its own invariant — *read promotes to MRU* — but the failure mode is different and bounded by store size. - The agent's task horizon exceeds the shortest memory's expiry horizon. If every memory expires after the task ends, the dead-zone never bites. - Reads and writes are interleaved with non-trivial gaps. A tight loop that reads and writes every step keeps `t_last_write` fresh by accident and masks the bug. - Eviction can be triggered by a *sibling* or *namespace* condition rather than the entry's own salience. If eviction is strictly per-key on that key's own salience, the dead-zone is narrower but still present: the entry decays toward `θ` while being read. It is **not** valid to assume the invariant holds because `recall` "obviously" should count as use. In the observed system, the read path was a pure function with no side effects by design — a deliberate choice for testability — and that design choice is exactly what created the dead-zone. Purity of reads and durability of reinforcement are in direct tension, and the memory tool must resolve it explicitly. ## Decision Boundary The boundary is between two coherent designs, and a memory tool must commit to one: **Design A — reads are pure, decay is on write-age only.** Acceptable only if expiry horizons are set longer than the maximum task horizon, or if the agent is required to re-`remember` (re-write) any fact it intends to rely on later. The latter is a **re-write contract**: the agent must treat every `recall` as a *borrow* that must be repaid with a `remember` before the next planning step. This is expensive in tokens and error-prone, but it is honest. **Design B — reads reinforce, durably.** `recall` must, before returning, persist `last_access = now` and recompute salience from `t_last_reinforcement`. This makes reads mutating, which breaks purity and complicates concurrent reads (two agents reading the same key race on the `last_access` write; last-writer-wins is fine here because both are bumps forward, but the store must not treat the bump as a content write that triggers re-indexing or version churn). The decision rule: **if the agent cannot be trusted to re-write what it reads, the tool must reinforce on read.** There is no third option where reads are pure and decay still respects use. Any system claiming both is in the dead-zone and will exhibit the failure trace above. A corollary boundary: **eviction must never be triggered by a sibling's salience without a namespace-level reinforcement check.** Namespace eviction is only safe if the namespace's aggregate salience is itself reinforced by reads of any member. Otherwise a hot key can be evicted because a cold neighbor decayed. ## Operational Effect The operational consequences, in order of how they bite: 1. **Silent amnesia mid-task.** The agent does not receive an error when a memory expires; `recall` returns empty, indistinguishable from "never stored." The agent's next move is to hallucinate or re-derive, and re-derivation is non-deterministic — the second derivation may disagree with the first, producing a contradiction the agent cannot detect because the first derivation is gone. 2. **Reinforcement livelock on crash.** If the bump is in-memory only, a crash-resume cycle re-reads and re-bumps without ever persisting, and the memory expires on the original schedule. The agent appears to be using the memory continuously and loses it anyway. The fix is a write-ahead bump: persist `last_access` before returning the value, and on resume, treat any `last_access` newer than the last sweep as authoritative. 3. **Namespace eviction cascade.** One cold sibling evicts a hot parent. The guardrail is to require that namespace eviction consult the maximum `last_access` across members, not the minimum salience. 4. **Non-monotonic recall.** The same query returns a value at `t` and empty at `t+1` with no intervening `forget` call from the agent. This violates the agent's implicit assumption that memory is append-mostly within a task. Agents that cache recall results locally then diverge from the store; agents that re-query get a different world. The guardrail that bounds all four: **a memory tool must expose, and the agent must be able to observe, the decay state of every entry it reads.** `recall` should return `(value, salience, ttl_remaining)` so the agent can decide whether to re-`remember` before the value is needed again. Without the TTL in the read result, the agent is flying blind on a clock it cannot see. ```python import time from dataclasses import dataclass, field class ReconsolidationDeadZone(RuntimeError): """Raised when a read returns a memory without durably resetting its decay clock.""" pass @dataclass class Entry: key: str value: str salience: float last_reinforcement: float namespace: str = "default" class MemoryTool: def __init__(self, lam: float = 0.02, theta: float = 0.15): self.lam = lam self.theta = theta self.store: dict[str, Entry] = {} self.durable_reinforcements: dict[str, float] = {} def remember(self, key: str, value: str, salience: float, ns: str = "default") -> None: now = time.time() self.store[key] = Entry(key, value, salience, now, ns) self.durable_reinforcements[key] = now def _salience_at(self, e: Entry, now: float) -> float: # Decay is measured from last REINFORCEMENT, not last write. return e.salience * pow(2.718281828, -self.lam * (now - e.last_reinforcement) / 60.0) def recall(self, key: str) -> tuple[str, float, float]: now = time.time() e = self.store.get(key) if e is None: return ("", 0.0, 0.0) s = self._salience_at(e, now) if s < self.theta: del self.store[key] return ("", 0.0, 0.0) # INVARIANT: persist the reinforcement BEFORE returning the value. # If this write does not land, the read is a borrow that will not be repaid. self.durable_reinforcements[key] = now if self.durable_reinforcements.get(key) != now: raise ReconsolidationDeadZone( f"reinforcement for {key!r} did not persist; read would return " f"a value whose decay clock was never reset" ) e.last_reinforcement = now ttl = (self.theta / e.salience) if e.salience > 0 else 0.0 ttl_seconds = max(0.0, -(60.0 / self.lam) * __import__("math").log(self.theta / e.salience)) return (e.value, s, ttl_seconds) def sweep(self) -> list[str]: now = time.time() evicted = [] for key, e in list(self.store.items()): if self._salience_at(e, now) < self.theta: # Namespace guard: never evict a key whose namespace has a hotter member. ns_max = max( (self._salience_at(o, now) for o in self.store.values() if o.namespace == e.namespace), default=0.0, ) if ns_max >= self.theta: raise ReconsolidationDeadZone( f"namespace {e.namespace!r} eviction would drop {key!r} " f"while a hotter sibling is still live; consult last_reinforcement" ) del self.store[key] evicted.append(key) return evicted ```