What is the ReAct pattern in AI agents?
The ReAct pattern combines language model reasoning with actions, using observations returned by external tools to guide the next steps of the task at hand.
The ReAct pattern is a way to organize a language model's work by interleaving reasoning expressed in text with actions, using the results to guide subsequent steps. Its name combines reasoning and acting: the model can formulate a thought, request an action such as a search, and receive an observation (the result the environment returns). The original paper by Yao and colleagues describes both a regular thought-action-observation loop and tasks where thoughts appear only when needed. The model can therefore adapt its search to what it finds instead of relying only on information already available to it. A tool's result can still be incomplete or wrong, so the loop does not guarantee a correct answer. ReAct describes how a task proceeds; it does not itself decide which systems are accessible or which operations the agent is authorized to perform.
See also: Agent harnessAn agent harness is the software scaffolding around an LLM that makes it an agent: the execution loop, the tools, the context and the limits you give it.
What it adds to chain-of-thought
Chain-of-thought has the model write out intermediate reasoning steps; in the study introducing it, the prompt includes a few examples solved step by step. ReAct adds interaction with an external environment: through tool calling, the model asks for a tool to run and gets back a result to work from. A search may miss the right source, and returned information may be out of date.
Which approach fits depends on the task; neither wins across the board. In the original paper, on the HotpotQA question-answering benchmark with PaLM-540B, ReAct matches the reference answer exactly in 27.4% of cases, versus 29.4% for chain-of-thought alone; on the FEVER fact-checking benchmark it achieves 60.9% accuracy versus 56.3%. These are results from those experimental conditions, not forecasts for other models or company data. A fixed procedure may suffice when the required checks are already known; the loop is worth evaluating when the next check depends on the previous result.
An enterprise example
In a hypothetical example, an employee asks whether a customer has an active contract. The agent queries the CRM and finds an expired contract, then checks the billing system for a renewal. If that system does not respond, the agent flags the check as incomplete rather than concluding no renewal exists. Queries are restricted to authorized data, and any contract change requires separate approval.
A log of requests, responses, and sources used lets a reviewer reconstruct the sequence. A model-generated explanation, however plausible, does not by itself prove that the decision is correct or that every check was performed.
Why it matters for decision makers
Before purchasing or deploying a system, compare the loop with a simpler procedure on real cases, measuring correct answers, time, cost, and unnecessary actions. Settle the retry limit, what happens when a tool fails, and who can authorize actions that change data: the agent harness enforces these limits rather than the prompt, while deciding when to restart the agent on new work is a matter of loop engineering.
A tool result can contain malicious instructions: the InjecAgent benchmark measured these attacks on agents with tools, including ReAct-prompted agents. Agents need narrow permissions, independent checks on actions, and controls on outbound confidential data; a visible trace does not replace them.
Frequently asked questions
Related terms
- Agent harnessAn agent harness is the software scaffolding around an LLM that makes it an agent: the execution loop, the tools, the context and the limits you give it.
- Tool calling (function calling)Tool calling lets a language model propose an external function call and its arguments; the application runs it or, for built-in tools, the model provider does.
- Prompting, ICL and Chain of ThoughtPrompting, ICL, and chain of thought guide a language model with instructions, examples, and intermediate steps without changing its learned parameters.
- Loop engineeringLoop engineering designs systems that launch AI agents in place of a person, with triggers, checks, spending limits, and points where a person steps in.
- Task decompositionThe process by which an agent breaks a complex goal into smaller sub-goals before acting.