---
title: ReAct (Reason + Act) — Prompt Engineering Technique
description: 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.
canonical: https://prompeteer.ai/techniques/react
category: Agentic & tool use
---

# 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.

## What it is

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

- 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.

## 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

- 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

- [Yao et al. (2022), ReAct: Synergizing Reasoning and Acting in Language Models](https://arxiv.org/abs/2210.03629)
- [Anthropic — Tool use (function calling)](https://docs.anthropic.com/en/docs/build-with-claude/tool-use)

## Related techniques

- [chain-of-thought](https://prompeteer.ai/techniques/chain-of-thought)
- [prompt-chaining](https://prompeteer.ai/techniques/prompt-chaining)
- [retrieval-augmented-generation](https://prompeteer.ai/techniques/retrieval-augmented-generation)
