---
title: "What is a ReAct agent? The reason and act loop"
description: "A ReAct agent alternates written reasoning, tool actions, and observations in a loop. See how the ReAct pattern works and how it compares with tool calling."
type: "glossary-term"
canonical_url: "https://theaiengineering.com/glossary/react-agent"
markdown_url: "https://theaiengineering.com/glossary/react-agent.md"
topic: "AI agents"
author: "The AI Engineering Editors"
publisher: "The AI Engineering"
updated: "2026-11-06"
keywords: ["ReAct agent","ReAct","ReAct prompting","reason and act"]
citation: "The AI Engineering Editors. \"What is a ReAct agent? The reason and act loop.\" The AI Engineering, updated Nov 06, 2026. https://theaiengineering.com/glossary/react-agent"
---

# What is a ReAct agent? The reason and act loop

Also called ReAct, ReAct prompting, reason and act.

> **Definition of ReAct agent:** A ReAct agent is an AI agent that alternates a written reasoning step, an action such as a tool call, and an observation of the result, repeating the cycle until it can answer.

A ReAct agent is an [AI agent](https://theaiengineering.com/glossary/ai-agent) that cycles through three steps: a thought, an action, and an observation. The pattern comes from [ReAct: Synergizing Reasoning and Acting in Language Models](https://arxiv.org/abs/2210.03629) (Yao et al., 2022), which prompted a language model to write free-form reasoning between actions such as Wikipedia searches. The written reasoning lets the model plan, track progress, and change course when an observation contradicts its plan. Most current agent loops descend from this design, although few still use the paper's text format.

## How a ReAct agent works

A ReAct agent works by repeating a thought, an action, and an observation. The thought states what the model knows and what it should do next. The action calls a tool, such as a search. The observation is the tool's result. All three are appended to the context, and the loop continues until the model emits a finish action.

In the paper, the authors prompted a frozen PaLM-540B model with a few human-written example trajectories: six for the HotpotQA question-answering task and three for FEVER fact checking. The HotpotQA agent had three actions:

```text
search[entity]   returns the first five sentences of the entity's Wikipedia page
lookup[string]   returns the next sentence on the page that contains the string
finish[answer]   ends the task with an answer
```

Thoughts do not touch the environment, so they produce no observation; they only update the context. The authors report that ReAct beat imitation and reinforcement learning baselines by 34 and 10 absolute points of success rate on the ALFWorld and WebShop decision-making tasks. Its documented failures include loops that repeat earlier thoughts and actions, and uninformative searches, which made up 23% of the errors the authors examined.

## ReAct vs native tool calling

ReAct is a prompting pattern, while native [tool calling](https://theaiengineering.com/glossary/tool-calling) is an API feature. The original ReAct agent wrote its actions as plain text that the application had to parse, so one malformed line could break the loop. With native tool calling, the model returns a structured call with JSON arguments, and the API keeps it separate from prose.

| | ReAct prompting (2022) | Native tool calling |
|---|---|---|
| Action format | Text such as `search[entity]`, parsed by the application | A structured call with JSON arguments |
| How the model learns the format | Example trajectories in the prompt | Training, plus tool schemas sent with each request |
| Reasoning step | A written thought before every action | Optional; [reasoning models](https://theaiengineering.com/glossary/reasoning-model) reason internally |
| Typical failure | Action text the parser cannot read | Invalid arguments, caught by schema validation |

The loop itself survives inside modern frameworks. DSPy's [ReAct module](https://dspy.ai/current/api/modules/ReAct/) is documented as an agent that interleaves reasoning and tool calls to fulfill a signature, and it ends when the model calls a `submit` tool or the turn budget runs out. LangGraph's prebuilt agent was named `create_react_agent` until [LangGraph v1](https://docs.langchain.com/oss/python/migrate/langgraph-v1) deprecated it in favor of LangChain's `create_agent`.

## When to use the ReAct pattern

Use the ReAct pattern when a task needs information the model lacks and each step depends on what the previous one found, as in multi-hop question answering. When the steps are known in advance, a fixed workflow is cheaper and easier to test. The written thoughts make runs easier to audit, because every action arrives with a stated reason.

The paper credits that visible reasoning with improved human interpretability and trustworthiness. The authors also tested a fallback to [chain-of-thought](https://theaiengineering.com/glossary/chain-of-thought) self-consistency when ReAct runs out of steps, and concluded that combining the model's internal knowledge with retrieved knowledge helps on reasoning tasks.

The [AI agent frameworks comparison](https://theaiengineering.com/articles/ai-agent-frameworks) shows how current frameworks implement the loop, and [what AI agents are](https://theaiengineering.com/articles/what-are-ai-agents) covers where it fits in agent design.

## Related terms

- [AI agent](https://theaiengineering.com/glossary/ai-agent): An AI agent is a software system in which a large language model runs in a loop, calling tools, reading their results, and repeating until the task is complete or a stop condition is reached.
- [Tool calling](https://theaiengineering.com/glossary/tool-calling): Tool calling is an LLM capability in which the model, given a list of tool definitions, outputs a structured request naming a tool and its arguments, which the application executes and returns.
- [Chain-of-thought prompting](https://theaiengineering.com/glossary/chain-of-thought): Chain-of-thought prompting is a technique that has a language model write intermediate reasoning steps before its final answer, which improves large models' accuracy on arithmetic, commonsense, and symbolic reasoning tasks.
- [Reasoning model](https://theaiengineering.com/glossary/reasoning-model): A reasoning model is a large language model trained, usually with reinforcement learning, to generate intermediate reasoning tokens before its final answer, spending more inference compute to solve multi-step problems.
- [Agentic AI](https://theaiengineering.com/glossary/agentic-ai): Agentic AI is the class of AI systems that pursue a goal through multiple steps, using a language model to plan, call tools, and act on the results with limited human input.

## Guides that cover react agent

- [What are AI agents? How agents work and when to use one](https://theaiengineering.com/articles/what-are-ai-agents): AI agents are LLM systems that call tools in a loop until a task is done. Learn how the loop works, agents vs agentic AI, examples, failure modes, and limits.
- [AI agent frameworks compared: LangGraph, CrewAI, ADK, and more](https://theaiengineering.com/articles/ai-agent-frameworks): An AI agent frameworks comparison of LangGraph, LangChain, CrewAI, the OpenAI, Claude, and Google SDKs, Pydantic AI, Mastra, and more, by language and license.
- [Agentic workflows: five patterns and when to use each](https://theaiengineering.com/articles/agentic-workflows): Agentic workflows run LLM and tool calls through steps fixed in code. Learn five patterns, their cost and latency, failure modes, and when to use an agent.

Part of the [AI agents](https://theaiengineering.com/topics/ai-agents) topic hub.

## Cite this definition

The AI Engineering Editors. "What is a ReAct agent? The reason and act loop." The AI Engineering, updated Nov 06, 2026. https://theaiengineering.com/glossary/react-agent

- Title: What is a ReAct agent? The reason and act loop
- Author: The AI Engineering Editors
- Publisher: The AI Engineering
- Updated: 2026-11-06
- URL: https://theaiengineering.com/glossary/react-agent
- Markdown: https://theaiengineering.com/glossary/react-agent.md
