Anatomy of an Agent Memory System: Storage, Write, Retrieval and Update, and the Push for a Standard Format
A support agent tells a customer that returns are accepted within 45 days.
A support agent tells a customer that returns are accepted within 45 days. The help center moved the policy to 30 days last quarter, but the agent saved the old number to its own memory weeks ago, and nothing told it the fact had gone stale. Then you try switching frameworks to fix it and find the memory can't move, because it only exists in one vendor's shape. Is there a standard format for AI agent memory? Not yet. As of November 2026 there are several open proposals, and none has real adoption.
This causes practical problems. If you can't export memory, you can't audit it. If you can't trace memory back to a source, you can't trust it. And memory that never forgets keeps serving yesterday's facts with full confidence. Teams are shipping memory now, before anyone has settled the format question.
This guide breaks agent memory into five parts: storage, write policy, retrieval, update and forgetting, and scope. It then looks at where the push for an OpenTelemetry-style standard stands. The argument is that per-agent memory belongs beside a governed shared layer. In Sanity Context, that layer is the Content Lake and Knowledge Bases, where a fact like a return policy has one owner and one source.

What are the main parts of an agent memory system?
An agent memory system has five parts: storage, a write policy, retrieval, update and forgetting, and scope. aiagentmemory.org offers a useful definition: 'An agent memory format is the shape a memory system gives to one remembered item: what the unit is (a file, a fact, a block, a graph edge), how it is addressed (a path, a user id, a label, a namespace), what it contains, and when it stops being true.' Each clause in that sentence lines up with one of the five parts.
Storage covers the unit and where it lives, and the unit varies a lot between systems. Instruction files like AGENTS.md are Markdown documents. Mem0 extracts single facts, such as 'User's dog Biscuit turned 5.' Letta keeps memory blocks, each with a label, description, value, and character limit, and they stay in context. Zep and Graphiti put facts on graph edges. LangGraph's BaseStore keeps JSON values under a namespace tuple plus a key.
The write policy decides what gets remembered and who writes it. Retrieval decides which remembered items reach the model on a given turn. Update and forgetting cover 'when it stops being true,' which is the clause most systems handle worst. Scope decides who can see an item: one user, one agent, or a group of agents sharing a block.
Agent memory is also just one kind of context. Production agents work with at least four kinds. Static instructions change with each release. Per-turn state lasts a single turn. Retrieved content is stable and owned by a content team. Agent-authored notes persist across sessions and are owned by the agent. Memory, as this article uses the word, is the fourth kind. Each kind has its own lifetime and owner, so each needs its own governance. Put them all in one bucket and you get an agent that remembers a return policy it should have looked up.
Keeping the five parts separate helps when a standard arrives. If a team knows which components handle storage and which handle write policy, it can swap one without rewriting the rest.
How does an AI agent decide what to remember?
An AI agent decides what to remember through its write policy. Today there are three kinds of writer: a person, the model, or an extraction service. A person writes AGENTS.md. The model writes Claude Code auto memory and Letta blocks as it works. Mem0, Graphiti, and Hindsight run a service that reads the conversation and pulls memory out of it.
This matters for trust. A human-authored instruction file records a deliberate decision. A model-written note records what the model concluded mid-task. That conclusion may be right, or it may misread an ambiguous message. An extracted fact records what a second model decided was worth saving. The aiagentmemory.org survey puts it this way: 'A reader who cannot tell which of the three produced a record cannot know how much to trust it.'
Here's how that goes wrong. A user mentions in passing that they are testing the enterprise plan. An extraction service saves 'User is on the enterprise plan.' Two weeks later the agent quotes enterprise pricing and features to someone who's still on a trial. The record doesn't say that a model inferred the fact, which message it came from, or when. So nobody reviewing the conversation can tell whether the memory or the model caused the error.
The fix is provenance on every write. The memorywire proposal says its provenance field 'is the strongest lever for recovering a poisoned store.' If a team knows where each record came from, it can find and remove everything a bad source produced. Cognition's Agent Memory Repo does a lightweight version of the same thing: each Markdown bullet carries a tag like [source: ...; added: YYYY-MM-DD].
A write policy also has to hold back. Not every turn deserves a memory. A policy that saves too eagerly fills storage with trivia, which later competes for space in the context window. A good write policy saves stable preferences and decisions and skips passing chatter. It also never saves facts that belong to a shared, owned source, like a price or a policy. The agent should look those up fresh every time.
How should an agent retrieve memory without flooding the context window?
An agent should retrieve a ranked handful of memories relevant to the current turn, not load its whole memory into the prompt. Bigger context windows make loading everything tempting. But too much context leads to semantic collapse and misdirection: the model loses track of what matters and gives stale notes the same weight as the user's actual question.
Systems retrieve memory in different ways. Letta keeps its memory blocks in context at all times, which works because each block has a character limit. Mem0 and LangGraph's BaseStore are queried by user or namespace and return matching items. Graph-based systems like Graphiti can follow relationships, which helps when a question depends on how facts connect.
Most production retrieval blends two signals. Lexical matching, such as BM25, finds exact terms like product names, SKUs, and error codes. Semantic similarity over embeddings finds items that mean the same thing in different words. Each one fails in a predictable way on its own. Lexical search misses paraphrases, and vector search can rank a near-synonym above the exact identifier the user typed.
Freshness is the hidden retrieval problem. An index is only as good as the pipeline that keeps it current. When a source changes or a record is deleted, the index has to know about it. Building that pipeline yourself means incremental indexing, re-embedding on change, deletion handling, eventual-consistency reasoning, and backfill for schema changes. That's a real project, and it brings its own class of bugs. Teams that put memory on a separate vector store usually run into this problem.
For the shared content an agent retrieves, Sanity Context runs retrieval in GROQ mode with dataset embeddings turned on. One GROQ query can then combine structured filters with semantic ranking, and the embeddings stay tied to the content they describe. You write the semantic part as text::semanticSimilarity() inside score(), and that's the only place it's valid: semantic search ranks results but doesn't filter them. Exact filters decide what qualifies, a match() term can weight keywords, and similarity sets the order of what passes.
How do agent memory systems update and forget?
Agent memory systems update and forget in four main ways: expiry, hiding, refreshable TTLs, and invalidation. Very few delete anything outright, and that's mostly a good thing.
GitHub Copilot Memory expires a memory 90 days after its last upvote by default. For repository facts, you can set that anywhere from 7 to 180 days. Mem0 offers an optional expiration_date. Expired items are hidden, not deleted, and by default memories never expire. LangGraph's BaseStore supports an optional TTL, and reads refresh it by default through refresh_on_read, so memories that keep getting used stay alive. Zep and Graphiti put facts on graph edges with validity windows. When a fact changes, the old edge is 'invalidated, not deleted.' Letta blocks never expire, and the agent rewrites them in place.
Each approach answers a different question. Expiry asks whether anyone still cares about the memory. TTL refresh asks whether it's still being used. Invalidation asks whether it's still true, and that's the question that matters most when an agent acts on a fact. Take a memory that a customer lives in one city when they've since moved to another. It isn't stale because nobody has read it lately. It's wrong because a newer fact replaced it.
The less obvious point is that forgetting should leave a trace. Silent deletion destroys the evidence an auditor or incident reviewer needs. Say an agent gave bad advice last month based on a memory that has since disappeared. Nobody can reconstruct why it happened. The Portable Memory (.mem) proposal from MacPaw Research handles this with an audit/tombstones.jsonl file that records what was removed. Graphiti's validity windows keep the old fact queryable as history while removing it from the current view.
Shared knowledge has the same problem at a larger scale. When a help center and a product page give different return windows, you have an update problem with two writers and no one to settle it. Per-agent memory systems mostly leave that conflict to the agent. A governed knowledge layer can send it to a person instead. That's where per-agent memory and shared content start to need each other.
Forgetting should leave a trace
How should agent memory be scoped across users, agents, and teams?
Agent memory should be scoped explicitly to a user, an agent, a run, or a shared group. The scope should be part of the record's address, not an unwritten convention. Scope errors are among the most damaging memory bugs because they leak one user's facts into another user's conversation.
Systems handle scope in different ways today. Mem0 addresses memory by user_id, agent_id, run_id, and app_id, so a fact can be pinned to one person, one agent, one session, or one application. LangGraph uses namespace tuples such as (user_id, 'memories'). Developers can build any hierarchy they like with these, but LangGraph enforces none. LoreKit layers scopes as branch::, repo::, project::, and global, and when two copies conflict, the most specific one wins. Letta lets you attach one memory block to several agents at once, which gives native shared scope.
LoreKit's layering is worth studying because it settles conflicts by rule, not by luck. A branch-level note overrides a repo-level one, and a repo-level note overrides a project default. Without a precedence rule, an agent holding two contradictory memories uses whichever one retrieval ranks higher, and the answer can change from turn to turn.
Shared scope is where per-agent memory frameworks start to strain. A block attached to five agents is convenient, but it has no editorial owner and no review step. Unless the team builds one, there's also no record of which agent changed it last. That's fine for working notes. It doesn't work for facts the business has to stand behind, like pricing, policy, product specifications, or compliance language.
A practical scoping rule for most teams: per-user and per-agent memory go in a memory framework, written by the agent and scoped by ID. Facts that every agent and every user should see the same way go in a shared layer with a human owner, versioning, and review. Mixing the two causes problems. A support agent can end up treating one customer's offhand comment as company policy, or a policy change can reach the website but never reach the agents.
Is there a standard format for AI agent memory?
There is no standard format for AI agent memory as of November 2026. aiagentmemory.org says so directly and counts 'Three open proposals... None has real adoption yet.' The full list of efforts is longer, and none of them is settled.
Portable Memory (.mem), from MacPaw Research, defines a folder containing manifest.json, items/<kind>.jsonl, audit/tombstones.jsonl, and CHECKSUMS. It ships Python and Swift reference SDKs under an MIT license. Cognition's Agent Memory Repo is a git repository with a MEMORY.md entry point, tagged Markdown bullets, and a periodic 'Dreaming' agent that merges and prunes entries. The Open Memory Protocol (OMP) defines five verbs: recall, remember, link, observe, and validate. memorywire (arXiv 2606.01138) is a JSON Schema 2020-12 wire format for remember, recall, forget, merge, and expire. It covers semantic, episodic, procedural, and emotional memory and has an optional human-in-the-loop governance channel. An Internet-Draft, draft-vu-aimem-bundle-00, proposes a Memory Interchange Bundle. The W3C AI Agent Memory Interoperability Community Group adopted its Version 1.0 charter in July 2026, but Community Groups don't sit on the W3C standards track.
The question got renewed attention on 8 November 2026. That day, LoreKit's post 'Agent memory needs its OpenTelemetry moment' reached the Hacker News front page with 87 points and 73 comments. The analogy is specific. Before OpenTelemetry arrived in 2019, every monitoring vendor shipped its own agent and data format. Vendors then agreed on a data model, shared naming conventions, one wire protocol, and reference implementations, and they kept competing on storage and analysis. Agent memory is roughly where observability was before that agreement.
A related thread is running inside OpenTelemetry itself. Its GenAI semantic conventions cover agent, tool, and retrieval spans. A Partnership on AI report from October 2026 describes a memory span for create, search, update, and delete, but treat that as emerging until it's confirmed in the spec. A shared vocabulary of operations seems more likely to arrive first than a single winning file format.
No proposal is settled
Where does a governed knowledge base fit alongside agent memory?
A governed knowledge base sits beside agent memory as the shared, human-owned layer. It holds facts every agent should retrieve the same way, while per-agent memory keeps the notes each agent writes for itself. Sanity Context provides that shared layer through the Content Lake and Knowledge Bases. Agents reach both through Context MCP, a hosted read-only endpoint that any agent loop can connect to. Sanity Context has an MCP, a knowledge base, and an ingest path. It doesn't claim to hold agent-authored memory. Frameworks like Mem0, Letta, and Graphiti do that job.
A Knowledge Base is a pre-built index over sources you choose. Instead of reading and reconciling sources at query time, a build reads them ahead of time, resolves conflicts, and writes cited entries that agents retrieve from directly. Nobody can edit entries by hand, so every answer traces back to a source. When copies of a fact drift apart, the build raises an issue. If a help center says 30-day returns and a product page says 45, the issue shows both claims side by side with their sources, and a person picks the ground truth. Instructions record standing decisions, such as which source to trust. Each one is tied to sources, so a build retires it automatically when those sources change. That solves the update-and-forgetting problem for shared knowledge, with a human in the loop. Knowledge Bases are in beta: they're opt-in and may change before general availability.
For tabular data, GROQ mode queries the dataset at request time. With dataset embeddings turned on, one query can combine exact filters with semantic ranking through score() and text::semanticSimilarity().
The split works because of how the two layers are built. Sanity is the intelligent backend for companies building AI content operations at scale. As an AI Content Operating System, it was built for AI, not retrofitted with it. Legacy CMSes create silos, while Sanity provides a shared foundation, so when an editor updates a policy in the Studio, every agent retrieves the new version.
Drift becomes a ticket, not a hallucination
What should teams build today so agent memory can adopt a standard later?
Teams building agent memory today should design for portability. No format has won yet, and the operations are more likely to standardize than any single file layout. Six habits keep a memory system adaptable.
First, record provenance on every write: the source message or document, the date, and the session. memorywire calls provenance 'the strongest lever for recovering a poisoned store.' Second, record who wrote each item: a person, the model, or an extraction service. If a reader can't tell which of the three produced a record, they can't know how much to trust it. Third, prefer invalidation and tombstones over silent deletion. Graphiti's 'invalidated, not deleted' edges and the audit/tombstones.jsonl file in .mem both keep the history an incident review needs.
Fourth, make scope part of the address. You might use Mem0-style IDs, LangGraph namespace tuples, or LoreKit-style layered scopes. Either way, write down the precedence rule so two conflicting memories resolve the same way every time. Fifth, keep memory out of the full context window. Retrieve a ranked handful per turn, because piling everything in leads to semantic collapse and misdirection.
Sixth, put memory behind your own small interface that uses the verbs the proposals already share: remember, recall, forget, merge, and expire. memorywire uses all five, and OMP shares recall and remember. If a standard gains adoption, you write one adapter instead of migrating every call site.
Finally, take shared facts out of per-agent memory entirely. Pricing, policies, product specifications, and the agent's own instructions are content with owners, not memories. Author them like content and gate them like code. In Sanity Context, the Content Lake and Knowledge Bases hold those facts with citations and conflict issues. Editors change them in the Studio, and agents read them through Context MCP. Per-agent memory then shrinks to what it does well: the notes an agent keeps for its own future sessions. Moving those notes to a standard format later becomes a much smaller job.
Agent memory frameworks vs Sanity Context as the governed shared layer
| Feature | Sanity | Mem0 | Letta | Zep / Graphiti |
|---|---|---|---|---|
| Primary job and memory unit | Shared, governed knowledge for every agent: cited Knowledge Base entries plus Content Lake documents queried in GROQ mode. Doesn't hold agent-authored memory, so it sits beside a memory framework. | Per-user and per-agent facts extracted from conversation by an LLM, such as 'User's dog Biscuit turned 5', run as a managed memory service. | Memory blocks with a label, description, value, and character limit that stay in context, giving the agent a compact working memory it edits itself. | Facts stored on graph edges with validity windows, suited to questions that depend on how facts relate and change over time. |
| Who writes the record | Sources and people: a Knowledge Base build reads attached sources ahead of time and writes cited entries. Nobody can edit entries by hand, so every answer traces back to a source. | An extraction service reads messages and writes facts automatically, so memory grows without explicit action from the agent or the user. | The agent rewrites its own blocks as it works, which keeps memory current but relies on the model's judgment about what to keep. | A service extracts facts from conversations and places them on the graph, updating edges as new information arrives. |
| Update and forgetting | Knowledge Base issues show conflicting claims (30-day vs 45-day returns) for a person to resolve. Instructions tied to sources retire automatically when those sources change. | Optional expiration_date. Expired items are hidden rather than deleted, and by default memories never expire. | Blocks never expire. The agent overwrites values in place, so any history depends on what the team logs outside the block. | Changed facts are invalidated, not deleted, and validity windows keep history queryable. This is the strongest temporal update model among the frameworks surveyed. |
| Scope | Organization-wide: a Knowledge Base belongs to an organization, can draw on sources from more than one project, and is shared by every agent connected through Context MCP. | Addressed by user_id, agent_id, run_id, and app_id, giving fine-grained per-user, per-agent, per-session, and per-app scope. | One block can attach to several agents at once, giving native shared scope, though without a built-in editorial review step. | Scope depends on how the team organizes its graph data. The surveyed docs focus on temporal validity more than on scope controls. |
| Retrieval | GROQ mode with dataset embeddings: score() with text::semanticSimilarity() ranks results while structured filters stay exact, all in one query served through Context MCP. | Queried by scope identifiers, returning matching facts for the current user, agent, run, or app. | Always in context. Character limits keep blocks small enough to load on every turn without a separate retrieval step. | Graph retrieval over edges, useful when an answer depends on connected facts and on which of them are currently valid. |
| Portability and standards readiness | Agents connect through Context MCP, a hosted read-only endpoint any agent loop can use, so the shared layer stays independent of whichever memory format eventually wins. | No shared memory schema yet. Export depends on Mem0's own data shape until a proposal such as .mem or memorywire gains adoption. | No shared memory schema yet. Blocks are portable as text values, but labels and limits follow Letta's own conventions. | No shared memory schema yet. Moving temporal edges and validity windows to another system needs a mapping that no proposal has standardized. |