Skip to content
gentic.news — AI News Intelligence Platform
Connecting to the Living Graph…
Agents

ReAct Pattern: definition + examples

The ReAct pattern, introduced by Yao et al. in the 2022 paper "ReAct: Synergizing Reasoning and Acting in Language Models," is a foundational agent design that interleaves chain-of-thought (CoT) reasoning with environment interaction (tool calls, API calls, code execution). Instead of generating a single static plan or relying on pure CoT, ReAct produces a cyclic loop: Thought → Action → Observation → Thought... The model outputs a natural-language thought (e.g., "I need to find the user's current location to answer the weather question"), then an action (e.g., a function call like get_location()), receives an observation (the API result), and then continues reasoning with the new information. This tight coupling prevents hallucinated reasoning chains by grounding each step in factual observations.

Technically, ReAct is implemented by prompting a pretrained LLM with a few examples of the interleaved format, or by fine-tuning on trajectories. The model's autoregressive generation is steered to produce structured output tokens (e.g., Thought:, Action:, Observation:) that are parsed by an agent runtime. The runtime executes the specified action (e.g., calling a weather API, running a SQL query, searching a knowledge base), injects the result back into the context, and the model continues. No additional training is required for the core pattern, though fine-tuning (e.g., on ToolBench or AgentInstruct data) can significantly improve adherence.

Why it matters: ReAct dramatically reduces hallucination in multi-step tasks compared to pure CoT (which can produce plausible but incorrect chains). In the original paper, ReAct outperformed CoT on HotpotQA (F1 0.47 vs 0.37) and AlfWorld (success rate 0.71 vs 0.30). It also provides full traceability — every decision is explained in natural language and linked to a concrete observation — which is critical for safety and debugging in production agents.

When it's used vs alternatives: ReAct is the default pattern in most modern agent frameworks (LangGraph, AutoGen, CrewAI, OpenAI's Assistants API) for tasks requiring external knowledge or tool use. Alternatives include: (1) Plan-and-Solve (e.g., Tree-of-Thoughts, ReWOO) where the model generates an entire plan before executing any action — better for tasks with strong dependencies but less adaptive to dynamic feedback. (2) Reflexion, which adds a critic that reflects on failures and retries. (3) Pure function-calling (e.g., OpenAI's parallel tool calls) without interleaved reasoning — faster but less interpretable, and prone to cascading errors. ReAct is preferred when transparency and step-by-step correction are needed.

Common pitfalls: (1) Context window overflow — long trajectories with many observations can exceed the LLM's context limit, leading to truncation or degraded performance. Solutions include summarization (e.g., using a separate LLM to compress past steps) or sliding-window approaches. (2) Overly verbose thoughts — models may generate lengthy reasoning that adds latency without improving accuracy. Prompt engineering (e.g., "Be concise") or fine-tuning on succinct examples helps. (3) Action parsing errors — if the model outputs malformed actions (e.g., missing arguments), the runtime must handle gracefully with retries or fallback. (4) Loops — the model may repeat the same action if the observation is ambiguous; adding a max step limit and a "final answer" action is essential.

Current state of the art (2026): ReAct remains the backbone of most production agents, but is often augmented with: (a) structured output generation (e.g., JSON mode) to enforce reliable action formatting; (b) memory modules (e.g., MemGPT/Letta) that compress and retrieve past observations; (c) hierarchical ReAct where high-level agents decompose tasks into sub-agents that each run their own ReAct loop (e.g., Voyager for Minecraft). The pattern has been integrated into multimodal agents (e.g., GPT-4V with ReAct for visual grounding) and code-generation agents (e.g., Codex with ReAct for iterative debugging). Research in 2025–2026 focuses on adaptive thought budgets (e.g., only reasoning when uncertainty is high) and meta-ReAct where the agent learns to choose its own reasoning pattern.

Examples

  • LangGraph's AgentExecutor default uses the ReAct pattern with a loop of Thought → Action → Observation.
  • OpenAI's Assistants API (2024+) implements ReAct-style reasoning with function calling and file search.
  • AutoGen (Microsoft) uses ReAct as the core interaction loop for multi-agent conversations with tool use.
  • Voyager (Minecraft agent) extends ReAct with a skill library and hierarchical goals for open-ended exploration.
  • The original ReAct paper (Yao et al., 2022) showed 0.71 success rate on AlfWorld vs 0.30 for CoT, and 0.47 F1 on HotpotQA vs 0.37.

Related terms

Chain-of-Thought PromptingTool-Use AgentReflexionPlan-and-SolveAgentic AI

FAQ

What is ReAct Pattern?

The ReAct pattern combines reasoning and acting in LLM agents, interleaving chain-of-thought traces with tool calls to ground inference in external actions and observations, improving accuracy and interpretability.

How does ReAct Pattern work?

The ReAct pattern, introduced by Yao et al. in the 2022 paper "ReAct: Synergizing Reasoning and Acting in Language Models," is a foundational agent design that interleaves chain-of-thought (CoT) reasoning with environment interaction (tool calls, API calls, code execution). Instead of generating a single static plan or relying on pure CoT, ReAct produces a cyclic loop: Thought → Action →…

Where is ReAct Pattern used in 2026?

LangGraph's AgentExecutor default uses the ReAct pattern with a loop of Thought → Action → Observation. OpenAI's Assistants API (2024+) implements ReAct-style reasoning with function calling and file search. AutoGen (Microsoft) uses ReAct as the core interaction loop for multi-agent conversations with tool use.