From Answer to Action
Everything so far produces text. An agent uses that text to do things: call tools, read results, decide what to do next, and repeat until the job is done. This is the same agent loop from chapter 0 — now with a language model inside it.
ReAct: think, act, observe
The pattern that made agents work is ReAct (Reason + Act): interleave the model’s reasoning with tool calls. The model writes down what it intends, calls a tool, reads the result, and reasons about it. Every step is appended to the context window — the model’s working memory — so it can act on what it has learned.
Planning
Some agents plan first and execute after. Planning ranges from a simple to-do list the model updates, to tree search over possible action sequences, to decomposing a goal into subgoals. Plans are useful and unreliable: a plan made before touching the world is often wrong, which is why the best agents interleave planning with execution.
The essential insight is that the model is not just generating an answer. It is generating the next step of a process, and the process feeds back into it.
Why agents are hard
Errors compound. Ten steps at 95% each is a 40% chance of a mistake somewhere. Context fills up. Tools fail. The model misreads an observation and confidently proceeds. Reliability, not intelligence, is the bottleneck.