🗓️ 19092026 2037

AGENT MEMORY AND STATE

State is information an agent needs while doing work. Memory is state kept long enough to reuse later. Without either, each model call starts with only its current input.

Three useful scopes​

ScopeWhat it holdsExample
In-call contextRequest, instructions, and tool resultsA model deciding its next action
Session stateProgress across one workflowCompleted steps and pending tasks
Persistent memoryReusable facts or past outcomesA user preference or a project record

Keep state outside the model when it must be reliable, queryable, or durable. The model's context window is useful working space, not a database.

Practical rule​

Store only information that changes a future decision. Retrieve it deliberately. Old or irrelevant memory can distract the model, cost tokens, and expose private data.

For a single task, short-lived context is usually enough. A coordinator keeps shared workflow state; an agent-as-tool design keeps it with the primary agent. See agentic_design_patterns.

References​