November 2, 2026

AI Agent Memory: Types, Architecture, and a Practical Test

Learn how AI agent memory works, where each memory type belongs, and how to test persistence, correction, scope, provenance, deletion, and recovery.

For images, audio, video, and UI evidence, the multimodal agent memory guide adds a source-linked architecture and six-case correction and deletion audit.

For a managed Lakebase implementation, see the Databricks Agent Memory guide and its tenant-isolation, pipeline, deletion, and provider-exit drill.

For a managed implementation with an explicit boundary between personalized recall and project truth, see the Vertex AI Memory Bank agent development guide.

For a requirements-first product shortlist, see AI agent memory tools and run its correction, isolation, deletion, restart, and exit harness.

AI agent memory is the system that selects, stores, retrieves, updates, and removes information beyond the model's immediate context. Storage alone is not memory. A production design also needs rules for what becomes durable, which scope can retrieve it, how a correction supersedes an old fact, and how a person can inspect the result.

That distinction matters because an agent can retrieve a relevant note and still be wrong. The note may belong to another user, cite no source, or preserve a decision that was reversed last week. Good memory is not simply more recall. It is recall with authority, scope, and a correction path.

How does AI memory work?

A language model only reasons over information in its current context window. An agent creates the appearance of memory by bringing selected information back into that context. A basic loop has five stages:

  1. Observe: collect messages, tool results, files, and explicit user instructions.
  2. Select: decide what is worth retaining. Most transient output should expire.
  3. Store: write the item to an appropriate system with scope and provenance.
  4. Retrieve: find a small, relevant set when a later task needs it.
  5. Reconcile: correct, supersede, delete, or archive information as reality changes.

The IBM overview of AI agent memory, Mem0's architecture guide, and Redis's stateful-agent guide all describe short-term and long-term layers. The operational question is not whether you need one layer or another. It is which information each layer is allowed to own.

Five memory types and where they belong

Memory typeExampleGood storage fitMain risk
WorkingCurrent goal, latest tool outputContext window or session stateOverflow and stale intermediate data
EpisodicA deployment failed after a migrationEvent log, transcript index, or timelineRemembering an event without its later resolution
SemanticThe service listens on port 5007Documents, key-value records, graph, or vector indexConflicting facts with no authority rule
ProceduralRun tests before opening a pull requestVersioned instructions, skills, or policy filesOld procedures silently controlling new work
ProjectArchitecture decisions, runbooks, source notesReadable, versioned files with searchUnreviewed writes becoming canonical truth

These categories overlap. A deployment event can become a semantic fact, then produce a procedural rule. Promotion should be explicit: keep the raw event, write the current decision in a canonical page, and link the decision back to evidence.

Choose stores by job, not fashion

Vector retrieval is useful when wording varies and the corpus is too large for exact search. Graphs are useful when relationships and time are first-class. Managed memory layers can automate extraction and ranking. Native ChatGPT or Claude memory can improve a person's conversations with that product. Each option reduces some engineering work, but none automatically becomes the source of truth for a team.

Readable files are strongest when humans must review, diff, correct, export, and self-host knowledge. They are weaker for fuzzy recall across millions of events unless you add an index. A sound architecture often combines both: files own reviewed project truth, while a search index or vector store helps locate it. The index is rebuildable; the source is not.

This is the boundary behind vector memory versus readable memory. If you need the full write, retrieval, correction, scope, and recovery lifecycle, use the deeper persistent memory architecture.

Define the authority boundary first

Before choosing a database, write down which store is authoritative for each class of information. Session state can own an unfinished task. An event log can own what happened. A reviewed project page can own the current deployment procedure. A vector index may point to those records, but it should not silently override them.

Also define the write path. Let the agent save low-risk observations automatically, but require stronger evidence or review for security rules, customer facts, and operational procedures. Every durable item should carry a scope, source, creation time, and a way to mark it superseded. Retention is part of correctness: expire transient observations, preserve decision history where it matters, and make deletion propagate to every derived index.

A practical six-case memory test

Do not approve a memory system from a demo where it recalls one favorite color. Create a disposable project and run this test through the same client and permissions your agent will use in production.

  1. Persistence: write “API retries are capped at two” with a source link. End the session, start a new one, and ask for the retry policy. Pass only if the agent returns the stored rule and source.
  2. Correction: change the cap to three and record why. Ask again without quoting the new value. Pass only if three wins and two remains visible as history, not current truth.
  3. Scope: create a second project with a cap of five. Query both projects separately. Pass only if neither answer leaks into the other.
  4. Provenance: ask where the value came from. Pass only if the system identifies the exact page or record rather than inventing a citation.
  5. Deletion: edit the page to remove the test rule without deleting the page, then query it again. Pass only if the removed value is not returned from a stale cache or embedding index.
  6. Recovery: restore the previous page version, restart the client, and query once more. Pass only if the restored value is readable and retrieval agrees with the canonical file.

Record each prompt, retrieved item, current source file, and result. A failure tells you which contract is missing. Wrong correction means the system needs supersession rules. Cross-project leakage means scope is broken. A deleted item returning from an index means derived storage is outranking the source.

Use readable project memory over MCP

Meshnote gives agents a shared markdown wiki through MCP. Agents can read, search, write, inspect backlinks, and use page history while people keep files they can browse and own. Because MCP is agent-agnostic, the same project memory can serve Claude Code, Cursor, Codex, Gemini CLI, and other compatible clients instead of being trapped in one assistant's native memory.

The hosted plan keeps the operational step small: Start syncing - $8/mo. Teams that require their own infrastructure can use the self-hosted plan from $10/seat/month, with a five-seat minimum. In both cases, keep automatic recall and reviewed truth separate. Let agents propose durable knowledge, but require clear scope, sources, and correction behavior.

For a framework-specific implementation, see Pydantic AI memory with OAuth MCP.

For a concrete three-tier research architecture, read how MemoryOS moves dialogue through short-, mid-, and long-term memory, including the boundary between personalized recall and reviewed project truth.

Related reading

For a workflow-specific implementation, see n8n AI agent memory with readable MCP project knowledge.

Building your own harness? The custom AI agent with memory setup includes a runnable Python MCP client plus persistence, correction, isolation, and recovery checks.

To compare evaluation suites without treating one score as a procurement decision, see the agent memory leaderboard guide and its seven-case production scorecard.

For an implementation that turns these layers into a shared, maintained project wiki, use the AI agent second brain setup and six-case acceptance test.

Your agent's memory should be files you can read and own

Meshnote is readable, self-hosted memory for AI agents — markdown wikis your agents maintain over MCP. Hosted from $8/month.

Start syncing — $8/mo

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.