The ReAct agent pattern is a way of building language-model agents that reason and act in turn, rather than doing one and then the other. A ReAct agent thinks in plain language, takes an action such as searching a knowledge base, reads what comes back, and then thinks again. That loop of thought, action and observation is the whole pattern, and it is the foundation of most tool-using agents built today.
ReAct was introduced in a 2022 paper by researchers at Princeton University and Google Research, titled “ReAct: Synergizing Reasoning and Acting in Language Models”. The paper showed that interleaving reasoning traces with task-specific actions lets a language model create and update plans, handle exceptions, and ground its answers in external information instead of relying only on what it memorised during training. It remains one of the most cited ideas in agent design.
Key takeaways
- ReAct interleaves reasoning traces (Thought), actions (Action) and environment feedback (Observation) in a repeating loop.
- Reasoning helps the model plan, track progress and handle exceptions; acting lets it gather fresh information from tools and environments.
- It is a prompting pattern, not a training method: a frozen model is guided by a few example trajectories.
- The paper evaluated ReAct on question answering, fact verification and interactive decision-making tasks, where it outperformed reasoning-only and acting-only approaches.
- The loop is transparent by design, which makes ReAct agents easier to debug and trust than agents that act without explaining themselves.
What the ReAct Pattern Is
Before ReAct, reasoning and acting were usually studied separately. Chain-of-thought prompting showed that language models reason better when they generate step-by-step reasoning before answering, but that reasoning was ungrounded: the model could reason fluently towards a wrong fact and never notice. Acting-only approaches let models call tools and follow plans, but without reasoning traces they struggled to decompose goals, track progress or recover from errors.
ReAct combines the two by expanding the model’s action space to include language itself. At each step, the model can either emit a reasoning trace, which changes only its own internal state, or take an action in the environment, which returns an observation. The trajectory looks like this: a thought about what to do next, an action such as searching for an entity, an observation with the search result, another thought that interprets the result, and so on until the model takes a finishing action with the answer.
The model decides for itself, token by token, when to think and when to act. That self-direction is what makes the pattern flexible. In a knowledge-heavy task, the model may alternate thought and action at every step. In a decision-making task with many actions, reasoning traces can appear sparsely, only at the points where a plan needs to be made or revised. The prompt examples teach the rhythm; the model supplies the judgement.

