Glossary

ReAct agent

An AI agent that alternates between reasoning about a task and taking actions with tools, using each result to decide its next step until it can answer.

A ReAct agent is an AI agent that alternates between reasoning and acting: it writes a short thought about what to do next, takes an action such as a search or an API call, reads the result, and repeats until it can answer. The name comes from “reasoning and acting”, introduced in a 2022 research paper by Yao and colleagues, and the pattern is the basis of most modern agent loops.

How the ReAct loop works

Each cycle has three parts. In the thought step, the model reasons in plain text about the task and what it still needs, much like chain-of-thought prompting. In the action step, it chooses a tool and its arguments. In the observation step, the tool’s output is added to the context, and the model reasons again with that new information.

Step

What the model produces

Example

Thought

Reasoning about what is known and what to do next

I need the contract’s renewal date before I can answer

Action

A tool call with arguments

search(“renewal date Acme contract”)

Observation

The tool’s result, added to context

Clause 9.2, page 14: renews on 1 March unless cancelled

Answer

A final response once enough is known

The contract renews on 1 March, per clause 9.2

The value of the pattern is that each action is grounded in reasoning and each piece of reasoning is grounded in real observations. Reasoning alone can drift into hallucination; acting alone, without a plan, wastes calls. Interleaving the two lets the agent adjust its plan as evidence comes in, which suits multi-hop retrieval and other tasks where the next question depends on the last answer.

ReAct today

The original ReAct used a single prompt that asked the model to write Thought, Action and Observation lines as text, which the application then parsed. Modern agents keep the idea but use native function calling for the action step, so tool calls arrive as structured data instead of parsed text. Reasoning models often do the thought step internally before choosing a tool. Most agent frameworks offer a ReAct-style agent as their default.

ReAct is also the base for other patterns. Agentic RAG is ReAct with retrieval as the main tool. Self-correction and reflection add a step where the agent reviews its own output. Plan-and-execute designs move more of the thinking up front through agent planning, then run the steps with less reasoning between them, which can cut cost on predictable tasks.

Limits of ReAct agents

ReAct agents can loop, repeating the same search when results are poor, so production agents cap the number of steps. Every thought and observation stays in the context window, so long runs grow expensive and suffer from context rot; keeping tool results short and offloading notes to an agent scratchpad helps. And because the model chooses each action, a misleading observation can send it in the wrong direction, which makes agent tracing useful for seeing where a run went wrong.

ReAct agents and Exabase

The quality of a ReAct agent depends heavily on its observations. A search tool that returns ten long documents fills the context and buries the answer; one that returns the exact passage keeps each cycle short and focused. Exabase Deep Search is built for this: it searches files, notes, audio and video at the sub-document level and returns the matching chunk with a page number or timestamp, and the precision setting lets the agent widen or narrow a search between steps. The search endpoint is a natural action for a ReAct tool, and the RAG accuracy solution explains why sub-document results help.

A second tool can query Memory, so the agent checks what it already knows about the user before searching or asking again. Exabase Workers follow the same loop inside a Base, with built-in tools for searching resources, writing notes and web search, and every run is recorded as a conversation showing each reasoning step and tool call; the worker tools guide lists them. Agentic search will replace RAG pipelines argues for this style of retrieval, and the research agents use case shows it in practice.

FAQs

What is a ReAct agent?

A ReAct agent is an AI agent that alternates between reasoning about a task and taking actions with tools, using each tool result to decide its next step until it can answer.

What does ReAct stand for?

ReAct stands for “reasoning and acting”. The pattern was introduced in the 2022 paper “ReAct: Synergizing Reasoning and Acting in Language Models” by Yao and colleagues.

How is ReAct different from chain-of-thought prompting?

Chain-of-thought reasons in one pass with no outside information. ReAct interleaves reasoning with tool calls, so the model can look things up and correct its plan as results arrive.

Is ReAct still used with function calling?

Yes. Modern agents keep the reason, act and observe loop but use native function calling for actions, so tool calls are structured data instead of parsed text.

How do you stop a ReAct agent from looping?

Cap the number of steps, return compact tool results, detect repeated identical calls, and give the model a clear way to say it cannot find the answer.

What tools work well for ReAct agents?

Tools that return short, precise results, such as sub-document search with citations, structured memory lookups and narrowly scoped APIs, keep each reasoning step focused and the context small.

Related pages: Agent loop, Chain of thought, Tool use, Function calling, Agentic RAG, Agent planning, Self-correction, AI agent framework, RAG accuracy solution, Best AI agent frameworks, Agent harness.

Cut your token spend and give your agent precise context.

Get started in minutes.

Cut your token spend and give your agent precise context.

Get started in minutes.