ReAct (Reason + Act)

Category: Agentic & tool use

ReAct interleaves reasoning traces with tool actions, letting a model think, act, observe the result, and think again. This loop grounds reasoning in real information and reduces hallucination on tasks needing external data.

What it is

ReAct (Reason + Act)

ReAct ("Reasoning and Acting") is a prompting pattern that has the model alternate between generating reasoning ("thoughts") and taking actions such as calling a search tool or an API, then observing the returned result before continuing. Yao et al. showed that combining reasoning with acting outperforms either alone on knowledge-intensive and decision-making tasks.

By grounding each reasoning step in fresh observations from the environment, ReAct lets the model plan, gather missing information, correct course, and avoid the closed-loop hallucination that pure chain-of-thought can suffer when it lacks facts. It is the conceptual backbone of many modern tool-using agents.

When to use

How it works

  1. Define the available tools/actions and the format for invoking them.
  2. Prompt the model to emit a Thought (reasoning) then an Action (a tool call).
  3. Execute the action and feed the Observation (result) back into the context.
  4. Repeat Thought → Action → Observation until the model emits a final answer.

Illustrative structure

The structure is a repeating trace: "Thought: <reasoning about what to do next> / Action: <tool>[<input>] / Observation: <result>" — looping until the model outputs "Answer: <final response>". The scaffold defines the tool grammar; the model fills the thoughts and actions.

Pitfalls

Frequently asked questions

What is ReAct (Reason + Act)?

ReAct interleaves reasoning traces with tool actions, letting a model think, act, observe the result, and think again. This loop grounds reasoning in real information and reduces hallucination on tasks needing external data.

When should you use ReAct (Reason + Act)?

The task needs information the model does not hold: live data, private documents, calculations. You are building a tool-using or agentic workflow (search, code execution, APIs). The model must plan, act, observe, and adapt over several steps. You want reasoning grounded in verifiable observations rather than the model's memory alone.

What are common pitfalls of ReAct (Reason + Act)?

Requires an execution harness to run tools and inject observations — more infrastructure than plain prompting. Malformed action syntax breaks the loop; the format must be strict and validated. Loops can run away or repeat; enforce a step limit and stopping condition. Tool errors and noisy observations can derail reasoning if not handled gracefully.

Sources

Related techniques

← All prompt engineering techniques

Apply ReAct (Reason + Act) with Prompeteer, the Agentic Contextual AI Platform →