Spec / 004-04 · pattern 04 of 06
Memory Agent
Memory architectures add an inspectable store. Notes can conflict. Users should be able to see what was saved.
Turn → retrieve → model → reply (+ write)
Station 01 of 04 · Turn
- intake
- memory
- model
- output
- packet on the wire
intake
Turn
This turn.
Turn.
Shape
The type is the contract. If you cannot write it, you do not have this pattern yet.
type MemoryRecord = {
key: string;
value: string;
updatedAt: string;
};
type MemoryAgent = {
retrieve: (turn: string) => MemoryRecord[];
write: (diff: MemoryRecord[]) => void;
};When to use it
Use when preferences or project facts must survive across sessions.
Not this
Not the chat log. If the only memory is tokens in this call, you are still on a single-agent loop.
Risks
- 01
Stale memory.
- 02
Hidden notes the user cannot delete.
Agents that use this pattern
3 agents
Read next
RAG & Knowledge
RAG and Knowledge: Chunking, Embeddings, Rerank, Alternatives
Agents work with private knowledge through retrieval, not by stuffing the company wiki into the system prompt.
Tool-Using Agents
Tool-Using Agents: Calling, Design, Memory, Middleware
Tool calling is how models take actions. Tool design, memory, and middleware decide whether those actions are safe to repeat.