Notes

Agent Memory Types

#Memory#Coordination

Overview

Agent memory goes beyond simple conversation history. Modern agent systems implement distinct memory types (working, episodic, semantic, and procedural), each serving a different purpose in how an agent retains, retrieves, and applies information across tasks and sessions. The memory architecture determines whether an agent can learn from experience, personalize over time, and maintain coherence across long-running workflows.

How It Works

Agent memory is typically decomposed into four categories, mirroring how cognitive science describes human memory:

  • Working memory: The agent's active context: the current conversation, loaded files, recent tool results. This is the scratchpad the model reasons over right now. It maps directly to since it's bounded by the model's context length. Agents manage working memory by summarizing, compressing, or evicting information as the window fills
  • Episodic memory: Records of past interactions: what happened, when, and what the outcome was. An agent with episodic memory can recall "the last time the user asked about deployment, we hit a permissions issue and resolved it by..." This enables learning from experience without retraining. Typically stored as timestamped entries in a vector database and retrieved via
  • Semantic memory: Factual knowledge about the world or the user: preferences, codebase conventions, domain facts. Unlike episodic memory (which is event-based), semantic memory is declarative: "the user prefers TypeScript" or "this repo uses pnpm." power similarity search over semantic memory stores
  • Procedural memory: Learned behaviors and skills. Not what happened, but how to do things. This includes prompt templates, tool usage patterns, and workflow recipes. are a form of externalized procedural memory. Some systems learn procedural memory by observing successful task completions and extracting reusable patterns

The implementation spectrum ranges from simple (append conversation history to a JSON file) to sophisticated (vector-indexed memory with decay functions, importance scoring, and reflection loops that periodically consolidate episodic memories into semantic ones).

Key design decisions:

  • Storage backend: in-memory, file-based (like MEMORY.md files), SQLite, or vector databases like Pinecone/Chroma
  • Retrieval strategy: Recency-biased, relevance-scored (via embeddings), or hybrid
  • Memory lifecycle: Some memories should decay or be explicitly forgotten. An agent that remembers everything becomes slow and noisy
  • Reflection: Advanced agents periodically review their episodic memory to extract higher-level patterns, promoting them to semantic memory

Use Cases

  • Coding agents that remember project conventions, past debugging sessions, and user preferences across conversations
  • Personal assistants that build a user model over time without requiring repeated instructions
  • Customer support agents that recall a customer's full history and past resolutions
  • Research agents that accumulate domain knowledge across multiple investigation sessions

Related