- 1Tool execution: the orchestrator runs the requested tool and captures its return value.
- 2Action: the model emits a tool call (function name + arguments) based on the thought.
- 3Thought: the model emits a reasoning step about what to do next given the current state.
- 4Observation: the result of the tool call is appended to the model's context.
One ReAct iteration runs Thought, then Action, then Tool execution by the orchestrator, then Observation appended back to context for the next iteration.
Picture a detective at a desk. First they think out loud about what they need to know next. Then they hand a note across the desk asking for a specific file. An assistant walks off, fetches the file, and brings it back. The detective glances at what the assistant returned, then thinks again. That cycle (think, ask, fetch, look) is one round of detective work. A ReAct agent does the same four moves in the same order. The model is the detective, the orchestrator is the assistant, the tool call is the note, and the observation is the file coming back.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Concept explanation~2 min read
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
ReAct is one of the most-cited agent patterns in production LLM engineering, and it gets blurred in conversation. People say ReAct when they mean any agent loop, and they say agent when they mean any prompt that calls a tool. The clarity question this stem asks (what is the precise order of the four phases in one iteration) is actually the same as the clarity question that separates a working agent from a stuck one.
The pattern came out of the 2023 Yao et al. paper, where the authors observed that interleaving verbalized reasoning with tool actions improved both reasoning-heavy and action-heavy benchmarks. The mechanism is simple. The model writes a Thought line before each Action, that Thought becomes part of the next attention pass, and the model is shaped by its own previous reasoning when it picks the next move.
This deep dive walks through each phase, who owns it, what it produces, and how modern hosted runtimes (LangGraph, OpenAI Assistants, Claude tool-use) implement it. By the end you should be able to debug a loop that stalls and tell which phase is broken.
Thought: the model verbalizes intent
The Thought phase is the model writing one or two sentences about what it wants to do next, given the current state. It is unstructured text, prefixed with a marker like Thought: (in raw ReAct) or wrapped in a hidden reasoning block (in some hosted runtimes).
Why verbalize at all? Because the Thought is appended to the context window before the Action is emitted. When the model attends to the input to produce the Action, it attends to its own previous Thought. Multi-step planning improves because the model is conditioned on its own reasoning, not just on the user query and observations.
In pure ReAct, the Thought is part of the assistant's text output and visible in the trace. In modern hosted runtimes, the Thought often migrates into a native structured field (Claude thinking blocks, OpenAI Assistants reasoning traces, LangGraph state) but the architectural role is the same. The Thought phase is where the model decides whether the next move is another tool call or a final answer to the user.
This is also where termination happens. When the model has enough information, the Thought says so and the next emission is a final answer instead of an Action.
Situations where this technique stops working.
2–4 min · Everything important, quickly.
Real products, models, and research that use this idea.
- LangGraph implements the four-phase ReAct loop as graph nodes, with explicit edges for tool execution and observation appending; the framework is built around this exact ordering.
- OpenAI Assistants API runs tool-call loops where the model emits a function call (Thought + Action), the SDK executes it client-side, and the result is posted back as a tool message (Observation).
What an interviewer would ask next. Try answering before peeking at the approach.
QHow does the model decide to stop calling tools?
Thought phase emits a final answer instead of another Action; termination is reinforced by system-prompt rules and an orchestrator-side step counter.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Red flags & common mistakes
The phrases that signal junior thinking. Click to expand.
Putting Action before Thought, or believing the model itself runs the tool instead of just emitting a request the orchestrator interprets and executes.
60 second bullets to scan on the way to the call.
The four phases in order
Which phases the model owns vs the orchestrator owns
Primary sources. Browse if you want the original framing.
Same topic, related formats. Practice these next.