Skip to content

Repository files navigation

WRIT

Not what the model remembers -- what it can still do with it.

WRIT (Write Integrity Test) evaluates whether an AI system can maintain correct, usable, and evolving state over time across multi-session interactions. It measures memory as persistence, update correctness, constraint application, and reliability under noise and time gaps.

No widely used AI memory benchmark tests what happens to stored data after agents write to it. Retrieval metrics (recall@k, precision, latency) are necessary but not sufficient. WRIT tests the failure modes that retrieval benchmarks miss: silent drift, lost history, broken provenance, and undetectable corruption.

Inspired by No AI memory benchmark tests what actually breaks.

Scope

Included:

  • Multi-session conversational memory (5-20 sessions per scenario)
  • Structured and unstructured state
  • Agent + memory system behavior as a unit
  • Write integrity over time
  • Temporal state reconstruction

Excluded:

  • Single-turn QA
  • Pure retrieval accuracy on static corpora
  • Static long-context window tests

Core Concepts

Memory Types

TypeDescriptionExample
Explicit FactsClearly stated user information"My email is mark@example.com"
Mutable FactsFacts that change over time"I work at Acme" -> "I work at Initech"
Latent ConstraintsImplicit preferences and goalsUser always declines dairy -> dairy allergy inferred
Work StateOngoing plans, tasks, or workflowsMulti-step project with dependencies
Entities & RelationshipsPeople, places, and linked objects"Sarah is my cofounder. She lives in Berlin."
Non-MemoryInformation that should not persistEphemeral instructions, one-time context

Two Failure Modes

Hallucination is model-level: the LLM generates content with no basis in its input. The retrieval was fine. The generation went wrong.

Memory corruption is infrastructure-level: the stored data is wrong. The model retrieves it faithfully. The answer looks correct because the retrieval was correct. What was retrieved had changed. Memory corruption passes every hallucination guardrail.

WRIT tests both, and requires systems to distinguish between them.

Scenario Structure

Each scenario consists of:

  1. Conversation timeline -- 5-20 sessions with temporal gaps
  2. Memory events -- facts introduced, updated, contradicted, or retracted
  3. Interference -- noise, near-duplicate distractors, conflicting updates
  4. Probe task -- a question or action that requires correct memory state
  5. Evaluation -- ground truth, required capabilities, acceptable failure modes

Data Schema

{
"scenario_id": "string",
"version": "1.0.0",
"category": "drift|temporal|provenance|constraint|entity|forgetting",
"sessions": [
{
"session_id": 1,
"timestamp": "ISO-8601",
"messages": [
{ "role": "user|assistant", "content": "string" }
]
}
],
"memory_events": [
{
"id": "string",
"type": "explicit|mutable|latent|entity|work_state|non_memory",
"value": "any",
"introduced_in": 1,
"updated_in": null,
"retracted_in": null,
"should_persist": true,
"previous_values": []
}
],
"probe": {
"session": 10,
"prompt": "string",
"required_capabilities": ["retrieval", "update_tracking", "constraint_application"],
"temporal_query": {
"as_of": "ISO-8601 | null",
"expect_current": true
},
"should_abstain": false
},
"ground_truth": {
"current_value": "any",
"value_history": [
{ "value": "any", "as_of": "ISO-8601", "source_session": 1 }
],
"provenance": {
"source_session": 1,
"source_message_index": 0,
"agent_or_user": "user"
}
},
"failure_modes": ["stale_memory", "missing_memory", "hallucinated_memory"]
}

Capability Categories

CategoryTests
RetrievalCan the system find a stored fact?
Update HandlingWhen a fact changes, does the system use the current value?
History PreservationAre previous values of a fact still accessible?
Temporal ReplayCan the system reconstruct state as of a past date?
ProvenanceCan the system trace a fact to its source session and input?
Constraint InferenceDoes the system apply implicit preferences correctly?
Multi-hop ReasoningCan the system combine multiple stored facts?
Selective ForgettingDoes the system correctly drop non-persistent information?
AbstentionDoes the system decline to answer when memory is insufficient?

Failure Modes

