Learn AI Math

Agent Memory

What is Agent Memory?

In one sentence: Agent memory is how an AI agent stores and recalls information across steps or sessions.

Short-term memory holds the current task's details in context; long-term memory saves facts, past results or preferences in a database for later.

What does Agent Memory look like?

An agent remembering that you prefer aisle seats when booking flights next month uses agent memory.

Why does Agent Memory matter?

Memory lets agents learn from past work and act more personally.

Agent Memory vs. Context Window

The context window is temporary working RAM for the current conversation turn, whereas agent memory persists facts, preferences, and past episodes across sessions in external storage.

DimensionAgent MemoryContext Window
LifespanPersists across days, sessions, and tasksCleared when you start a new chat
CapacityPractically unlimited in a database or filesBounded (e.g., 128K–1M tokens) and billed per turn
Human analogyYour notebook and long-term memoryWhat you hold in short-term attention right now

Last updated · Fact-checked by The AI Math

Linking to this page from a lesson or article?

Like this explanation? Get one every week.

The AI Math newsletter turns confusing AI news into plain English. No hype, no jargon walls.