Agent Memory¶
Every agent session starts cold. The model has general programming knowledge from training, but lacks context about your specific repo: naming conventions, architecture decisions, deployment scripts. Each session re-discovers what the last one already learned.
This is the cold start problem. Memory systems address it by storing and retrieving context across sessions.
Memory Types¶
Agent memory falls into three categories based on persistence and storage:
Short-term memory exists only in the context window. Your messages, tool outputs, file contents, and the model's responses all live here during a session. When the session ends, it's gone.
Long-term memory persists across sessions. This includes:
- File-based memory: Markdown files in your repo (AGENTS.md, skills, specs)
- Non-file memory: Vector databases, knowledge graphs, memory services like Mem0 or Letta
Parametric memory is what the model learned during training, encoded in weights. It's vast but frozen. The model knows Python syntax but can't learn your project's conventions.
File-Based Memory¶
For coding agents, file-based memory is the dominant approach. Markdown files travel with the codebase in version control, load automatically, and work across tools.
Three types of file-based memory serve different purposes:
| Type | Purpose | Loading |
|---|---|---|
| Rules files (AGENTS.md) | Project conventions, vocabulary, navigation | Always loaded |
| Skills (SKILL.md) | Multi-step procedures | On-demand |
| Specs | Feature requirements | On-demand |
Rules load at session start. Skills and specs load on demand for procedures and requirements.
Non-File Memory¶
Alternative approaches store memory outside the filesystem:
Vector databases embed past conversations or documents and retrieve them via semantic search. Useful for large knowledge bases that exceed context limits.
Knowledge graphs store entity relationships. An agent can traverse connections between concepts rather than searching flat text.
Memory services like Mem0 and Letta (formerly MemGPT) provide managed memory layers. They extract and consolidate relevant information dynamically.
These approaches suit applications requiring personalization across users or learning from large interaction histories. For coding agents working on a single codebase, file-based memory is simpler and sufficient.
Topics¶
- Memory Types - Detailed taxonomy: context window, long-term storage, scopes
- File-Based Memory - Organization patterns for memory files
- Skills and Specs - On-demand procedural and requirements memory