Skip to content

Command Palette

Search for a command to run...

← All concepts
Concept

ReAct (Reason + Act)

The canonical agent loop pattern: reason about the task, take an action, observe, repeat.

Simple explanation

ReAct is a way to build agents where the model explicitly reasons ('I need to search for X') before taking an action (calling a tool), then observes the result and reasons again. This makes agent behaviour interpretable.

Engineering explanation

ReAct interleaves Thought (reasoning), Action (tool call) and Observation (tool result) steps. Modern implementations use native function calling rather than text-based ReAct prompting, but the pattern is the same: the model decides which tool, executes, observes, loops. Production ReAct needs a concrete stopping condition ('answer when you have 3 sources'), not 'be thorough'.

Example

Thought: I need weather data. Action: get_weather('Tokyo'). Observation: {temp: 18}. Thought: I have the answer. Final: 'Tokyo is 18°C.'

When to use it

Any agent that uses tools. It's the default pattern — even frameworks like LangGraph implement ReAct under the hood.

Common misconception

ReAct does NOT expose chain-of-thought to users in production. Show only safe traces (tool calls, observations), not the model's internal reasoning.

Related concepts
Learn this in depth
Related architectures