Chapter 11: ReAct
Lecture
Chapter principle
Key takeaways
- ReAct alternates decisions, actions, and observations.
- Its value comes from new feedback that can change later decisions.
- The harness needs observable actions, observations, and state transitions; reasoning text, whether ReAct thoughts or hidden reasoning, is optional rather than an interface.
- A structurally valid loop can still ignore evidence or fail to make progress.
- Iterative reasoning adds model calls, cost, latency, and possible failure trajectories.
- Reasoning architectures should be tested against simpler baselines.
Experiments
Every experiment in the book is small, runnable and printed with its real output. In the Lab you can replay a recorded real run of each one, with no programming, and watch what the model and the agent do.
Experiment 22: ReAct: act, observe, decide
Does an agent do better when it sees the result of each action before it decides the next one?
The task: find the current price of item A17, then add 15% VAT. The price exists only in the shop's data, behind a lookup tool, so the model cannot know it in advance. A real model tries three times: with no tools at all; in an agent loop where every tool result is shown to the model before its next decision; and in a broken loop where the lookup runs but its result is never shown. This is a recorded run of a real model. A new run may word things differently.
All the code for this chapter: github.com/agentic-engineering-book/code
Download the bookBrowse all chapters