# Agent Memory

> Part of the AI Garage Jargons glossary: https://aigarage.in/jargons (all terms: https://aigarage.in/jargons.md)

**Category:** LLM
**Tags:** agents, memory, context, persistence

Information an AI agent saves outside its context window, such as notes or files, and reads back later, so it can continue work across sessions or after its context is cleared.

**In plain terms:** It is the agent's notebook. Its head holds only what fits right now, so it writes things down and looks them up when it needs them.

**Use cases:**
- A coding agent that resumes a project the next day
- A support assistant that remembers a customer's preferences
- A research agent that keeps findings across sessions

**Why it matters:** Without memory, every session starts from nothing. With careless memory, an agent can fill its notes with stale, wrong, or sensitive content, so what to keep, for how long, and who can read it are design decisions.

**Why now:** Agents now run tasks longer than one context window holds. Providers offer file-based memory tools and pair them with compaction and context clearing. Details differ by provider and change quickly, so check current documentation before relying on a specific behavior.

**AI Garage example:** The coding agent used on this repository keeps a small memory folder: an index file plus one short file per lasting fact, such as how the team ships and where plans are saved. Each new session reads the index first, so those decisions carry over without being repeated. This describes how this repository is worked on, not a product claim.

**Mental model:** The context window is what the model can see this moment. Memory is storage outside it. The agent saves what it learns, reads it back on demand, and the application, not the model, does the actual storing. That keeps the active context small and lets work survive interruptions. It is different from a larger context window, and from retrieval over documents someone else wrote.

**Builder scenario: Let work survive a reset**

- **Context:** A coding agent works on a project across many days, and each session starts with an empty context.
- **Failure:** Every session re-explores the code and repeats questions that were already settled, and decisions made on day one are quietly reversed on day three.
- **Intervention:** Give the agent a memory folder. At the start of each session it reads a progress log and a short list of decisions, and before it stops it updates both. The application stores the files, limits their size, and removes old ones.
- **Outcome:** Each session resumes from the recorded state, and the same decisions are not reopened.

**Common misconceptions:**
- **Claim:** A bigger context window is the same as memory.
  **Correction:** A context window holds what the model reads in one call, and it starts fresh on the next call. Memory is stored outside it and read back when needed.
- **Claim:** The model remembers by itself.
  **Correction:** With a memory tool, the model only requests file operations. Your application stores the data, controls where it lives, and decides what is kept or deleted.
- **Claim:** Whatever is in memory can be trusted.
  **Correction:** Memory holds what the agent wrote, which may be stale or wrong. The documentation advises keeping sensitive information out, capping file sizes, expiring old files, and validating every path.

**Visual model (comparison):** The context window is the desk and memory is the filing cabinet. Fetch only what this step needs.

**Visual description:** Two columns compare the context window and memory. The context window holds what the model can read right now and starts fresh on the next call. Memory holds notes stored outside the model, read back when needed, and survives a reset, but needs size limits and cleanup.

**Related concepts:** [Context Window](https://aigarage.in/jargons/context-window), [RAG (Retrieval-Augmented Generation)](https://aigarage.in/jargons/rag), [AI Agent](https://aigarage.in/jargons/ai-agent), [Tool Calling](https://aigarage.in/jargons/tool-calling), [Agent Skill](https://aigarage.in/jargons/agent-skill)

**Last researched:** 2026-10-12

**Sources:**
- [Claude Docs - Memory tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/memory-tool)
- [Anthropic Engineering - Effective context engineering for AI agents](https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents)

**URL:** https://aigarage.in/jargons/agent-memory
