What is a ReAct agent?

Build agents
HoneyHive Engineering

A ReAct agent alternates reasoning and tool actions, feeding each result back into the next step. It comes from a 2022 paper and now runs inside agent frameworks.

A ReAct agent is an LLM that alternates between reasoning about a task and taking an action, such as a search or a tool call, then reads the result before deciding what to do next. The name comes from “Reasoning and Acting” and a 2022 paper by Yao and colleagues. It has nothing to do with React, the JavaScript library.

For the wider picture, see what are AI agents and what is an agentic workflow.

What the paper proposed

The ReAct paper (first posted 6 October 2022, camera-ready version March 2023) has the model generate reasoning traces and task-specific actions in an interleaved way. The authors say the reasoning helps the model “induce, track, and update action plans as well as handle exceptions,” while the actions let it query outside sources such as knowledge bases or environments.

The project page describes the prompts as few-shot trajectories that mix human-written reasoning traces, actions and the observations the environment returns.

The authors reported:

  • On HotpotQA and FEVER, using a Wikipedia API, ReAct reduced the hallucination and error propagation seen with chain-of-thought prompting (project page).
  • On ALFWorld and WebShop, it beat imitation and reinforcement learning methods by an absolute success rate of 34% and 10%, using only one or two in-context examples (arXiv).

The loop

Every ReAct agent runs the same cycle:

  question
     |
     v
  reason: what do I need next?
     |
     v
  act: call a tool or search
     |
     v
  observe: read the result
     |
     +--> need more? back to reason
     |
     v
  final answer

Anthropic describes agents as “typically just LLMs using tools based on environmental feedback in a loop.” It says the agent must get “ground truth” from the environment at each step, and that it is common to add stopping conditions such as a maximum number of iterations.

How current frameworks run it

The 2022 paper relied on prompt examples. Today the loop is built into provider APIs and frameworks, and their docs mostly do not call it ReAct.

Source How it describes the loop
LangChain An agent is “a model calling tools in a loop until a given task is complete”. The prompt, tools and middleware around it are the harness.
LangGraph An LLM node, a tool node and a conditional edge that continues “based upon whether the LLM made a tool call”. See LangGraph.
OpenAI Agents SDK If the model produces tool calls, “we run those tool calls, append the results, and re-run the loop”. A run ends on text output with no tool calls, or raises MaxTurnsExceeded past max_turns. See OpenAI Agents SDK.

The shared pattern: call the model, run the tools it asks for, append the results, repeat until it stops asking.

Where the reasoning went

In the paper the “Thought” was text the model wrote in the prompt format. Model providers now offer it as a feature. Claude’s interleaved thinking lets the model think between tool calls in one turn, “reasoning about each tool result before determining what to do next.” On models that support adaptive thinking this happens automatically, while Claude Haiku 4.5 does not support it (Anthropic docs; that page marks manual extended thinking as a legacy feature that Claude 4.7 and later models reject).

This changes what you handle. Gemini’s docs say that in stateless mode you must resend thought blocks exactly as received (Google docs). A hand-rolled ReAct loop therefore needs to preserve reasoning data as well as tool results. Check your provider’s rules before writing your own loop.

Limits

A summary of the paper in the Prompting Guide lists several:

  • The fixed structure limits how flexibly the model can phrase its reasoning steps.
  • Results depend on retrieval quality, and uninformative search results can derail reasoning.
  • ReAct trailed chain-of-thought on HotpotQA in the paper’s experiments, and the best results combined the two.

Because the model decides when to stop, Anthropic advises stopping conditions such as a maximum number of iterations, and the OpenAI SDK enforces one through max_turns.

ReAct agent or workflow?

A ReAct agent is a case of the “agent” side in Anthropic’s split: the model picks each next step. If the steps are known in advance, Anthropic says a workflow gives more predictability and consistency. How to build AI agents covers that choice, and few-shot prompting covers the prompt technique the original paper used.

Tracing a ReAct loop

Each pass through the loop is a model call plus zero or more tool calls, so a run is a sequence of spans. A trace that records each model call, tool call and result shows which step went wrong; see agent observability.

HoneyHive traces LangGraph graphs, node transitions and LLM calls; setup is in the HoneyHive LangGraph integration docs.

Related: chain-of-thought prompting.

FAQ

What does ReAct stand for?

Reasoning and acting. The 2022 paper title is "ReAct: Synergizing Reasoning and Acting in Language Models". It is unrelated to React, the JavaScript UI library.

Is a ReAct agent the same as a tool-calling agent?

Mostly the same loop. Both call a model, run the tools it requests, append the results and call the model again. Current docs such as LangChain's describe this loop without using the name ReAct. The difference is the interface, since ReAct was a prompting format and tool calling is an API feature.

When does a ReAct agent stop?

When the model answers without requesting a tool. Frameworks add a cap as well. The OpenAI Agents SDK raises MaxTurnsExceeded when a run passes max_turns.

What are the limits of ReAct?

A summary of the paper in the Prompting Guide lists a rigid structure and dependence on retrieval quality, where uninformative search results can derail reasoning.

Share