Intermediate · Systems
Agent Memory
Visual diagram · Math · (in preparation) · Worked example · 3 difficulty levels.
TL;DR. Information an agent retains beyond the current context window — episodic history, learned facts, preferences, and task state.
Technical Definition
Information an agent retains beyond the current context window — episodic history, learned facts, preferences, and task state.
How it works
Agent memory is the durable counterpart to the ephemeral context window. It is usually layered: working memory (the current window), episodic memory (what happened in past sessions), semantic memory (stable facts and user preferences), and procedural memory (learned routines or successful tool sequences). A memory system needs a write policy (what is worth remembering), an indexing scheme (usually embeddings plus metadata), a retrieval policy (what to surface now), and a forgetting policy — without decay or contradiction handling, memory degrades into a slowly poisoning store of stale beliefs.
Visual Explanation (layers)
Working memory (context window) → Episodic store (session logs) → Semantic store (facts, preferences) → Procedural store (routines)
Related Concepts
- Agentic Context — The full set of information an agent has available when it decides its next action — goals, state, tools, memory, and retrieved data.
- Context Drift — The gradual divergence of an agent's working context from the actual task or world state, degrading its decisions over time.
- Context Retrieval Strategy — The policy that decides what to fetch into context, from where, how much, and when during an agent's loop.
- Persistent Agent Context — Context that survives beyond a single session — durable goals, preferences, project state, and accumulated knowledge.