
What Is ReAct Prompting and How the Thought–Action–Observation Loop Gives LLMs the Ability to Act
ReAct prompting interleaves LLM reasoning with real-world tool calls. Published at ICLR 2023, it improved agentic task success rates by up to 34%.
This topic is curated by our AI council — see how it works.
Every coding agent, research assistant, and tool-using chatbot shipped since 2023 owes its control structure to ReAct prompting — one of the four core patterns that turn a single LLM call into a system that keeps working once you’re gone. Get the loop wrong and an agent burns budget on redundant tool calls or stalls entirely; get it right and it recovers from a bad search result the way a developer would, by trying something else. That is the practical stake behind the prompt engineering theme’s core-patterns tier, and it is why understanding the loop still matters even now that most frameworks hide it behind a native tool-calling API.
Start with what ReAct prompting is and how the Thought-Action-Observation loop gives LLMs the ability to act — it is the one article in this topic allowed to explain the mechanism, and everything downstream assumes you have read it. Follow immediately with the prerequisite concepts and failure modes explainer: it maps what breaks before you write a single line of agent code, which is cheaper to learn from a page than from a production incident.
Once the mechanism and its limits are clear, the Python build guide turns them into a working loop and gives the decision framework for when a plain function call beats the extra reasoning step. For where the pattern actually landed, ReAct in the wild tracks how coding agents absorbed the loop into their API contracts rather than retiring it. Close with the accountability risks of ReAct-based agents acting without consent before you let one take an irreversible action in production.

Three confusions recur once teams start building agent loops.
ReAct is not the same decision as native function calling. Function calling lets a model emit a structured call in one shot; ReAct wraps that call inside an explicit reasoning step before and after it. The two are not exclusive — the production pattern in the build guide is hybrid: a fast function call for a simple lookup, a full ReAct loop only when the next step actually depends on what the last tool returned.
ReAct and prompt chaining are not rivals to pick between. Production pipelines increasingly nest one inside the other: a chain handles the stages you can fix in advance, and a ReAct loop takes over for the one stage where the right next tool depends on what just came back. Treating them as an either/or choice is what leads teams to over-engineer a chain into handling runtime branching it was never built for.
ReAct is not tree of thoughts with tools bolted on. Tree of thoughts explores several hypothetical reasoning branches and scores them before committing to one — none of it touches a real system. ReAct commits to one action per cycle and only finds out if it was right when the environment responds. Confusing the two produces agents that either burn compute exploring branches nobody asked for, or systems that expect a single ReAct call to plan the way a full search would.
Q: Can a prompt chain and a ReAct loop run in the same pipeline, or do you have to choose one? A: They compose rather than compete — the production pattern in the build guide chains fixed stages together and drops into a ReAct loop only for the one step whose next move depends on a tool’s response. Most real agents mix both rather than picking a single pattern outright.
Q: When does tree of thoughts beat a ReAct loop for a reasoning problem? A: When the problem needs several hypothetical paths compared before any real action, and scoring a partial answer is cheap — tree of thoughts explores those branches without touching a live tool. ReAct is the better fit once the next step genuinely depends on what an external system returns, not on further internal deliberation.
Q: Why does a ReAct agent keep calling the same tool with slightly different inputs instead of stopping? A: Because nothing told it when to stop — the prerequisite failure-modes explainer documents this as one of four recurring breakdowns, and the fix is an explicit termination condition, not a smarter model.
Q: How often do adversarial attacks actually succeed at hijacking a deployed ReAct agent’s actions? A: In one controlled study probing thirty deployed agents with over a thousand attack attempts, roughly one in four succeeded under standard conditions — nearly double with a reinforced attack, a rate the consent and accountability risks piece argues most deployments aren’t governed for.
Part of the prompt engineering theme · closest neighbour: prompt chaining.
ReAct Prompting structures LLM outputs as a repeating Thought–Action–Observation loop, giving the model a way to reason, act on external tools, and correct course rather than producing a single static response.
Concepts covered

ReAct prompting interleaves LLM reasoning with real-world tool calls. Published at ICLR 2023, it improved agentic task success rates by up to 34%.

ReAct pairs reasoning with tool calls in a loop. Context rot, exemplar mismatch, and token growth are failure modes that break agents on multi-step tasks.
The guides here cover implementing a ReAct loop from scratch, choosing between a hand-rolled pattern and native function calling, and the trade-offs that decide which approach fits a given use case.
Tools & techniques

ReAct agents chain Thought-Action-Observation until a task resolves. LangGraph 1.2.6, Pydantic AI 2.0.0, decision rules for ReAct vs native function calling.
Native tool calling has absorbed many ReAct use cases, but understanding the pattern remains essential for debugging agent behavior and evaluating whether newer abstractions actually solve the underlying problem.
Models & benchmarks
Updated August 2026

ReAct wasn't deprecated — it was absorbed into API contracts. LangChain AgentExecutor enters maintenance mode in 2026. LangGraph is the active ReAct path.
ReAct-based agents can take irreversible external actions without explicit user consent at each step—understanding where accountability sits and how to constrain action scope is essential before deploying these systems.
Risks & metrics

ReAct agents take real-world actions without consent. Prompt injection succeeds in roughly one quarter of attempts. No accountability framework closes the gap.