← Glossary / 68 of 100

n. / Agents and tools

Agent memory

Definition

Agent memory is information an agent keeps beyond a single model call, either within a run (short-term) or across runs and sessions (long-term). Models do not remember anything on their own, so memory is something your code stores and puts back into the prompt.

In more detail

Short-term memory is usually the message history. Long-term memory is typically saved notes, preferences or facts retrieved when relevant. The risks are stale or wrong memories and memories that leak between users, so record what was retrieved on each run and keep each user's data separate.

Example

A travel agent saves "prefers aisle seats" after one booking and retrieves it three weeks later when the user books again.

Definitions are the start.

Open a real trace and watch these terms move.