AI

ReAct

ReAct (Reasoning + Acting): an AI pattern that alternates reasoning and action in a loop, the foundation of how AI agents work.

Bulle de pensée en verre transparent à gauche reliée par un fil de lumière bordeaux ondulant à un engrenage en métal brossé à droite, tous deux dressés sur un sol sombre réfléchissant sous un faisceau blanc
ReAct — Image générée par IA (Qwen-Image 2.1, ComfyUI local)

ReAct (Reasoning + Acting) is the core pattern that makes AI agents work. Formalized by Yao et al. in 2022, it describes an iterative loop in which a language model alternates between reasoning and action — until it reaches a goal or recognizes that it can't make progress.

Technical definition

The principle: think, then act, in a loop

Before ReAct, language models worked in question-answer mode: a prompt in, an answer out, end of interaction. ReAct breaks that pattern by introducing a loop: the model reasons about the situation, decides on an action (call an API, run a search, execute code), observes the result, then reasons again based on that new information.

It's this loop that turns a plain LLM into an agent able to carry out complex missions autonomously.

The four stages of the cycle

  1. Perceive — The agent observes the current state: input data, history of past actions, results of previous steps.
  2. Reason — The LLM analyzes the situation and produces a plan: which sub-task to prioritize, which tool to call, how to phrase the request.
  3. Act — The agent executes the chosen action through a tool: API call, web search, file read, code execution.
  4. Observe — The agent analyzes the result and decides: continue (new iteration), correct (change strategy) or stop (goal reached).

This interactive diagram needs JavaScript.

Run the ReAct loop: perceive, reason, act, observe, and watch the agent correct course when the tool returns an error.

Current challenges

The foundation of agentic AI

ReAct has become the de facto standard for building AI agents. Every major framework — LangGraph, CrewAI, Claude Agent SDK, OpenAI Agents SDK — implements this pattern in one form or another. When people talk about agentic AI, they are fundamentally talking about systems built on the ReAct cycle.

Limits to be aware of

The ReAct cycle can run indefinitely if the agent can't find a solution — that's the infinite-loop risk. Without guardrails (token cap, timeout, maximum number of iterations), a ReAct agent can consume considerable resources without making progress. That's why human in the loop and circuit breaker mechanisms are essential in production.

Frequently Asked Questions

What is the difference between ReAct and Chain-of-Thought (CoT)?

Chain-of-Thought only makes the model reason step by step, without acting on the outside world. ReAct adds an action dimension: the model can call tools (web search, code execution, APIs) between reasoning steps. The observed result feeds the next round of reasoning, creating a self-correcting loop.

How does the ReAct cycle work in an AI agent?

The cycle runs in four stages: perceive (the agent observes the current state), reason (the LLM analyzes and plans), act (execute an action via a tool) and observe (evaluate the result). If the goal isn't reached, the cycle starts again. An agent can chain 10 to 50 iterations for a complex mission.

Which frameworks use the ReAct pattern?

Most AI agent frameworks implement ReAct: LangGraph (LangChain), CrewAI, Claude Agent SDK (Anthropic) and OpenAI Agents SDK. Even no-code agents built in Mistral Le Chat or ChatGPT rely on this cycle, although it stays invisible to the user.

Resources and Documentation