Architecture

ReAct Pattern

An agent execution pattern combining Reasoning and Acting: the LLM explicitly reasons about what action to take, acts via tool calls, observes results, and repeats until the task is complete.

Definition

The ReAct Pattern is an agent execution pattern that combines Reasoning and Acting into an interleaved cycle. In each iteration, the LLM produces an explicit Thought (reasoning about the current situation and what to do next), then an Action (a tool call with specific arguments), then receives an Observation (the result of the tool call), before reasoning again. This Thought-Action-Observation cycle repeats until the agent determines the task is complete. The explicit reasoning step makes agent behavior interpretable and debuggable—you can read the chain of thoughts to understand why the agent made each decision.

Engineering Context

ReAct (Reasoning + Acting) was formalized in a 2022 paper and is the basis for many modern agent frameworks including LangChain and LangGraph. The explicit Thought-Action-Observation cycle makes agent behavior interpretable and auditable. In LangGraph, ReAct is implemented via a reasoning node that emits tool calls, followed by tool execution nodes that return observations back into state. The reasoning traces (the "Thought" steps) should be logged in production—they are invaluable for debugging unexpected behavior and for explaining agent decisions to stakeholders. Structured ReAct, with typed JSON for thoughts and observations, improves consistency over free-text formats.

Related Terms

Building production AI agents?

We design and implement deterministic AI agent systems for enterprise teams.

Start Assessment