Nothing sent yet.Turn 0 of 12 · context 0 of 3,000 tokens · 0 tokens in all
Chapter 2 of 7
The loop, and who says done
In chapter 1 the agent coped with a cracked printer that the script could not: it checked the stock and changed course. Nobody wrote its steps down. So what does an agent actually do, turn by turn, and how does it know when to stop?
This chapter: What happens on each turn of an agent, and who decides the case is done?
You will learn
- The loop every agent runs: think, act, observe, decide
- Why each next step depends on what the last result said
- Why the model ends the run, by answering without a call, and the host’s budget is only a backstop
Words you’ll meet (3)
- Turn
- One pass of the model: it reads everything so far, then asks for tool calls or gives its answer.
- Loop
- Turn after turn: the host runs each call the model asks for and sends the result back, until the model answers.
- Step budget
- The most turns the host lets one run take. A rule in the host, not something the model decides.
The picture on the left is live. Each step below asks you to do one thing in it; the story continues here as you go.
Step 1 of 7
In chapter 1 the agent fixed the cracked printer. Now look at how. An agent runs in a loop. Each turn the model reads everything so far and asks for a tool call (think, act). The host runs the call and hands the result back (observe). Then the model decides again. ReAct has a language model write its reasoning steps and its actions interleaved, and the actions let it pull in information from outside sources, such as a Wikipedia API. Before you step through it: