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?
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.
- Three places to keep things
- State your code keeps
- Writing and recalling long-term memory
- Choosing what comes back
Agents overviewSpotted a mistake? Tell us.