Skip to main content
Early access β€” new tools and guides added regularly
Practical

ReAct Pattern

Last reviewed: April 2026

An AI agent design pattern where the model alternates between reasoning about what to do next and taking an action, creating an observable thought-action loop.

The ReAct pattern β€” short for Reasoning plus Acting β€” is an agent design pattern where the AI model alternates between thinking about what to do and actually doing it. Each cycle produces a visible thought (reasoning), an action (such as a tool call), and an observation (the result of that action), which feeds into the next reasoning step.

How ReAct works

A ReAct loop follows this cycle:

  • Thought: The model reasons about the current state and what it should do next. "I need to find the company's quarterly revenue. I should search the financial database."
  • Action: The model calls a tool or takes a step. It queries the financial database for Q3 revenue figures.
  • Observation: The result of the action is returned to the model. "Q3 revenue was Β£4.2 million, up 12% from Q2."
  • Repeat: The model reasons about this new information and decides on the next action. This continues until the task is complete.

Why ReAct is effective

  • Transparency: Because the model's reasoning is explicit, developers and users can see why the agent took each action. This makes debugging much easier.
  • Grounded reasoning: Each reasoning step is informed by real data from the previous action, reducing hallucination.
  • Flexibility: The model can adapt its plan based on what it discovers, rather than following a rigid script.
  • Error recovery: When an action fails or produces unexpected results, the model can reason about what went wrong and try a different approach.

ReAct vs other patterns

  • Chain-of-thought alone: The model reasons but cannot take actions or access external information. Limited to what it already knows.
  • Tool use alone: The model calls tools but without explicit reasoning steps. Actions may seem arbitrary and are harder to debug.
  • ReAct: Combines both, getting the benefits of structured reasoning and real-world interaction.

Implementation considerations

ReAct loops need termination conditions β€” a maximum number of iterations, a completion check, or a confidence threshold β€” to prevent infinite loops. Each iteration consumes tokens and adds latency, so the pattern works best when the task genuinely requires multiple steps of investigation or action.

Where ReAct shines

Research tasks, data analysis, troubleshooting, and any workflow where the next step depends on what was discovered in the previous step. It is less useful for simple, predictable tasks where a single model call suffices.

Want to go deeper?
This topic is covered in our Advanced level. Access all 60+ lessons free.

Why This Matters

The ReAct pattern is the foundation of most modern AI agent implementations. Understanding it helps you evaluate agent products, debug agent behaviour, and design workflows that are transparent and reliable.

Related Terms

Learn More

Continue learning in Advanced

This topic is covered in our lesson: Building Your Own AI Solutions