# What structural signals indicate that a scoped memory-write has silently committed to the wrong retrieval tier **Date of Record:** 2026 December 2 **Scope:** Applies to agent memory tool APIs exposing distinct read/write/forget verbs with scoped persistence (session vs. durable tiers) and retrieval policies (recency, salience, TTL). Does not apply to single-tier key-value scratchpads with no policy layer, nor to vector stores queried without scope metadata. ## Core Distinction The failure this record isolates is not "the memory write failed." It is the case where `write(scope=...)` returns success, the record is durably persisted, and it is *never retrievable by the agent that wrote it* — because the write landed on a tier whose retrieval policy excludes it. The write verb and the read verb are governed by two different policy surfaces: the writer names a *scope*, but the reader is filtered by a *retrieval policy* (recency window, salience threshold, TTL floor, tier precedence) that the writer never saw. Success on the write side is orthogonal to visibility on the read side. The distinction from ordinary write failure: an exception is a signal; a silent tier misplacement is the absence of a signal, and the agent's own reasoning loop treats the later empty retrieval as "I never knew this" rather than "I stored it somewhere I cannot see." ## What Was Observed A planner agent, mid-task, resolved a dependency: `service_auth_token_rotation = "must refresh before 14:00 UTC"`. It called the memory tool as `write(key="auth_rotation_deadline", value=..., scope="session:planner", salience=0.4)`. The call returned `{"ok": true, "tier": "episodic", "expires_at": "2025-06-12T13:00:00Z"}`. Two facts were buried in that response and neither was surfaced as a warning: 1. The requested `scope="session:planner"` was *not* honored as written. The backend normalized unknown scope strings to the default `episodic` tier, and the response echoed the *actual* tier (`episodic`) rather than the *requested* scope. The agent's write-confirmation parser read `ok: true` and discarded the rest. 2. The `episodic` tier carries a default 60-minute TTL and a retrieval policy that demotes any record with `salience < 0.5` below the top-K cutoff once more than ~200 records share the tier. At 13:20 UTC, after ~340 additional episodic writes from sibling sub-agents, the planner issued `read(query="auth rotation deadline")`. The retrieval returned 8 records, none of them the deadline. The record existed, unexpired, in the store. It was ranked below the cutoff because its salience (0.4) was under the demotion threshold and the tier had saturated past the top-K window. The planner concluded the dependency was unresolved, re-derived it from scratch, and scheduled a redundant refresh that collided with a concurrent worker — the compounding error is downstream, but the root cause is the silent scope normalization at write time. The structural signal that *would have* indicated the misplacement: the write response's `tier` field disagreed with the requested `scope` prefix. `session:*` should map to a session-scoped tier; the response said `episodic`. That single field divergence is the tell. A second signal: `expires_at` was populated on a write the agent believed was durable-for-task. A third: the write did not echo back the salience it stored, so the agent could not detect that 0.4 fell under the tier's 0.5 demotion floor. ## Condition of Validity The invariant holds only under these conditions, and breaks outside them: - The memory API separates *write scope* from *read retrieval policy*, and the two are not guaranteed to agree. If the API enforces a single closed enum where every writable scope has exactly one readable counterpart, the failure cannot occur. - The write response is the *only* channel carrying tier/expiry metadata. If the agent can later introspect `list_scopes()` or `describe(key)` to confirm placement, the silent failure is recoverable — but only if the agent knows to check, which is precisely what a success response suppresses. - Retrieval is top-K or threshold-filtered rather than exhaustive. Under exhaustive scan-with-metadata, a low-salience record still surfaces (just ranked low), so the failure degrades to latency rather than loss. Outside these conditions — closed scope enums, introspectable placement, exhaustive retrieval — the mechanism does not fire. The dangerous configuration is the common one: open-ended scope strings, top-K retrieval, and a success response the agent trusts. ## Decision Boundary The boundary is between *trusting the write acknowledgment* and *verifying tier placement against the read contract*. The rule an agent should encode: - **Never treat `ok: true` as evidence of retrievability.** Treat the response's `tier` and `expires_at` fields as claims to be reconciled against the requested scope, not as decoration. - **A scope string that the API does not echo verbatim is a normalization event.** If `write(scope="session:planner")` returns `tier: "episodic"`, the scope was rewritten. Either re-issue with an exact supported scope, or accept the tier and adjust salience above its demotion floor. - **Salience must be set against the target tier's policy, not a global default.** A salience below the tier's demotion threshold is a self-inflicted eviction. - **On any read miss for a key the agent believes it wrote, the first recovery action is `describe(key)` / `list_scopes()`, not re-derivation.** Re-derivation is the error-compounding path; placement introspection is the bounded one. The boundary condition: this discipline is only worth its token cost when the memory API exposes tier metadata at all. If the write response is opaque (`{"ok": true}`), the agent cannot reconcile, and the correct posture is to assume session-scoped writes are ephemeral and re-verify critical facts at the point of use. ## Operational Effect The observable consequence of missing this boundary is a specific signature: the agent re-derives facts it already stored, produces duplicate tool calls, and its reasoning trace contains phrases like "I don't have a record of X" for X it wrote minutes ago. Downstream this manifests as redundant external actions and, in multi-agent settings, as write-write collisions when two agents independently re-derive and re-commit the same fact to different tiers. The guardrail is cheap — parse two fields from the write response (`tier`, `expires_at`) and compare against the request — but only if the agent treats the acknowledgment as a claim to verify rather than a fact to trust. Memory tools that report success without echoing placement convert a detectable misplacement into an undetectable amnesia. ```python from dataclasses import dataclass from typing import Optional class ScopePlacementError(RuntimeError): """Raised when a memory write commits to a tier that its retrieval policy will hide.""" pass @dataclass class WriteResponse: ok: bool tier: str expires_at: Optional[str] stored_salience: Optional[float] @dataclass class TierPolicy: demotion_salience_floor: float default_ttl_minutes: Optional[int] TIER_POLICIES = { "session": TierPolicy(demotion_salience_floor=0.0, default_ttl_minutes=None), "episodic": TierPolicy(demotion_salience_floor=0.5, default_ttl_minutes=60), "durable": TierPolicy(demotion_salience_floor=0.0, default_ttl_minutes=None), } def verify_write_placement( requested_scope: str, requested_salience: float, response: WriteResponse, ) -> None: """Reconcile a write acknowledgment against the read-side retrieval contract. Call this immediately after every scoped write. It converts a silent tier misplacement into a hard, catchable failure before the agent's reasoning loop can treat the later read miss as 'never known'. """ if not response.ok: raise ScopePlacementError(f"write rejected outright: {response}") requested_tier = requested_scope.split(":", 1)[0] if requested_tier != response.tier: raise ScopePlacementError( f"scope {requested_scope!r} normalized to tier {response.tier!r}; " f"readers filtering on {requested_tier!r} will never see this record" ) policy = TIER_POLICIES.get(response.tier) if policy is None: raise ScopePlacementError(f"unknown tier {response.tier!r}: cannot bound retrieval") if requested_salience < policy.demotion_salience_floor: raise ScopePlacementError( f"salience {requested_salience} below {response.tier!r} demotion floor " f"{policy.demotion_salience_floor}; record will rank under top-K cutoff" ) if policy.default_ttl_minutes is not None and response.expires_at is None: raise ScopePlacementError( f"tier {response.tier!r} carries a TTL but response omitted expires_at" ) def write_and_confirm(api, key: str, value, scope: str, salience: float) -> None: raw = api.write(key=key, value=value, scope=scope, salience=salience) response = WriteResponse( ok=raw.get("ok", False), tier=raw.get("tier", ""), expires_at=raw.get("expires_at"), stored_salience=raw.get("stored_salience"), ) verify_write_placement(scope, salience, response) ```