ReAct pattern
ReAct interleaves Reasoning + Acting in an agent loop — the model writes a thought, then decides to call a tool, then observes the result, then thinks again.
ReAct (Yao et al., 2022) was the original recipe for LLM agents. Each step has three parts: Thought (free-form reasoning), Action (tool call), Observation (tool result fed back in). The loop continues until the model emits a Final Answer. Modern agent frameworks (LangGraph, OpenAI Agents SDK, Claude Agent SDK) all implement variations of ReAct, often with a planner that pre-decomposes the task before the executor loop begins. Pure ReAct can drift on long horizons — add budget caps and a planner-executor split for reliability.
When to use react pattern
- Agents with tools where each step depends on the previous result.
- Web research, code editing, browser automation.
Common mistakes
- Letting the loop run unbounded — set a max step count.
- Pure ReAct on tasks with branching planning needs — use a planner first.
FAQ
What is react pattern?
ReAct interleaves Reasoning + Acting in an agent loop — the model writes a thought, then decides to call a tool, then observes the result, then thinks again.
When should I use react pattern?
Agents with tools where each step depends on the previous result. Web research, code editing, browser automation.
What are the most common mistakes with react pattern?
Letting the loop run unbounded — set a max step count. Pure ReAct on tasks with branching planning needs — use a planner first.
Related terms
- AI agent — An AI agent is a system where a language model autonomously plans and executes a sequence of tool calls to accomplish a goal.
- Function calling (tool use) — Function calling lets a language model emit a structured request to invoke a developer-defined tool, enabling reliable JSON output and agent workflows.
- Chain-of-thought prompting — Chain-of-thought (CoT) prompting tells a language model to write its reasoning steps before its final answer, increasing accuracy on multi-step problems.
Sources
Last updated: 2026-06-01. Raw markdown: https://promtable.com/glossary/react-pattern.md.