The ReAct pattern: think, act, observe, repeat
ReAct (short for “Reason + Act”) is a way of running a language model in a loop: it writes down what it plans to do, takes an action such as a search or a tool call, reads the result, then decides what to do next. It is the basic engine behind most of today's AI agents.
Data as of October 22, 2026
Key figures
| Level | Advanced |
|---|---|
| Origin | 2022 |
| Introduced by | Yao et al. |
How the loop works
On its own, a large language model only produces text. ReAct gives it a three-beat routine that repeats until the job is done:
- Thought: the model writes out what it has understood and what it intends to do.
- Action: it picks a tool (web search, calculator, file reader) and its arguments, through tool calling.
- Observation: the surrounding program runs the action and feeds the result back, where it joins the model’s context.
The loop ends when the model decides it has enough to answer, or when a limit set by the developer kicks in.
A worked example
Question: “What is the current population of the town where Ernest Hemingway was born?”
- Thought: “First I need Hemingway’s birthplace.” Action: search “Ernest Hemingway birthplace”. Observation: Oak Park, Illinois.
- Thought: “Now I need the latest population figure for Oak Park.” Action: another search. Observation: an official census page.
- Thought: “The page gives a figure and a date; I can answer and cite it.” End of loop.
Without ReAct, the model would answer in one go from memory, risking a hallucination or out-of-date information. With ReAct, each step rests on an observation you can check.
Where it came from
The pattern was introduced in the paper “ReAct: Synergizing Reasoning and Acting in Language Models” (Shunyu Yao et al., October 2022, published at ICLR 2023). It merged two lines of work that had been separate: chain of thought, where a model reasons without touching the outside world, and models that act without spelling out their reasoning. The authors showed that interleaving the two makes answers more reliable and traces easier to read.
Why it matters, and where it falls short
ReAct has become the implicit skeleton of many AI agents and frameworks: even when the name never appears, the “think, call a tool, read the result” loop is there. Its weaknesses are well known. Every turn re-reads the whole history, so token costs climb quickly. One bad observation can send the agent down the wrong path. And an agent that does not know when to stop can go round in circles. That is why variants plan first (task decomposition) or add a self-reflection step.
Common myths
- “The visible reasoning truly explains the decision.” It helps with debugging, but nothing guarantees it faithfully mirrors the model’s internal computation.
- “More iterations are always better.” Past a certain point the agent piles noise into its context and costs more without getting more accurate.
Related terms
- Chain of thought · Getting a model to write out intermediate reasoning steps before its final answer, which helps on multi-step problems.
- Tool calling (function calling) · The ability of an AI model to request that an external function be run with specific arguments, then use the result in its answer.
- AI agent · An AI that does more than answer: it plans and carries out a series of actions with tools to reach a goal you set.
- Agentic workflow · A sequence of steps in which an AI model plans, uses tools, checks and revises its work instead of answering in a single pass.
- Self-reflection · A technique in which a model or agent reviews its own output, critiques the mistakes and uses that critique to try again.
- Hallucination · An AI answer that sounds confident and plausible but is false or made up: a figure, a quote, a source or a reference.
Full glossary
Frequently asked questions
Is ReAct related to the React JavaScript library?
Not at all. The name comes from “Reasoning and Acting”. The overlap with the React UI library is a coincidence, which can make web searches confusing.
Do I have to write the ReAct loop myself?
Rarely. Most agent frameworks and tool-calling APIs already include a loop of this kind. Knowing the pattern still helps you tune iteration limits, the tools you expose and the error messages sent back to the model.
How many steps can a ReAct loop take?
As many as the developer allows. In practice you set a maximum number of iterations or a token budget; otherwise a stuck agent can keep going for a long time and run up a bill.
Do reasoning models make ReAct obsolete?
No, they extend it. A reasoning model thinks harder before each action, but it still has to act, observe the result and adjust, which is exactly the ReAct loop.
Data sources
Data as of October 22, 2026
Report an error
Does a figure, a date or a fact look wrong? Tell us: every report is checked.