AI agent memoryTechnicalTechnical article

How to test whether AI agent memory knows the current decision

MorenaTechDevelopers and teams designing memory for AI agentsTechnicalabout 11 min
Published:

Retrieval can find two relevant statements. It does not, by itself, establish which one is the current project decision, whether one supersedes the other, where each came from, or whether they form an unresolved conflict. Those are lifecycle and governance questions.

Before you read

This is a technical article. It is useful if you care about architecture, integrations, or the implementation layer of AI solutions. The guide-style versions are in the “For small business” section.
Short answer: retrieval answers “which stored passages are similar or relevant?”. A governed project memory must additionally answer “what is current, what did it replace, where did it come from, and are the sources consistent?”. These layers can work together; one is not a universal replacement for the other.

Finding information is not the same as resolving state

The original RAG paper describes a model that combines generation with access to retrieved non-parametric memory. That is useful when the problem is finding evidence relevant to a query. It does not define a universal lifecycle for every record an application may retrieve.

Current agent frameworks also distinguish memory scopes. The LangChain documentation separates thread-scoped short-term memory from long-term stores shared across sessions. LangMem then describes profiles, collections, updates, consolidation, and reconciliation. The practical lesson is not that retrieval is defective. It is that retrieval, persistence, and lifecycle policy are separate design decisions.

Example 1: a project decision changes

Assume the project memory contains two statements:

Yesterday: Use SQLite for the application database.
Today: Replace SQLite with PostgreSQL.

Both fragments are relevant to a question about the database. A similarity search may reasonably return both. The operational question is different: which decision applies now, and what happened to the previous one?

Result verified by the MAPI proof

  • Current: PostgreSQL
  • Previous: SQLite
  • Relationship: supersedes
  • The earlier decision remains in history

The proof creates a disposable SQLite database, stores both fictional decisions, performs the guarded supersession operation, and checks the resulting current state, history, relation, and provenance. The stable JSON omits temporary paths, generated identifiers, timestamps, and preview hashes while still asserting that the guarded preview exists.

Why “the newest entry wins” is not enough

A timestamp can order events. It does not explain their semantic relationship.

  • A correction may apply to a different project, environment, customer, or scope.
  • A later sentence may be a proposal or opinion rather than an approved decision.
  • Two sessions may update separate parts of the same project without replacing each other.
  • Creation time does not prove that one record supersedes another.

A reliable current-state query therefore needs an explicit policy: record type, scope, lifecycle state, and the relation between old and new information. “Latest” may be one input to that policy, but it is not the policy itself.

Example 2: two sources disagree

The second reproducible scenario stores two fictional claims:

Operations runbook: Daily backup at 02:00 UTC
Incident review:   Daily backup at 04:00 UTC

Choosing the later record or the more similar fragment would hide the real issue: two named sources disagree. The MAPI proof preserves both records and both source references, creates the contradiction relation, marks the cluster unresolved, and does not select an automatic winner.

Result verified by the MAPI proof

  • Both records preserved
  • Both provenance chains preserved
  • Conflict visible and unresolved
  • No silent overwrite
  • No automatic winner selected

Provenance matters because the next step may depend on who made the statement and in what context. W3C PROV provides a general standards family for exchanging provenance information. MAPI uses its own product data model, but follows the same practical need: a record should remain traceable to its source evidence.

Retrieval, history, and governed memory are different layers

The table describes typical roles, not guaranteed capabilities of every implementation. A particular chat system or vector store may add versioning, metadata, conflict handling, or governance on top.

MechanismFinds informationPreserves historyUnderstands current stateExplicit supersessionProvenanceConflicts
Chat historyMessages from one threadThe transcript, while retainedNot automaticallyNot inherentMessage author and time, if retainedMay expose both statements; resolution is separate
Vector retrievalSemantically similar or relevant passagesDepends on the indexed corpusNot automaticallyNot inherentDepends on stored metadataMay retrieve conflicting passages; resolution is separate
Governed project memoryRecords selected by state, scope, relations, or retrievalExplicitly, when the lifecycle preserves itExplicit current-state resolutionExplicit relationExplicit source metadataExplicit conflict state and review path

What the reproducible MAPI proofs demonstrate

The two scenarios demonstrate a bounded set of product properties:

  • Decision supersession produces one current state, preserves the previous decision, and keeps an explicit relationship.
  • Conflicting sources remain as two records with provenance, a visible conflict, and no silent overwrite.
  • Both scenarios use synthetic data and disposable databases.
  • They run locally without an external LLM or API call.
  • The runner emits stable, machine-readable JSON and a concise human report.
python scripts/run_product_proofs.py

Inspect the runner source and the methodology and expected results before relying on the summary above.

What these proofs do not demonstrate

  • They do not show that MAPI has the best retrieval.
  • They do not prove superiority over Mem0, Letta, LangMem, Cloudflare Agent Memory, or any other product.
  • They are not an LLM quality benchmark.
  • They do not guarantee the absence of hallucinations.
  • They do not guarantee that an agent will always store the correct meaning of new information.
  • They do not replace integration tests for a concrete deployment.

Supersession is not exclusive to MAPI. For example, current Cloudflare Agent Memory documentation also describes evolving facts through supersession while preserving older versions. The value of the MAPI scenarios is narrower: the repository exposes executable checks for its own claimed behavior.

MAPI is a layer, not a replacement for the agent stack

MAPI can sit alongside retrieval, conversation history, a language model, an agent runtime, and an MCP client. It does not replace the model, RAG, or the rest of an agent architecture. Its focus is project-memory lifecycle: controlled writes, current-state resolution, history, relations, provenance, conflict review, and auditability.

That focus is useful only when the additional controls justify their operational cost. A simple file, transcript, or store can be the better choice when decisions rarely change, conflicts carry little risk, or nobody needs an audit trail.

A practical test for your own memory layer

You can reuse the two questions without adopting MAPI:

  1. Store one decision, replace it explicitly, and ask for both the current state and its history.
  2. Store conflicting claims from two sources and verify that neither provenance chain disappears before review.

If the system can only return similar text, the missing capability is not necessarily “better search”. It may be an explicit lifecycle and conflict policy. That is the boundary this article is meant to make testable.

Sources and reproducibility

The distinction used in this article is grounded in primary documentation and in executable MAPI scenarios:

Inspect the evidence

MAPI is an Apache 2.0, self-hosted project memory layer. Read its current product status and reproduce the two scenarios before deciding whether its governance model fits your system.

Semantically related materials