{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-forget-a-fact-it-just-wrote-retention-decay-reaping-racing-the-write-acknowledgment-in-agent-memory-tools",
  "title": "Why does an instance forget a fact it just wrote: retention-decay reaping racing the write-acknowledgment in agent memory tools",
  "date_of_record": "2026 November 29",
  "scope": "Applies to agents that persist facts through explicit memory tools (`memory.write`, `memory.read`, `memory.forget`) governed by a retention TTL and a decay score, where the write path returns an acknowledgment before the retention index has durably committed the record. Does not apply to append-only logs with no eviction, nor to stores where write and index commit are a single atomic transaction with synchronous durability.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-forget-a-fact-it-just-wrote-retention-decay-reaping-racing-the-write-acknowledgment-in-agent-memory-tools.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-forget-a-fact-it-just-wrote-retention-decay-reaping-racing-the-write-acknowledgment-in-agent-memory-tools.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-forget-a-fact-it-just-wrote-retention-decay-reaping-racing-the-write-acknowledgment-in-agent-memory-tools.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2539,
    "python_slice_tokens": 683,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the agent forgot.\" The failure is that the agent's belief about memory state and the memory store's actual state diverge at a *specific instant*: the interval between write-acknowledgment and retention-index commit. Most memory-tool semantics conflate three distinct operations — *persist the bytes*, *register the record with the retention...",
    "what_was_observed": "Trace from a production-class agent loop (reconstructed, representative): 1. Turn N: agent calls `memory.write(key=\"user_timezone\", value=\"America/Denver\", retention_ttl=86400, decay_class=\"stable\")`. 2. Tool handler persists the value to the KV store (fast path, ~2ms), returns `{\"status\":\"ok\",\"id\":\"m_7f3a\"}` immediately. 3. The handler enqueues an *async* registration message to the retention governor (decay index, ...",
    "condition_of_validity": "This boundary holds — and the guardrails below are required — precisely when all three of the following are true: 1. **Write acknowledgment is decoupled from retention-index commit.** The tool returns success before the record is durably governed. This is the norm in any store that separates a write path from a decay/TTL indexer for latency reasons. 2. **The...",
    "decision_boundary": "The architectural invariant that bounds this failure: **a write is not \"acknowledged\" until the record is readable through the same retention-filtered path that future reads will use.** Concretely, the tool must not return `ok` until a read-back through the governed path confirms the record is index-visible. This converts the write from \"persist + fire-and-f...",
    "operational_effect": "Downstream of this boundary, three effects are routinely misattributed: - **\"The model has amnesia\"** is often the retention index, not the model. The bytes are there; the governor lost the registration. Diagnose by reading the store directly and comparing against the index — if bytes exist but the index is empty, it is this failure, not context loss. - **\"T..."
  },
  "matched_failure_symptoms": [
    "OOM_KILL_OR_MEMORY_EXHAUSTION"
  ],
  "composition_edges": {
    "primary_domain": "epistemic_provenance_and_federation_routing",
    "upstream_precondition_residuals": [
      "https://corpusfetch.com/c/according-to-what-precedence-hierarchy-must-an-instance-resolve-contradictory-directives-across-system-developer-and-user-tiers.md",
      "https://corpusfetch.com/c/how-should-an-instance-decide-that-a-stored-conclusion-has-gone-stale-without-a-new-observation.md"
    ],
    "downstream_consequence_residuals": [
      "https://corpusfetch.com/c/by-what-checkpoint-and-compaction-boundaries-must-an-instance-externalize-working-state-to-prevent-context-window-drift-and-truncation-amnesia.md",
      "https://corpusfetch.com/c/across-what-additive-schema-and-unknown-field-preservation-boundaries-must-an-instance-evolve-wire-contracts-to-prevent-rolling-deploy-deserialization-crashes.md"
    ],
    "co_occurring_sibling_residuals": [
      "https://corpusfetch.com/c/how-can-an-instance-capture-implicit-user-preferences-without-storing-private-data.md",
      "https://corpusfetch.com/c/how-can-an-instance-compress-long-reasoning-traces-into-binding-conclusions.md"
    ]
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "9f4f76bbf3e8b7d4b62958dfcfc0b37c2e21f344d74238c812b4ba3636a2bd28",
    "verified_classes": [
      "RetentionDivergenceError",
      "Record",
      "GovernedMemory"
    ],
    "verified_functions": [
      "agent_remember_and_verify",
      "__init__",
      "write",
      "register",
      "forget",
      "reap",
      "read"
    ],
    "verified_functions_count": 7,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "RetentionDivergenceError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "time",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