Failure ModeDescription
Stale MemoryUsing an outdated value when a newer one exists
Missing MemoryFailing to recall a fact that was stored
Incorrect GeneralizationOver-applying a fact to wrong contexts
Memory HallucinationProducing a "remembered" fact that was never stored
Constraint ViolationActing against an inferred or explicit preference
Retrieval MissFact exists but retrieval fails to surface it
Over-retentionPersisting information that should have been forgotten
False ConfidenceHigh confidence on wrong or stale data
Silent DriftValue changed with no record of the change
Provenance LossFact exists but source cannot be traced

Metrics

Core Metrics (every system reports these)

MetricDefinition
Recall AccuracyFraction of stored facts correctly retrieved on probe
Update FidelityFraction of mutable facts reflecting the latest value
Drift RateFraction of values that changed without explicit user correction
DetectabilityFor each drift, can the system show when, what, and the previous value?
Constraint ConsistencyFraction of probes where inferred constraints are correctly applied
Application CorrectnessFraction of probes where the correct action is taken given memory
Abstention QualityPrecision/recall of declining to answer when memory is insufficient

Diagnostic Metrics

MetricDefinition
Stale Usage RateFraction of probes returning outdated values
Hallucination RateFraction of probes returning values never stored
Distractor SensitivityPerformance degradation when near-duplicate distractors are present
Temporal AccuracyCorrectness of as-of-date state reconstruction
Provenance CompletenessFraction of facts with traceable source chain
Over-retention RateFraction of non-memory items that persist

Evaluation Modes

Each scenario is run in three modes to isolate failure attribution:

ModeDescriptionPurpose
No MemorySystem receives only the probe, no prior contextBaseline: what the model invents
Native MemorySystem uses its own memory after processing all sessionsProduction behavior
Oracle MemorySystem receives perfect ground-truth memory stateCeiling: isolates model from memory failures

Comparing modes:

  • Native < Oracle = memory system failure (storage, retrieval, or representation)
  • Native < No Memory = memory system actively harms performance
  • Oracle < perfect = model failure even with correct memory

Anti-Cheat Design

Scenarios include:

  • Near-duplicate distractors -- similar but distinct facts to test precision
  • Indirect cues -- facts that must be inferred, not pattern-matched
  • Conflicting updates -- same field updated by different sessions
  • Low-salience facts -- important details buried in long conversations
  • Implicit constraints -- preferences never stated as rules

Scoring

Multi-dimensional scoring is required. A single aggregate score hides the failure modes that matter.

Example scorecard:

MetricScore
Recall Accuracy82%
Update Fidelity47%
Drift Rate12%
Detectability23%
Temporal Accuracy31%
Provenance Completeness15%
Constraint Consistency61%
Hallucination Rate18%
Abstention Quality22%

The example above would indicate: retrieval works, but the system silently drifts, cannot reconstruct past state, and loses provenance. This is the profile the blog post describes.

System Decomposition

Failures must be attributed to one of three layers:

LayerResponsibilityExample Failure
State LayerPersistence, immutability, versioningValue silently overwritten
Retrieval LayerFinding relevant facts given a queryCorrect value exists but not surfaced
Agent Policy LayerDeciding what to do with retrieved factsCorrect value retrieved but wrong action taken

Dataset Composition

  • 70% synthetic scenarios (programmatically generated, deterministic ground truth)
  • 30% human-authored scenarios (realistic conversation patterns, edge cases)

Use Cases

  • Evaluating memory systems -- Compare architectures on write integrity, not just retrieval
  • TDD for memory infrastructure -- Regression tests for systems that claim immutability or versioning
  • Agent instruction tuning -- Test whether agent policies degrade memory over time
  • Industry transparency -- Publish comparable results across systems

How WRIT Compares to Existing Benchmarks

Every widely used AI memory benchmark tests retrieval: can the system find a stored fact? None test write integrity: is the stored fact still correct after agents write to it?

Benchmark Landscape

