Agent Build Tutor
Map / Outline

Memory

What the agent keeps about a user and about its own past work, and how it gets back into the prompt.

What it is and why it exists

What

Memory is durable information written during or after conversations and read back in later ones. It includes per-user facts, summaries of past threads, and rules the agent learned from its own mistakes.

Why

Without memory every conversation starts cold. With careless memory the agent leaks one user's context into another's, or carries forward a wrong belief forever.

How it works

Where it sits in the build order

Needs first

  • Harness engineeringMemory is read at prompt composition and written after the response. Both are harness stages.Build out of order Stub it with: A JSON file per user, read at start and appended at end.
  • State and storageMemory is durable state with concurrent writers: live chats and background jobs. It needs the storage guarantees from the state module.Build out of order Stub it with: A single-writer file store, for one user only.

Unlocks

  • Self-evolving agentsLearned claims and rules are a form of memory. They use the same store, status fields, and recall path.

In the reference build

PathRole
apps/agent-server/memory_store.pyPer-partition reads and writes.
apps/agent-server/memory_pipeline.pyPost-response extraction, run in the background.
apps/agent-server/tools/conversation_recall.pySearch past threads on demand.
evals/memory/Memory eval sets.

The same idea on other platforms

PlatformHow this module maps
DatabricksUse Lakebase or Delta tables keyed by user, read in your agent code. Long-term memory patterns ship with the agent framework and LangGraph stores.
IBM watsonxOrchestrate keeps conversation context. Long-term memory is a store you connect and read through a tool.
CodexPersistent instructions live in AGENTS.md. Memories are files the agent is told to read and update.
CursorRules and memory features hold persistent preferences. Project facts belong in repo files.
Claude Code / Agent SDKA project instruction file plus memory files and tools. The pattern is the same: write after, read at start, scope by project.
Another machineA table with a partition column and a summarizer. Portable.

Explain it back

Answer aloud first. Then open the answer and compare.

Why is the memory write fire-and-forget?
A strong answerThe user is waiting on the answer, not on bookkeeping. A slow or failed write should cost nothing in latency or correctness.
What stops one user's memory from reaching another?
A strong answerA partition key applied in the store on every read and write. A prompt instruction alone would not be a boundary.

From the live build

Recent changes and files the sync job filed under this module.

Ask the tutor about this module