Agent memory and state

Home Learn Agent memory and state

In short

An AI agent’s memory is information an application saves and later gives back to the model. It may be a short record of task progress or a longer-lived preference. Saving something doesn’t make it accurate or useful forever.

Why it matters

An assistant may appear to remember your style or the last step in a project. That can make repeated work easier, but it can also carry an outdated instruction into the next task. Ask what is kept, where it lives, who can change it, and when it disappears. These are product and workflow decisions, not properties of a model’s personality.

How it works

Short-lived state can hold the current goal, completed steps, a tool response, and a checkpoint for a task in progress. A longer-lived record might store a chosen document format or a glossary that someone approved. At a later step, the application retrieves selected information and places it in the model’s context, the material it can use for its response. That retrieval is a design choice. It does not mean the model retrained itself during your conversation.

Anthropic’s 2025 context-engineering guidance discusses how agents manage limited attention and use external memory or retrieval to supply relevant material. Its 2024 agent guide describes memory as one augmentation to the basic model. Both point toward a practical distinction: the useful question is what the application retrieves for this step, not whether the assistant sounds familiar. Too much irrelevant history can obscure the current task. A stored note can also be wrong because the source changed after it was saved.

Define a lifecycle for every remembered item. Give it a purpose, an owner, a source, an update path, and a deletion or expiry rule. Protect access to the store just as you protect access to the original material. When the assistant uses a remembered fact, let a reviewer see which record supplied it. If a preference conflicts with the current request, the assistant should ask instead of silently following old context. Test what carries from one task to the next using harmless examples.

Example

Illustrative example: this scenario is invented.

Lena, 31, is a freelance designer. She saves an approved preference for square social graphics and a note that one community event uses a blue background. Months later, she begins a different event and asks for a draft layout. The assistant retrieves the square format but presents the blue-background note as specific to the earlier event. Lena keeps the format and rejects the color. A memory that exposes its source makes that decision possible; an unlabelled remembered color could quietly shape the wrong design.

What it doesn’t mean

Memory isn’t a complete diary or a promise that every earlier message will be considered. It isn’t a permission to retain everything a person pastes. A good preference for one project can be a bad default for another. It also isn’t a substitute for checking a current source when dates, policies, or available materials matter.

Try it

Give any assistant two harmless preferences for an imaginary recipe card, one general and one specific to a single event. Then ask it to plan a different event. Note which preference belongs in the new answer and which needs confirmation. Sketch how you would label each saved note with a source, scope, and date before using it again.

Keep going

Sources

Share this page