Correctness means something different for each kind of memory

Semantic memory must be supported and non-contradictory, episodic memory complete and ordered, procedural memory versioned and reviewable. Each also fails in its own direction: a semantic store drifts confidently, an episodic stream grows while its precision falls, and a procedural library gets skipped. Retention is the second decision, because memory that outlives the run stops being a cache and becomes data you owe an update path and a deletion path.

What the agent must remember, and how long the memory must persist

Set the content class, then the retention scope. The tool returns a starting pattern and the implementations that match both answers. Evaluate each against your own constraints.

1 What is the primary memory need?

answer questions over a body of knowledge

Why semantic memory, and how to build it
How it differs
The other two remember what happened, or how to act. Semantic memory remembers what is TRUE — claims that hold independent of when they were learned. That independence from time is exactly what makes it queryable.
How to structure it
The unit is a claim, not a transcript. Entities and relationships, or passages with metadata. Give every fact a source and a written-at time so a later fact can supersede it rather than sit beside it.
Storage
A vector index when similarity is enough. A graph when the relationships between facts carry the meaning — but a graph buys that power with entity resolution, which is the part that quietly fails.
Retrieval
Top-k by similarity, or traversal from an anchor entity. The characteristic failure is not retrieving something false; it is retrieving something true and irrelevant.
Growth over time
Facts contradict each other as the world moves. Without an explicit supersede path the store keeps both versions and retrieval becomes a coin flip. Plan the update and delete path before the first write.
Correct when
Supported and non-contradictory. It is the only class that needs evidence links and a supersede path, because it is the only one whose truth can be argued with.
Failure mode
Context poisoning — the store goes consistently wrong in one direction rather than randomly, so the agent stays fluent and confidently off. Extraction quality is the ceiling: a model that writes sloppy facts retrieves sloppily forever.
2 How long should it persist?

the memory outlives the run, and becomes data you are accountable for

What “across runs” commits you to
What it means
The memory outlives the run. That single property is what turns a cache into a system of record — and it is the moment the memory becomes data you are accountable for.
What it obliges
An explicit retention window, an update path, and a deletion path. If a user can put something in and cannot get it out, persistence is a liability rather than a feature.
The real limit
Not capacity — precision. A durable store that grows without curation retrieves worse every month, and the decay is invisible until someone measures it.
3 Which examples should appear first?
Starting patternSemantic memory

Store facts as a queryable knowledge base. Best when the agent reasons over a stable body of knowledge and relationships between things matter.

Prompt: design your own memory
Help me design agent memory. Ask me these in order, one at a time, and refuse to move on until I answer concretely.

1. Content class. List everything the agent might remember. Label each: working, episodic, semantic, or procedural. Anything that resists labelling is episodic data I am mistaking for fact.
2. Scope. For each class: whose is it - user, project, tenant? Is scope a mandatory retrieval filter applied BEFORE ranking?
3. Admission. What must a write carry to be accepted (source, evidence, date, confidence, status)? What gets rejected outright, not downgraded?
4. Retrieval. What query shapes hit which store? Exact lookup, keyword, vector, graph, or time window?
5. Update. When a new fact contradicts an old one, what happens - supersede, conflict record, or silent coexistence? Silent coexistence is not allowed.
6. Deletion. What expires, when, and who can delete it? "Nothing, ever" is a valid answer only if you say it out loud.

Then give me the schema, and name the failure mode each field prevents.
Decision as Markdown
# Agent memory decision

- Content class: Facts & knowledge
- Retention scope: Across runs
- Starting pattern: Semantic memory
- Example priority: production
- Expected output: a memory architecture requirement and candidate implementations. Storage, retrieval, update, deletion, privacy, and retention behavior remain implementation checks.

## Implementations to evaluate
- Zep (production): Temporal knowledge graph for agent memory. Tradeoff: Maintaining a temporal graph is heavier than vector search and requires reliable entity resolution.
- Anthropic Projects / Claude Memory (production): User-scoped durable semantic memory with explicit user control. Tradeoff: Explicit memory surfaces add UI friction and require the model to stay consistent with user-edited facts.
- OpenAI Memory (production): User-scoped salience memory for ChatGPT. Tradeoff: Salience extraction is a heuristic; over-remembering creates privacy concerns and under-remembering makes the feature feel inert.
- Mem0 (production): Multi-level durable memory layer for LLM applications. Tradeoff: Extraction and dedup quality depends on the underlying model; stale or duplicated facts leak into retrieval results.
- Letta (production): Stateful agent platform with working context and durable memory. Tradeoff: Introduces a server and schema that application developers must operate and reason about.
- LangGraph Checkpointer + Store (production): Session-scoped checkpoints plus a cross-session store. Tradeoff: Two APIs to reason about, and the Store leaves higher-level concerns like extraction and dedup to the application.
- Hindsight 20/20 (research): Structured retain, recall, reflect, and revise networks. Tradeoff: Adds reflection and revision passes. Incorrect revisions can alter later recall.
- MemGPT (research): OS-inspired virtual context paging for LLMs. Tradeoff: Every page-in/page-out is a tool call that costs tokens and latency, and the controller can mis-page under pressure.
- Memory-R1 (research): Reinforcement-learned memory management for long-horizon agents. Tradeoff: Requires training data and RL compute; policies are brittle outside the trained task distribution.
- CoALA (research): Cognitive architectures framework for language agents. Tradeoff: Descriptive rather than prescriptive — does not specify implementations, so two CoALA-compliant agents can differ enormously.