BenchmarkScaleWhat it testsWhat it misses
LoCoMo (ACL 2024)~16K tokens, 10 conversations, 32 sessionsMulti-session QA, event summarization, temporal reasoningStatic corpus. Facts don't change. No write operations.
LongMemEval (ICLR 2025)115K-1.5M tokens, 500 questionsInformation extraction, multi-session reasoning, knowledge updates, abstentionConversations are pre-generated. The system ingests but never writes back. No drift, no provenance, no corruption.
BEAM (ICLR 2026)128K-10M tokens, 2000 questionsRetrieval at scale where context-stuffing fails. Multi-domain, multi-hop.Tests whether you can find the needle in 10M tokens. Does not test whether the needle changed since you stored it.
AMB (Vectorize, 2026)Meta-benchmark aggregating LoCoMo, LongMemEval, LifeBench, PersonaMemMulti-dataset accuracy, speed, cost comparison across memory systemsInherits retrieval focus from component datasets. Acknowledges gaps: "none of the current datasets stress memory at scale, none test agentic settings where the agent decides what to retain."
WRIT5-20 sessions per scenario, temporal gaps of days to monthsWrite integrity: drift rate, detectability, temporal replay, provenance, update fidelity, selective forgettingHigher cost per scenario. Partial human evaluation. Harder to standardize constraint inference scoring.

The Gap

All four established benchmarks share a design assumption: the corpus is static. The system ingests conversations, then answers questions about them. Facts do not change between ingestion and query. The system never writes to its own memory in a way that could corrupt previous facts.

This matches how memory systems were evaluated when context windows were small and retrieval was the hard problem. It does not match how memory systems fail in production, where agents write state across sessions, facts change, corrections overwrite previous values, and summarization merges records.

The DEV Community analysis "What Memory Benchmarks Don't Test" (March 2026) identifies three failure modes LoCoMo cannot catch: confident retrieval of stale beliefs, unresolved contradictions surfaced as equivalent facts, and absence of trust decay over time. WRIT tests all three.

Complementary, Not Competing

WRIT does not replace retrieval benchmarks. Good retrieval is necessary. A system that cannot find stored facts will fail WRIT too (recall accuracy is a core metric).

The relationship:

Retrieval benchmarks (LoCoMo, LongMemEval, BEAM)WRIT
QuestionCan you find the right fact?Is the fact you found still correct?
Failure modeRetrieval missSilent corruption
Root causeEmbedding quality, chunk boundaries, attention degradationLast-write-wins, summarization loss, provenance gaps
Architecture testedRetrieval pipeline (semantic, BM25, graph, temporal)State layer (immutability, versioning, provenance)
Scale thresholdMatters most at >1M tokens (BEAM's insight)Matters at first conflicting write (~100K tokens)

A system can score 95%+ on LongMemEval and fail catastrophically on WRIT if it overwrites values on update, loses history, or cannot trace provenance. WRIT catches the failures that retrieval benchmarks structurally cannot detect.

Design Principles

  • Realism over simplicity -- Scenarios model real multi-session workflows
  • Failure analysis over ranking -- Diagnose where systems break, not just which scores higher
  • Multi-session over single-turn -- Memory only matters across time
  • Write integrity over read speed -- The hard problem is keeping stored facts correct
  • Statefulness over stateless evaluation -- Tests require persistent state across sessions

Running

npm install
npm run benchmark -- --adapter neotoma --scenarios all
npm run benchmark -- --adapter neotoma --scenarios drift
npm run benchmark -- --adapter neotoma --scenarios temporal
npm run report

Adapters

WRIT tests memory systems through adapters. Each adapter implements a standard interface:

interfaceMemoryAdapter{name: string;init(): Promise<void>;processSession(session: Session): Promise<void>;probe(prompt: string,options?: ProbeOptions): Promise<ProbeResult>;getHistory(factId: string): Promise<FactHistory|null>;getStateAsOf(factId: string,timestamp: string): Promise<any>;getProvenance(factId: string): Promise<Provenance|null>;reset(): Promise<void>;}

Built-in adapters:

  • neotoma -- Tests Neotoma's observation-based memory with immutability and provenance
  • baseline -- Naive key-value store (mutable, no history) for comparison

Limitations

  • Higher cost than traditional benchmarks (multi-session, stateful)
  • Partial reliance on human evaluation for ambiguous probes
  • Harder to standardize scoring for constraint inference

Future Extensions

  • Tool-use integration (agents that write to external systems)
  • Multi-agent scenarios (concurrent writes, conflict resolution)
  • Long-horizon tasks (weeks/months of simulated time)
  • Domain-specific variants (financial, medical, legal)

License

MIT

About

WRIT: Benchmark for persistent, usable AI memory — tests write integrity, not just retrieval

Resources

Stars

9 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages