Agents

ReAct pattern

ReAct alternates model reasoning, actions, and observations in a task loop.

ThoughtActionObservation
ReAct alternates model reasoning, actions, and observations in a task loop. Values shown in the worked visual are illustrative unless the labels state otherwise.

How it works

Each observation updates the next decision instead of relying on a fixed initial plan. The loop needs a stopping condition and protection against repeated ineffective actions.

A concrete example

Illustrative: search once, inspect 3 results, calculate 2 values, then answer.

Do not confuse it with Chain of thought

ReAct couples reasoning to external actions; chain of thought alone may remain internal text.

Study the full lesson