The Thought, Action, Observation Loop
Each element of the loop has a distinct job. The thought is where the model decomposes the goal into sub-goals, injects commonsense knowledge, extracts the important parts of an observation, tracks progress, and handles exceptions by adjusting the plan. A thought does not change the world; it changes what the model will do next. That is why thoughts are the planning mechanism of the pattern.
The action is where the model touches the outside world. In question answering, actions might be searching for an entity, looking up a passage, or finishing with an answer. In a household navigation task, actions might be going to a room, opening a container, or picking up an object. The action space is defined by the environment, and the prompt examples show the model which actions exist and how to format them.
The observation is the environment’s reply: a search result, a page of text, or a description of what the agent now sees. Observations ground the reasoning that follows. If the model thought a fact was true and the observation contradicts it, the next thought can correct course instead of compounding the error. That grounding is the main reason ReAct reduces hallucination compared with reasoning alone. Our article on what AI agents are and how they work gives useful background on the agent loop that ReAct formalises.
A Worked Example
Take a multi-hop question such as: which film was directed by the person who wrote a particular novel? A ReAct agent might begin with a thought: I need to find who wrote the novel, then find which film that person directed. Its first action searches for the novel’s author. The observation returns the author’s name. The next thought notes the author and plans a search for their films. The next action searches for the author’s filmography, and the observation returns the list. A final thought picks the matching film, and the finishing action gives the answer.
Each step is small and checkable. If the first search returns the wrong author, the error is visible in the trajectory and the next thought can catch it. If the model had reasoned without acting, it would have had to recall both facts from memory, and a wrong recall would have flowed silently into the answer. The loop trades a little extra computation for a large gain in verifiability.
Why ReAct Works So Well
The paper’s central claim is synergy: reasoning helps acting, and acting helps reasoning. Reasoning helps acting because a plan tells the model which action to take and why, and because thoughts can decompose a goal into steps that map onto available actions. Acting helps reasoning because observations bring in information the model does not have, correcting wrong assumptions before they become wrong answers.
That synergy shows up in the results. On question answering (HotpotQA) and fact verification (FEVER), ReAct overcame the hallucination and error-propagation problems of chain-of-thought reasoning by interacting with a simple Wikipedia API. On two interactive decision-making benchmarks, ALFWorld and WebShop, ReAct outperformed imitation and reinforcement learning methods by an absolute success rate of 34% and 10% respectively, while being prompted with only one or two in-context examples. Those numbers come from the original paper and describe its experimental setup, not a guarantee for every deployment.
Interpretability is the other half of the value. A ReAct trajectory reads like a human solving the task: thoughts in plain language, actions that are visible, observations that are checkable. That makes failures diagnosable. When an agent fails, you can read the trajectory and see whether the plan was wrong, the action was wrong, or the observation was misread. For teams that need to explain agent behaviour to users or auditors, that readability is a feature, not a nicety.
Where ReAct Struggles
ReAct is not free of weaknesses. The loop is sequential, so every action waits for the previous observation, and a long task can mean many model calls. Token usage grows with the trajectory, because every thought, action and observation stays in the context. For tasks with dozens of steps, that cost adds up, and it is one reason later patterns such as ReWOO plan the whole task up front instead.
The pattern is also sensitive to the quality of its examples. ReAct is implemented with few-shot in-context examples, typically one to six human-written trajectories, and the model follows the format it is shown. Poor examples teach poor habits: vague thoughts, wrong action formats, or missing finishing steps. Writing good example trajectories is a real skill, and it is where most of the effort in a ReAct implementation goes.
Errors can still compound. A wrong thought can lead to a wrong action, and a misleading observation can send the reasoning off track. ReAct reduces error propagation compared with reasoning alone, but it does not eliminate it. Guardrails help: limit the number of loop iterations, validate action arguments before executing them, and check the final answer against the observations it claims to rest on. Our guide to building agents that recover from failure covers those guardrails in detail.
ReAct in Modern Agent Frameworks
Almost every modern agent framework implements ReAct, or something descended from it. LangChain’s early agent executors were explicitly ReAct agents, with a prompt that defined the Thought, Action and Observation format and a parser that split the model’s output into steps. LangGraph, CrewAI and similar frameworks have moved towards graph-based orchestration, but the underlying loop is the same: reason, act, observe, repeat.
The pattern also survives in fine-tuned form. The original paper explored fine-tuning smaller language models on ReAct-format trajectories generated by a larger prompted model, reducing the need for large-scale human annotation. That idea has since become standard practice: collect trajectories from a strong model, fine-tune a smaller one on them, and deploy the smaller model for the same loop at lower cost.
| Approach | How it works | Strengths | Weaknesses |
|---|---|---|---|
| Reason only (chain-of-thought) | Model generates reasoning steps, then answers from memory | Simple, no tools needed | Hallucinates facts, errors compound silently |
| Act only | Model generates actions without reasoning traces | Direct, fewer tokens per step | Cannot plan, track progress or handle exceptions |
| ReAct | Interleaved Thought, Action and Observation loop | Grounded, interpretable, handles exceptions | Sequential, token-heavy, sensitive to examples |
| Plan-and-execute variants | Full plan first, then execute with replanning | Fewer model calls, clearer structure | Plan can go stale if the world changes |
Decision Framework: When to Use ReAct
ReAct is the right default for most tool-using agents, but it is not the right choice for every task. Use this framework to decide.
- Use ReAct when the task needs external information, the number of steps is uncertain, or the agent must adapt to what it finds. Research, investigation, troubleshooting and multi-hop question answering all fit.
- Use ReAct when you need to explain or audit the agent’s behaviour. The readable trajectory is the audit trail.
- Consider a planned pattern instead when the steps are known in advance and the environment is stable. A full plan up front uses fewer model calls and is easier to validate.
- Consider a simpler approach when the task needs no tools at all. If the answer comes from the model’s own knowledge and a single reasoning pass, chain-of-thought is enough.
- Add guardrails in every case: a maximum iteration count, argument validation on tool calls, and a check that the final answer is supported by the observations.
Frequently Asked Questions
Is ReAct a framework or a prompting technique?
It is a prompting technique. The original paper used a frozen model, PaLM-540B, guided by few-shot in-context examples. Modern frameworks implement the same loop in code, but the idea itself is a prompt pattern, not a library.
How is ReAct different from chain-of-thought?
Chain-of-thought generates reasoning only, then answers from memory. ReAct interleaves reasoning with actions that fetch information from the environment, so the reasoning is grounded in observations rather than recall alone.
Does ReAct require training?
No. The standard implementation is few-shot prompting with one to six example trajectories. The paper also explored fine-tuning smaller models on ReAct trajectories, but that is optional.
What tools can a ReAct agent use?
Any tool the environment exposes. In the paper, the main tool was a Wikipedia API with search, lookup and finish actions. In practice, ReAct agents use search engines, databases, calculators, APIs and any other tool the task needs.
Why is ReAct so widely used?
Because it is simple, general and transparent. The loop works across tasks, needs no training, and produces trajectories that humans can read and debug. Most agent frameworks are built on it or on a close descendant.
What is the biggest mistake when implementing ReAct?
Writing poor example trajectories. The model copies the format and habits it is shown, so vague thoughts or sloppy action formats in the examples become vague thoughts and sloppy actions in the agent. Invest the effort in good examples.







