The ReAct Framework (Reasoning + Acting) is a prompting paradigm that interleaves a language model's internal reasoning traces with external actions, such as tool calls, to solve complex tasks requiring both planning and information gathering. It structures an agent's thought process into a loop of Thought, Action, and Observation steps, enabling it to dynamically reason about what to do next and execute the necessary function to gather data or perform a task.
Glossary
ReAct Framework

What is the ReAct Framework?
A prompting paradigm that combines reasoning and action for complex task-solving.
This framework addresses the limitations of pure reasoning or acting by allowing the model to ground its decisions in real-world observations. By explicitly generating a reasoning trace before each action, it improves transparency and reliability, reducing hallucination. It is foundational to modern agentic architectures and is closely related to concepts like function calling and workflow orchestration.
Core Components of the ReAct Loop
The ReAct (Reasoning + Acting) framework is a prompting paradigm that interleaves a language model's internal reasoning traces with external actions (tool calls) to solve complex tasks requiring both planning and information gathering.
Thought Generation
The Thought step is the model's internal reasoning process. It analyzes the current state, decomposes the problem, and plans the next action. This explicit chain-of-thought is crucial for transparency and debugging.
- Purpose: To articulate the agent's internal logic and justify the subsequent action.
- Output Format: Free-form natural language.
- Example:
Thought: The user asked for the weather in Tokyo. I don't have current weather data in my training. I need to call a weather API. I should first find the correct API endpoint and required parameters.
Action Selection & Structuring
The Action step is where the model decides to interact with the external world. It selects a specific tool and generates a structured call, typically conforming to a defined schema like JSON.
- Purpose: To translate internal reasoning into an executable external command.
- Output Format: A structured object specifying the
tool_nameandtool_input(arguments). - Example:
Action: {"tool_name": "get_weather", "tool_input": {"location": "Tokyo", "units": "celsius"}} - This step directly enables tool calling and API execution.
Observation Processing
The Observation step is the result returned from the executed tool or API. This raw data, which was not in the model's original training set, is fed back into the agent's context.
- Purpose: To provide the agent with new, external information necessary to continue its task.
- Input: Can be structured (JSON) or unstructured (text, HTML).
- Example:
Observation: {"location": "Tokyo", "temperature": 22, "conditions": "Partly Cloudy", "humidity": 65%} - The agent must parse and integrate this observation into its ongoing reasoning loop.
The Iterative Loop
ReAct operates as a cyclic, stateful process. The agent repeats the Thought-Action-Observation sequence until the task is complete or a termination condition is met.
- State Management: Each cycle updates the agent's context with new thoughts and observations.
- Dynamic Planning: The agent can adjust its plan based on unexpected observations (e.g., an API error).
- Termination: The final
Thoughtconcludes the task, often followed by anAnswerto the user. - Example Flow:
Thought -> Action -> Observation -> Thought -> Action -> Observation -> ... -> Final AnswerThis loop is the core of agentic cognitive architectures.
Prompt Template Structure
ReAct is implemented via a specialized prompt template that provides the model with examples of the loop, available tools, and output format instructions.
- Components:
- System Instructions: Define the agent's role and the ReAct format.
- Tool Definitions: A list of available tools with names, descriptions, and parameter schemas.
- Few-Shot Examples: Demonstrations of complete ReAct trajectories for similar tasks.
- Output Format Enforcement: Instructions to strictly output
Thought:,Action:, orAnswer:.
- This template is a key element of context engineering and prompt architecture.
Integration with Function Calling
ReAct is a high-level reasoning pattern that is typically implemented on top of a function calling framework. The framework handles the translation between the model's action output and the actual code execution.
- Mechanism: The
ActionJSON is passed to a dynamic dispatch system that matches thetool_nameto a handler in a function registry. - Role of Frameworks: Libraries like LangChain Tools or Semantic Kernel provide the abstraction to define tools and bind the ReAct loop to them.
- Validation: The framework performs parameter validation against the tool's schema before execution.
- Error Handling: Framework-level error propagation and retry policies manage failures, allowing the ReAct loop to reason about them in the next
Thought.
How the ReAct Framework Works
The ReAct (Reasoning + Acting) framework is a prompting paradigm that interleaves a language model's internal reasoning traces with external actions (tool calls) to solve complex tasks requiring both planning and information gathering.
The ReAct framework is a prompting technique that structures a large language model's (LLM) output into an interleaved sequence of Thought, Act, and Observation steps. The Thought step allows the model to reason about the task and plan its next action. The Act step is where the model generates a structured request to call an external tool or API, such as a search engine or calculator. The Observation step then feeds the tool's result back into the model's context, closing the loop.
This iterative cycle of reasoning and acting enables the model to tackle problems that require dynamic information gathering and multi-step planning, which are beyond its static knowledge. By explicitly separating internal reasoning from external actions, ReAct improves transparency, reduces hallucination, and provides a clear audit trail. It is a foundational pattern for building agentic systems that can autonomously decompose and execute complex workflows using tools.
Frequently Asked Questions
The ReAct (Reasoning + Acting) framework is a prompting paradigm that enables large language models to solve complex tasks by interleaving thought and action. These questions address its core mechanics, applications, and relationship to other technologies.
The ReAct framework is a prompting methodology that structures a language model's problem-solving process into an interleaved loop of internal reasoning traces (Thoughts) and external actions (Actions) to complete tasks requiring planning and information gathering.
It was introduced in a 2022 research paper to address the limitations of models that either reason in isolation or act without deliberation. The core loop is:
- Thought: The model reasons about the current situation, plans the next step, or determines what information is needed.
- Action: Based on the thought, the model makes a structured call to an external tool (e.g., a search API, calculator, or database).
- Observation: The system returns the result of the tool call as an observation, which the model then uses to inform its next thought.
This cycle continues until the task is solved, producing a transparent trace of Thought > Action > Observation steps.
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 framework exists within a broader ecosystem of technologies that enable AI agents to interact with external systems. These related concepts define the mechanisms, patterns, and infrastructure required for reliable tool execution.
Function Calling
Function calling is a core LLM capability where the model is prompted to output a structured request, typically JSON, matching a predefined schema to invoke an external function or API. It is the fundamental mechanism that frameworks like ReAct rely upon to execute the 'Act' phase.
- Structured Output: The model must generate arguments that conform to a strict type definition (e.g.,
{"function": "get_weather", "location": "Boston"}). - Schema-Driven: Function signatures (name, description, parameter types) are provided to the model in its prompt context.
- Foundation for Tools: It transforms natural language intent into executable code, enabling agents to perform actions beyond text generation.
Tool Calling
Tool calling is the end-to-end process where an AI agent selects and invokes an external utility. While function calling refers to the model's structured output, tool calling encompasses the full lifecycle: selection, argument generation, dispatch, execution, and handling the result.
- Agent-Centric: Focuses on the agent's decision to use a tool based on context and capability.
- Runtime Integration: Involves a dynamic dispatch system that routes the model's request to the correct handler code.
- Broader Scope: Includes error handling, authentication, and state management that pure function calling does not address.
Structured Outputs
Structured outputs are formatted, schema-conforming data (like JSON objects) that a language model generates to reliably interface with downstream systems. In ReAct, both the reasoning trace and the tool call request must be structured for deterministic parsing by the orchestration layer.
- JSON Schema Binding: A technique to enforce output conformity using a formal JSON Schema definition.
- Type Safety: Guarantees that parameters for tool calls are of the correct type (string, number, array) before execution.
- Integration Enabler: Allows AI-generated data to be consumed directly by traditional software without fragile text parsing.
Tool Selection
Tool selection is the decision-making process where an AI agent evaluates available tools against the current context and user intent to choose the most appropriate function. In ReAct, this occurs during the 'Act' step, informed by the preceding 'Reasoning' trace.
- Semantic Matching: The agent matches the task's needs to tool descriptions (name, purpose, parameter docs).
- Driven by Context: Selection depends on the current state of the problem and previous tool results.
- Core to Planning: Effective selection is critical for multi-step problem-solving, preventing the agent from getting stuck.
Workflow Orchestration
Workflow orchestration is the automated coordination, sequencing, and state management of multiple tool calls and conditional logic within an agent's execution plan. ReAct implicitly defines a simple orchestration loop: Reason -> Act -> Observe, repeat.
- State Management: Tracks inputs, outputs, and intermediate results across a sequence of actions.
- Conditional Logic: Determines the next step based on the success or output of a previous tool call.
- Beyond Chaining: More sophisticated than simple tool chaining, as it involves loops, branching, and error recovery pathways.

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