insideout Get Pro

04 · What an agent remembers

Pro

Agents, lesson 4

What an agent remembers

State within a task, and memory across tasks.

You know the agent loop, and that your code resends the whole history on every turn ("Observe, decide, act").

Part 1. The model remembers nothing

Every call to a model starts from zero. On turn 5 of a run, the model knows what happened on turn 1 only because your code sent turn 1 again, along with turns 2, 3 and 4. Stop sending them and they never happened, as far as the model can tell.

Your turn

Your agent is on step 12 of a task when the server restarts. The history was only in a Python list in memory. What happens?

The model keeps nothing between calls, and the list died with the process. Any refund already issued or file already written did happen, but the new run doesn't know that. This is why long agent runs save their state somewhere that survives a restart.

Stateless

A model call is stateless: it depends only on what you send in that call. All memory in an agent is something your code keeps and decides to send.

Part 2. Three places to keep things

Keep going with Pro

You've done the first part. Pro opens the rest of this lesson, and every other one.

Still to come
  1. Three places to keep things
  2. State your code keeps
  3. Writing and recalling long-term memory
  4. Choosing what comes back

Agents overviewSpotted a mistake? Tell us.