The ReAct Pattern: Reason, Then Act
You'll learn to
- -Trace the Thought, Action, Observation cycle and say why it grounds each step in a real result
- -Explain why a ReAct agent needs a concrete stopping rule as well as an iteration cap
- -Put a number on a runaway loop
A single tool call answers a single-step question. But "is Drug X more effective than Drug Y for condition Z, according to the latest three meta-analyses?" needs several searches, reading several papers and combining what they say. No single LLM call can do that in one shot. ReAct, short for Reasoning and Acting, is the pattern that turns a model that can use one tool into something that can work through a genuinely multi-step problem.
An Analogy: The Detective
A good detective does not announce the culprit on arrival. They think about what they know and what they still need (thought), go and do something about it, such as interview a witness (action), and look at what came back (observation). Then they think again with that new fact in hand. They stop when they have enough evidence, not when they run out of patience. A ReAct agent does the same.
The Loop: Thought, Action, Observation
Each pass of a ReAct agent has three parts. Thought: the model reasons in plain language about what it knows and what it still needs. Action: the model calls a tool based on that reasoning. Observation: the tool's real result comes back and becomes part of the context for the next thought. This repeats until the model decides it has enough to answer.
You already saw one full trajectory in the previous tier, scheduling a meeting through two tool-call cycles. Here it is again, worth rewatching now that the pattern has a name. Step through it and notice that every action is grounded in the observation just before it, not in the model guessing.
Tracing an Agent's Reason-Act-Observe Loop
Two full tool-call cycles before the agent has enough grounded information to answer.
User
"Schedule a meeting with Sarah next Tuesday at 2pm."
Why the Model Cannot Just Answer Directly
Without this loop, a model asked a multi-step question either refuses or, worse, confidently makes up an answer that sounds as if it did the research without doing any. ReAct forces each step to be grounded in a real tool result before the next thought. That is the difference between "sounds plausible" and "is actually true", the same hallucination concern from Phase 1's bridge chapter, now handled by structure instead of left to hope.
The Loop Must Know When to Stop
Without an explicit stopping condition, a ReAct agent can loop forever: thinking, failing, retrying, thinking again, burning tokens and money the whole time. The Level 30 (The ReAct Loop) case brief is specific. Cap the loop at a fixed number of iterations, commonly around eight for a research-style task, and give the model a concrete criterion for when it has enough, such as "stop once you have at least three sources supporting your conclusion." The demo compares an agent with only a distant safety cap to one with a concrete rule. A new source turns up on every other search, and each pass costs about 1,500 tokens.
Streaming the thoughts themselves, not just the final answer, matters more for agents than for plain chat. Watching an agent's reasoning unfold lets a researcher catch a bad direction early, instead of discovering at the very end that the agent went the wrong way three steps ago.
Interview Signal is part of Pro
See a real weak answer next to a real strong one for this exact topic.
Quiz is part of Pro
Test what you just read with a short quiz, and bank the XP.
Build the Tool Smith and ReAct Loop levels in the GenAI Lab.
Discussion0
Join the Discussion
Sign in to leave comments, reply to others, or like insights.
No comments yet. Be the first to start the thread!