ModelRefs / ReAct Agent Pattern — AI Glossary
ReAct Agent Pattern — AI Glossary
An agent loop that interleaves chain-of-thought Reasoning with tool Actions (Reason → Act → Observe → repeat). It also determines where a fix belongs.
Overview
ReAct (Yao et al., 2022) is the foundational pattern behind LangChain agents, AutoGPT, and most production agentic systems. The model writes its reasoning in free text before each tool call, making the decision process inspectable and debuggable.
Reference details
| Topic | agents |
|---|---|
| Last reviewed | 2026-06-24 |
Related terms
How it works
- The executor owns the identity under which tools run, so the agent's permissions are a property of the process rather than of anything the model emits.
- A malformed action is returned to the model as an observation rather than raised as an error, which lets the model read its own mistake and correct the next attempt.
- A tool that throws is handled the same way: the exception is rendered into text and appended, because an agent that cannot see a failure cannot route around it.
- A tool that times out is the hard case, since the call may have completed on the far side — so the executor must decide between retrying a possibly-duplicated action and aborting with the state unknown.
- Bounds are enforced outside the model's control for the same reason: the loop cannot be trusted to stop itself, so the step count, the deadline and the spend ceiling are checked by the executor each iteration.
- All observability attaches here as well, since the executor is the only component that sees every prompt sent, every action parsed and every result returned.
Example: What the executor adds, and the failure it absorbs most often
The pattern gives you Thought → Action → Observation. An agent adds everything that makes it survive contact with production: a maximum iteration count, a timeout, parsing of malformed actions, a whitelist of callable tools, and a stopping condition. Most ReAct failures in practice are not reasoning failures — they are loops that never terminated. The parsing one is worth sizing because it is continuous rather than exceptional. Because the action is free text the harness pattern-matches, a proportion of actions arrive malformed — a missing bracket, a quoted argument the regex does not expect. At a 5% malformed rate and a mean task length of 12 actions, that is 0.05 x 12 = 0.6 extra round trips per task, so roughly three tasks in five pay for one wasted model call. Returning the parse error as an observation rather than raising it is what converts those into recoveries instead of failures, and it is the single highest-value thing the executor does.
Commonly confused with
A ReAct agent is the running system; ReAct is the prompting pattern inside it. The distinction matters operationally: you tune the pattern by changing the prompt, and you make the agent safe by changing the loop — iteration caps, tool permissions, timeouts. It also determines where a fix belongs. A model choosing the wrong tool is a pattern problem addressed in the prompt and the tool descriptions; a model choosing the right tool forty times in a row is a loop problem addressed by a step budget, and neither fix helps with the other.
When to use it
Reach for it when:
- The step count is genuinely unknown ahead of time
- You have bounded the loop and can afford the worst case
- The tools are read-only, or writes are individually authorised
- Where parse errors are returned as observations, which is what makes malformed actions recoverable
Reach for something else when:
- You have not set a step budget — an unbounded loop is an unbounded bill
- Tools have side effects and nothing gates them
- A fixed pipeline would do: it is cheaper, faster, and testable
- Where a tool exception aborts the run rather than re-entering the loop as text the model can read
Primary source
Referenced by
This term is used by the following ModelRefs references:
Continue your research
Use these connected ModelRefs sections to compare alternatives, inspect implementation paths, and review the evidence and governance boundaries relevant to ReAct Agent Pattern — AI Glossary.
Frequently asked questions
What is ReAct Agent Pattern?
An agent loop that interleaves chain-of-thought Reasoning with tool Actions (Reason → Act → Observe → repeat).
What concepts are related to ReAct Agent Pattern?
Closely related concepts include agentic loop, tool use, chain of thought.