Agent Control Patterns — Part 4: ReAct — Thinking While Acting

Last Updated on March 4, 2026 by Editorial Team Author(s): Vahe Sahakyan Originally published on Towards AI. So far in this series, we designed systems with predefined structure. We defined the execution flow. We separated reasoning from revision. We controlled when research happens. Even when loops were introduced, the workflow remained bounded and predictable. However, some problems cannot be fully decomposed in advance. You may not know how many tool calls will be required. You may not know what information is needed until you see the result of the previous step. In these cases, a fixed plan is not enough. The system must reason and act step by step, adapting as new information arrives. This article introduces ReAct — a control pattern where reasoning and tool use are interleaved inside a feedback loop. Introduction — When the Plan Cannot Be Defined Upfront Consider a query such as: “What’s the current stock price of Tesla, and is it a good time to buy based on recent trends?” This is not a single-step task. To answer it properly, the agent must retrieve the current stock price, examine recent performance, interpret the trend, and decide whether more data is needed before reaching a conclusion. The difficulty is that the number of steps cannot be determined in advance. The first search may reveal volatility. That may require additional context. New information may change the direction of the analysis. In this type of problem, the next step depends on the result of the previous one. A single generation pass is not sufficient.A fixed draft–revise cycle is not sufficient.A separate research phase triggered after critique is not sufficient. Instead, reasoning and tool use must proceed together. In the ReAct pattern (Reasoning + Acting), the model does not generate a complete plan before interacting with tools. It reasons about the current state, decides on an action, observes the result, and then reasons again. The process continues until enough information has been gathered. The control flow follows a loop: Reason → Act → Observe → Reason → … → Stop The answer is constructed incrementally, with each observation influencing the next step. What Is ReAct? ReAct stands for Reasoning + Acting. It is a control pattern where reasoning and tool use happen inside the same loop. Unlike Reflection or Reflexion, ReAct does not separate thinking and execution into phases. There is no full draft first. There is no dedicated research phase after critique. Instead, the system moves step by step. The core loop looks like this: Thought → Action → Observation → Thought → … → Stop Here is what each step means: Thought The model reviews the current state and decides what to do next. Action If more information or computation is needed, the model calls a tool. This could be a web search, a calculator, a database query, or another function. Observation The result of that tool call is returned and added to the state. The model then reasons again using the updated context. The loop continues until the model produces an answer without requesting another tool call. At that point, execution stops. This pattern is different from revision-based approaches. In Reflection, the model improves a completed answer. In Reflexion, research happens after critique. In ReAct, there is no complete answer at the beginning. The answer is built step by step as the model interacts with tools. As a result: The number of steps is not known in advance. Tool calls are decided during execution. Each reasoning step depends on the latest observation. ReAct treats tool results as part of the reasoning process, not as a separate phase. Control Structure of ReAct ReAct is more than combining an LLM with tools. The key idea is how the loop is organized. In earlier patterns: Sequential pipelines followed a fixed path. Reflection added an internal revision loop. Reflexion added a separate research step. ReAct removes those fixed phases. Instead, reasoning and tool use happen inside the same loop. Each cycle looks like this: The model reasons about the current state. It decides whether to call a tool. The tool returns a result. The model reasons again using the updated information. The next step depends on what was just observed. Several properties follow from this structure: The full plan is not known at the beginning. The state grows over time as observations are added. Tool calls are used to gather missing information. The loop stops when the model produces an answer without requesting another tool. In ReAct, there is no predefined execution path. The sequence of steps emerges during execution. Difference from Reflexion ReAct and Reflexion both use tools, but they use them in different ways. Reflexion Reflexion is a step-by-step process with separate phases: Draft an answer Critique the draft Run research Revise using the results Research happens after critique, and tool calls usually occur in a dedicated research step. The flow looks like: Draft → Research → Revise ReAct ReAct does not start with a full draft. Instead, reasoning and tool use happen in a loop: Think → Act → Observe → Think → … There is no separate research phase. Each tool result directly affects what the model does next. Difference from Orchestration ReAct can look similar to orchestration because both involve multiple steps and tool use. The difference is how those steps are decided. Orchestration In orchestration: A planner breaks the task into subtasks at the beginning. The system builds a task graph based on that plan. Workers execute the defined subtasks. Even if the number of subtasks depends on the input, the decomposition happens before execution begins. The overall structure is defined first, and then work is carried out. The flow is plan-first, then execution. ReAct In ReAct: There is no full plan at the beginning. The system decides the next step only after seeing the result of the previous one. The number of steps is not known in advance. The process unfolds step by step inside a loop. Orchestration works well when […]
This article was originally published by Towards AI. View original article
Get AI news in your inbox
Daily digest of what matters in AI.