Agent architecture

The ReAct pattern

ReAct (Reason + Act) is an agent pattern where the model interleaves explicit reasoning with tool actions — thinking about what to do, acting, observing the result, then thinking again.

ReAct structures an agent’s turn as a visible chain of Thought → Action → Observation. Instead of jumping straight to a tool call, the model first writes out its reasoning, then chooses an action, then reads the observation before continuing. Making the reasoning explicit improves reliability on multi-step tasks and makes behaviour easier to debug, because you can see why the agent chose each action.

Key points

  • Each step is Thought (reasoning) → Action (tool call) → Observation (result), repeated until done.
  • Writing reasoning before acting improves accuracy on multi-step tasks over acting blindly.
  • The visible thought trace makes agent behaviour far easier to debug and audit.
  • It is a prompting/orchestration pattern layered on top of the tool-use loop, not a model feature.

Learn it by building

Way of the Agent teaches AI agent engineering level by level — concepts like this one, then hands-on practice, XP, and the AI Chronicles.

Start learning free →