The ReAct (Reasoning + Acting) Framework is a prompting technique that interleaves a language model's internal reasoning traces with external tool calls to solve complex, multi-step problems. It structures the model's output into a loop of Thought, Action, and Observation steps, enabling it to dynamically plan, execute tools like APIs or calculators, and incorporate results to inform subsequent reasoning. This paradigm is foundational for building agentic systems that can reliably interact with the external world.
Glossary
ReAct Framework

What is the ReAct Framework?
A prompting paradigm for solving complex problems by combining internal reasoning with external actions.
By explicitly generating a reasoning trace before each action, ReAct improves transparency and reduces hallucination compared to black-box tool calling. It is closely related to Chain-of-Thought prompting but is distinguished by its integration of executable actions. The framework is implemented in agent orchestration platforms like LangChain and is a core technique within the broader pillar of Agentic Cognitive Architectures, enabling deterministic problem-solving through structured interaction loops.
Key Components of the ReAct Loop
The ReAct (Reasoning + Acting) framework is a prompting paradigm that structures a language model's problem-solving process into a cyclical loop of explicit thought and external action.
Thought
The Thought step is the model's internal reasoning process. It is a free-text, chain-of-thought style analysis where the model:
- Decomposes the problem into sub-tasks.
- Plans the next logical step.
- Evaluates the necessity of using an external tool.
- Formulates the precise query or action for the selected tool.
Example: Thought: The user asked for the current weather. I need to call a weather API. I should first determine their location. I can use a geolocation tool with their provided city name, 'Tokyo'.
Action
The Action step is the structured invocation of an external tool. The model must output a strictly formatted command, typically as a JSON object, specifying:
- Tool Name: The exact identifier of the function to call (e.g.,
get_weather). - Action Input: The parameters required for the tool (e.g.,
{"city": "Tokyo"}).
This output is parsed by the system orchestrator, which executes the actual API call or database query. The format enforces deterministic, machine-readable output.
Observation
The Observation step is the system's feedback to the model. After the Action is executed, the raw result from the tool is injected back into the model's context.
- This can be structured data (e.g., a JSON response from an API) or unstructured text (e.g., database query results).
- It may also include error messages (e.g.,
"Tool 'get_stock' not found"or"API timeout").
The model must interpret this observation to continue its reasoning loop, adapting its plan based on success or failure.
Loop Termination
The loop continues iterating (Thought → Action → Observation) until a terminal condition is met. The model decides to terminate the loop during a Thought step when:
- It has sufficient information to construct a final answer for the user.
- It determines no further actions are possible or required.
- A maximum iteration limit is enforced by the system to prevent infinite loops.
The final output is a natural language answer synthesized from all gathered observations, presented outside the ReAct loop structure.
Tool Definitions
For ReAct to work, the model requires a catalog of available tools. Each tool definition includes:
- Name & Description: A clear purpose (e.g.,
"search_web": "Searches the internet for current information"). - Parameter Schema: A strict definition of inputs, often using a JSON Schema (e.g.,
{"query": {"type": "string"}}). - Access Rules: Permissions and guardrails governing when the tool can be used.
These definitions are provided to the model in the system prompt or via a framework like the Model Context Protocol (MCP), enabling accurate tool selection.
Orchestrator & Parser
The Orchestrator is the software layer that manages the ReAct loop. Its critical duties are:
- Parsing: Extracting the structured
Actionfrom the model's text response using output parsing. - Execution: Calling the corresponding external function, API, or database query.
- Context Management: Appending the
Observationto the ongoing conversation history for the next model call. - Error Handling: Implementing fallback logic and retry logic for failed actions.
- Guardrails: Applying input sanitization and validation to prevent unsafe operations.
Frameworks like LangChain and LlamaIndex provide built-in ReAct orchestrators.
ReAct vs. Other Prompting Paradigms
A feature comparison of the ReAct framework against other major prompting strategies used for complex task decomposition and tool use.
| Core Mechanism | ReAct (Reasoning + Acting) | Standard Chain-of-Thought (CoT) | Zero-Shot Function Calling | Program-Aided Language Models (PAL) |
|---|---|---|---|---|
Primary Goal | Solve complex problems by interleaving reasoning and external tool actions | Improve accuracy on complex reasoning tasks via internal step-by-step logic | Directly invoke a single external tool or API from a user request | Solve reasoning tasks by generating executable code as an intermediate step |
External Tool Integration | ||||
Iterative Action Loop | ||||
Self-Correction Capability | ||||
Output Format | Interleaved text (Thought/Action/Observation) | Plain text reasoning chain | Structured JSON/function call | Executable code (e.g., Python) + final answer |
Typical Context Length | Long (due to iterative traces) | Medium | Short | Medium to Long |
Handles Dynamic Environments | ||||
Requires Pre-Defined Tool Schema |
Frequently Asked Questions
The ReAct (Reasoning + Acting) framework is a prompting paradigm that enables language models to solve complex, multi-step problems by interleaving internal reasoning with external tool calls.
The ReAct Framework is a prompting methodology that structures a language model's problem-solving process into an interleaved sequence of Reasoning steps and Acting steps. It explicitly prompts the model to generate a verbal reasoning trace (a 'thought') before executing an external action, such as calling a tool or API. This creates a transparent, step-by-step chain of thought that is externally grounded by tool use, allowing the model to tackle tasks that require both logical decomposition and real-world data retrieval or computation. The framework was introduced in a 2022 research paper to combine the benefits of chain-of-thought prompting with the ability to interact with external environments, effectively turning a language model into a basic agent capable of planning and tool use.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
The ReAct (Reasoning + Acting) framework is a foundational paradigm for building reasoning agents. These concepts define its core components and the ecosystem of tools that implement it.
Chain-of-Thought (CoT)
A prompting technique that elicits step-by-step reasoning in a model's output before delivering a final answer. Unlike ReAct, CoT is purely internal; it does not involve external tool calls or actions. It is the intellectual precursor to ReAct, demonstrating the performance gains from explicit reasoning traces.
- Key Difference: CoT reasons about a problem; ReAct reasons to act on it.
- Use Case: Primarily for complex arithmetic, commonsense, and symbolic reasoning tasks where no external data or API is needed.
Tool Calling
The core capability of a language model to generate a structured request (e.g., JSON) to execute a defined external function, API, or data source. This is the "Act" phase of the ReAct loop. The model must identify the correct tool and extract parameters from its internal reasoning and the user's request.
- Implementation: Often defined via JSON Schema or OpenAPI Specifications.
- Provider Examples: OpenAI Functions, Anthropic Tools, and Gemini Function Calling are proprietary implementations.
Agentic Cognitive Architecture
The overarching system design that enables autonomous agents to decompose goals, plan, and execute multi-step tasks. ReAct is a specific, widely adopted architectural pattern within this domain. These architectures typically include components for planning, memory, tool use, and reflection.
- Broader Scope: Encompasses ReAct but also includes other paradigms like Reflection and Hierarchical Planning.
- System Concern: Focuses on the agent's persistent state, long-term objectives, and self-correction loops beyond a single ReAct cycle.
Self-Correction
A process where an agent (or model) critiques and revises its own outputs or actions. In advanced ReAct agents, this can be an additional step in the loop, where the agent evaluates the result of a tool call, detects errors, and reasons about the next corrective action.
- Enhances Reliability: Moves agents from simple execution towards resilient problem-solving.
- Example: An agent calls a calculator but gets an unexpected result; its self-correction step would re-examine the initial problem and tool parameters.
LangChain & LlamaIndex
Prominent open-source frameworks that provide high-level abstractions for building ReAct-style agents. They simplify the orchestration of reasoning, tool calling, and memory.
- LangChain: Offers a rich ecosystem of Tools, Agents, and Chains to compose multi-step workflows. Its
ReActAgentis a canonical implementation. - LlamaIndex: Excels at data-aware agents, providing tools for sophisticated retrieval over private data, which then feed into the ReAct reasoning loop.
- Role: These frameworks handle the scaffolding, letting developers focus on defining tools and the agent's objective.
Model Context Protocol (MCP)
An open standard for securely exposing tools, data sources, and services to AI models. MCP provides a unified, secure way for ReAct agents to discover and interact with external resources, moving beyond vendor-specific function calling implementations.
- Key Benefit: Decouples tool definitions from any single model provider (OpenAI, Anthropic, etc.).
- Architecture: Uses servers to expose resources and clients (like an AI app) to connect to them. It standardizes schema definition, authentication, and streaming results.
- Impact: Promotes interoperability and is becoming a foundational layer for enterprise-grade ReAct agent systems.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us