ReAct
ReAct is an agent technique that iteratively interleaves reasoning, actions, and observations so results can guide subsequent actions.
AI Agents in Action, Second Edition
ReAct is an agent reasoning technique that interleaves verbal reasoning with tool actions and observations in a feedback loop.
- How it is used
- Guides agents through multistep tasks where tool results determine subsequent decisions.
- How deep it goes
- Explains the reason-act-observe cycle and external orchestration, then implements a tool-using agent and a trace-inspection exercise.
- Examples
- Uses time-travel tools to calculate years and an exercise that prints tool-call traces.
- What you can do after
- Apply it via an Agent with function tools, reflective instructions, and trace inspection.
Read how AI Agents in Action, Second Edition explains ReAct →
Domain-Specific Small Language Models
An agent framework that interleaves reasoning and tool use to solve tasks by iterating toward a solution.
- How it is used
- Coordinates LLM reasoning and tool use to complete multistep agent tasks.
- How deep it goes
- Defines the iterative pattern and demonstrates CodeAgent configuration and chained actions, without detailing the model’s internal reasoning algorithm.
- Examples
- Traces flight search, seat selection, and mocked booking through chained Python-based tools.
- What you can do after
- Apply it via smolagents CodeAgent by configuring a model and tools, then running a multistep task.
Read how Domain-Specific Small Language Models explains ReAct →
Designing AI Systems
An agent loop is an iterative execution pattern in which a model selects tools, observes their results, and continues reasoning until it produces a final response or reaches a stopping condition.
- How it is used
- Coordinates reasoning, retrieval, and external actions in a personal assistant moving from prototype to production.
- How deep it goes
- Works through tool registration, bounded iteration, safety checks, and a streaming variant within a complete workflow.
- Examples
- Uses a personal assistant that creates calendar events and tickets and searches the web.
- What you can do after
- Apply it via platform model, tool, session, data, and guardrail services to build an assistant workflow.
Build AI-Enhanced Web Apps
ReAct is an agentic reasoning technique in which a language model interleaves reasoning about a task with actions that gather information or affect an environment.
- How it is used
- Uses ReAct to equip a conversational agent with tools for gathering information before answering.
- How deep it goes
- Explains agent components and tool setup, then demonstrates integration with a streaming web UI.
- Examples
- Demonstrates a technical assistant using Wikipedia search and a retriever exposed as an agent tool.
- What you can do after
- Apply it via LangChain.js to create a tool-using agent and integrate its updates into a web UI.
Build an AI Agent (From Scratch)
The ReAct pattern is an agent design in which reasoning and action alternate so the agent can incorporate tool results and adapt its subsequent behavior.
- How it is used
- Provides the adaptive think–act loop underlying a tool-using agent and its extensible harness.
- How deep it goes
- Builds from tool dispatch and conversation history to agent orchestration, execution state, and structured output.
- Examples
- Traces searches and a calculation for a runner’s hypothetical journey to the Moon, and tests web search on a current-events question.
- What you can do after
- Build it from scratch as a tool-calling agent that repeats decisions and actions and returns a final response.
Designing AI Agents
ReAct is an agent technique that interleaves language-model reasoning with actions to interact with an environment.
- How it is used
- Frames agent work as repeated perception, reasoning, action, and observation within a runtime architecture.
- How deep it goes
- Explains the cycle and supporting loops, then implements a single pass without tool invocation or reflection.
- Examples
- Uses Argus to review a code diff through one model call and structured JSON output.
- What you can do after
- Evaluate and understand agent loops by identifying their phases, feedback paths, and compounding-error risks.
Building Reliable AI Systems
An agent framework that interleaves reasoning, actions, and observations to guide task execution.
- How it is used
- Guides agents in selecting tools and sequencing actions as requests and results evolve.
- How deep it goes
- Explains the reasoning-action-observation cycle and its role in multistep workflows, with a practical agentic RAG project.
- Examples
- Uses flight and hotel booking, plus a travel assistant combining document retrieval with a weather API.
- What you can do after
- Apply it via LangChain in a travel assistant that combines retrieval and real-time services.
Prompt Engineering in Practice
ReACT is a prompting pattern for agentic workflows in which a model alternates between reasoning, actions, and observations.
- How it is used
- Structures agentic investigations that need external observations before reaching a supported conclusion.
- How deep it goes
- Works through a three-turn diagnosis and describes tool-runtime handoffs, but demonstrates the loop with manually supplied observations rather than code.
- Examples
- Traces stale-dashboard diagnosis through repeated hourly transformation failures and a schema error involving `user_segment`.
- What you can do after
- Practice/perform an observation-led investigation and stop when independent evidence supports a diagnosis and next action.
AI Agents and Applications
A ReAct agent is an agent architecture that interleaves reasoning with actions such as invoking tools and observing their results.
- How it is used
- Coordinates tool selection and use when a task’s required tools or call sequence cannot be predicted in advance.
- How deep it goes
- Explains the reasoning-action cycle and shows how a prebuilt agent replaces manual graph wiring.
- Examples
- Uses travel-information and accommodation agents to demonstrate tool use, including searches across hotels and B&Bs.
- What you can do after
- Apply it via LangGraph’s create_react_agent to orchestrate tool calls and synthesize responses.
Grokking AI Applications
A repeated agent cycle in which the agent selects an action or tool, invokes it with parameters, processes the result, and continues until the task is complete.
- How it is used
- Coordinates LLM reasoning and tool use for live information, external actions, and multistep decisions.
- How deep it goes
- Traces tool selection, execution, returned results, and repeated reasoning through a concrete example.
- Examples
- Uses a thermostat and lights scenario with temperature checks, settings changes, and success results.
- What you can do after
- Apply an agent loop that selects tools, supplies parameters, processes results, and continues until completion.
Hugging Face in Action
ReAct is an agent technique in which a language model alternates between reasoning, taking actions such as tool calls, observing results, and continuing reasoning.
- How it is used
- Builds agents that reason through user queries and call suitable tools when their internal knowledge is insufficient.
- How deep it goes
- Explains the reasoning-action-observation loop and basic execution traces, but does not develop deeper internals or training procedures.
- Examples
- Demonstrates web search, weather lookup, factual questions, arithmetic, and message-history traces.
- What you can do after
- Build it from scratch with LangChain or LangGraph, configure tools, invoke queries, and inspect the resulting agent trace.
Build Python Web Apps with Streamlit
A ReAct agent is an AI agent pattern that interleaves reasoning about a task with actions performed through callable tools.
- How it is used
- Deploys agents that interact with existing systems instead of only retrieving facts.
- How deep it goes
- Explains the reasoning-action loop and tool interfaces, but defers the internal implementations of those tools.
- Examples
- Uses order tracking and cancellation, static user and order dictionaries, and four customer-service tool functions.
- What you can do after
- Build an agent that selects callable functions, incorporates their results, and completes customer order tasks.
Read how Build Python Web Apps with Streamlit explains ReAct →
LLMs in Production
ReAct is a prompting framework that interleaves a language model's reasoning with external actions and observations to solve tasks.
- How it is used
- Uses few-shot prompting to let language models solve tasks through successive reasoning, tool calls, and observations.
- How deep it goes
- Explains the reasoning-action-observation loop with a worked trace, then demonstrates agent configuration without detailing implementation internals.
- Examples
- Demonstrates swallow-speed research and an Olivia Wilde, Harry Styles, and exponent-calculation agent trace.
- What you can do after
- Apply it via LangChain by connecting an OpenAI model with search and math tools in a ReAct agent.
Context Engineering
ReAct is an agent reasoning pattern that alternates between internal reasoning and external actions such as tool invocation.
- How it is used
- Structures agent loops around reasoning, tool execution, and observations that inform subsequent steps.
- How deep it goes
- Explains the Thought–Action–Observation cycle and harness handoff, with a calculator trace and a related framework implementation.
- Examples
- Uses a population square-root calculation and a document-search agent to illustrate tool-mediated answers.
- What you can do after
- Apply it via LangChain by configuring an agent with a model, retrieval tool, and system prompt.
Building LLM Applications with DSPy
The ReAct pattern guides an agent to interleave reasoning with actions such as selecting and invoking tools.
- How it is used
- Coordinates language-model tool selection and execution to answer queries, using trajectories to guide subsequent actions.
- How deep it goes
- Explains iterative tool selection, parameter passing, observations, final response generation, and an iteration limit.
- Examples
- Demonstrates a calculator solving (3 + 5) * 2 by calling add and multiply.
- What you can do after
- Apply via DSPy’s ReAct module to define Python tools, set an iteration limit, and inspect execution trajectories.
Read how Building LLM Applications with DSPy explains ReAct →
Also covered in
- The Architecture of ReasoningIn early access (MEAP)
- AI Agents for Offensive SecurityIn early access (MEAP)
- Financial AI in Practice
- Build a Multi-Agent System (from Scratch)In early access (MEAP)
- Introduction to Generative AI, Second Edition
- LLM Evaluation and Alignment, The Foundational IdeasIn early access (MEAP)
- Retrieval Augmented Generation, The Foundational IdeasIn early access (MEAP)
- Agent Design PatternsIn early access (MEAP)
- Knowledge Graphs and LLMs in Action
What to know first
- language modelA language model is a computational model that represents patterns in linguistic sequences to assign probabilities, predict, generate, or evaluate language.
- AI agentAn AI agent is a computational system that uses artificial intelligence to interpret information and select or perform actions toward goals while interacting with an environment.
- promptA prompt is text or other input supplied to an AI model to provide instructions, context, or other information that guides its response or generated output.
- toolA software tool is a capability or utility that enables a person or system to perform a defined task or operation.
Related concepts
- processing loopkind of · A processing loop is a repeated execution pattern that handles inputs or messages and performs resulting actions.
- memoryhas part · Memory is a storage capability or mechanism for retaining information or computational state for later access or use.
- reasoning architecturekind of · A structure that organizes how reasoning proceeds, such as by moving directly to an answer, exposing intermediate logic, branching into alternatives, rotating perspectives, or testing conclusions against evidence.
- tooluses · A software tool is a capability or utility that enables a person or system to perform a defined task or operation.
- AI agentkind of · An AI agent is a computational system that uses artificial intelligence to interpret information and select or perform actions toward goals while interacting with an environment.
- tool useuses · Tool use is the capability of an AI system or agent to request external software operations through defined interfaces to obtain information or perform actions.
Questions about ReAct
What is ReAct?
ReAct is an agent technique that iteratively interleaves reasoning, actions, and observations so results can guide subsequent actions.
Which Manning books explain ReAct?
AI Agents in Action, Second Edition, Domain-Specific Small Language Models, Designing AI Systems, Build AI-Enhanced Web Apps, Build an AI Agent (From Scratch), Designing AI Agents, Building Reliable AI Systems, Prompt Engineering in Practice and 7 more.
What should I know before learning ReAct?
Manning books that teach ReAct usually introduce language model, AI agent, prompt and tool first.
What is ReAct a kind of?
ReAct is a kind of processing loop. A processing loop is a repeated execution pattern that handles inputs or messages and performs resulting actions.
What are the parts of ReAct?
ReAct includes memory.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.














