What is it?
ReAct is the basic recipe for an AI agent: decide on a next step, use a tool, look at what came back, and decide again. Most agent frameworks implement some version of it.
Also known as: ReAct, reason and act, ReAct prompting, thought action observation, agent loop, tool use loop, ReAct agent.
Technical definition
Yao et al. (2022) propose prompting models to alternate "thought" and "action" steps with observations, improving performance on knowledge-intensive and interactive tasks versus reasoning-only or acting-only baselines. Modern implementations use native tool-calling APIs (Function Calling (Tool Calling) Explained) instead of text parsing, and may use hidden or summarised reasoning (Reasoning Transparency and Hidden Reasoning). Reliability depends on tool design, error handling and termination logic.
Entity type: technique · Freshness class: evolving.
When should I use it?
The default pattern for exploratory tasks needing tools.
Implementation patterns
- Loop: model → tool call → result → model, with a hard step cap.
- Validate tool args; return concise, informative errors.
- Add a "finish" tool or explicit stop condition.
- Log each step for debugging.
Technologies and frameworks
Commonly associated: native tool-calling APIs, LangGraph, OpenAI Agents SDK, custom loops. Names are examples of what exists, not recommendations, and projects change quickly.
Practical guide
- Define tools with clear schemas.
- Implement the loop with limits.
- Add stop conditions.
- Trace runs.
- Evaluate on tasks (Agent Evaluation).
Common failure modes
- Infinite or oscillating loops.
- Context bloat from verbose tool outputs.
- Wrong tool selection from vague descriptions.
- Acting on injected instructions in tool output.
Troubleshooting
- Agent repeats the same call — Detect repeats, add loop limits and hint in the error message.
- Context overflows — Truncate/summarise tool results; store large data outside the prompt.
Contrasted with
- Agent Planning and Task Decomposition — ReAct decides step by step; planning-first agents draft a multi-step plan upfront.
- Chain-of-Thought Prompting — CoT reasons without acting; ReAct interleaves actions with observations.
Questions this page answers
- What is ReAct?
- How does the agent loop work?
- How do I stop an agent from looping forever?
- ReAct vs plan-and-execute?
Typical goals: understand the basic agent loop; implement a tool-using agent.
Sources and verification
Status: not independently verified. This entry was authored on 2026-10-06 from general technical knowledge, without live checking of the sources below. Treat every source as a lead to confirm (identifier, title, authorship, current version) before publication or citation.
Freshness class: evolving — Established techniques whose best practice shifts as research and tooling move. Re-review every 6 months.
Canonical sources (unverified leads):
- Yao et al., ReAct: Synergizing Reasoning and Acting in Language Models (2022) — arXiv:2210.03629
- Schick et al., Toolformer (2023) — arXiv:2302.04761