The ReAct Pattern: How AI Agents Reason and Act in Loops
COMPLETE guide to the ReAct pattern for AI agents. How Thought-Action-Observation loops work, benchmarks, failure modes & LangGraph examples.
Frequently Asked Questions
What is the ReAct pattern in AI agents?
ReAct (Reason + Act) is an agent architecture where the model interleaves internal reasoning traces ("Thought: I need to look up X") with external tool calls ("Action: search[X]") and their results ("Observation: X is Y"). This loop repeats until the agent produces a final answer. Introduced by Yao et al. at ICLR 2023, it is the default agent pattern in LangChain and LangGraph.
How is ReAct different from Chain-of-Thought prompting?
Chain-of-Thought (CoT) keeps reasoning entirely inside the model — no external tools. ReAct extends CoT by adding tool actions between reasoning steps, grounding each thought in real observations. CoT is cheaper but relies on the model's parametric memory; ReAct reduces hallucination by checking facts against external sources at every step.
What are the main failure modes of the ReAct pattern?
The most common failure modes are infinite loops (the agent cycles through the same actions without progress), context window overflow (long trajectories exceed the model's context limit), and thought hallucination (the model reasons correctly but calls the wrong tool). A max_iterations guard and a context-length budget are essential safeguards in production.
Is the ReAct pattern still used in 2026?
Yes, but in evolved form. Most production agents use native function calling (GPT-4o, Claude 3.x, Gemini 2.x) which is functionally equivalent to ReAct but more reliable than text-parsed Thought/Action traces. The ReAct mental model — reason, act, observe, repeat — remains the dominant paradigm. LangGraph's create_react_agent is the standard production implementation.
What is the best framework for ReAct agents in 2026?
LangGraph (v1.0, GA October 2025) is the production standard. It implements ReAct as a stateful graph where nodes handle tool calls and edges route based on the model's next action. For simpler use cases, LangChain's create_react_agent still works. For multi-agent systems, CrewAI and AutoGen wrap ReAct internally.