TL;DRReAct interleaves reasoning and actions — think, act (use a tool), observe, repeat.
The ReAct pattern lets a model alternate between reasoning ("I should look up X") and acting (calling a tool, searching, running code), then observing the result and continuing. This grounds reasoning in real data and tool outputs instead of pure recall, reducing hallucination. It's the conceptual backbone of tool-using agents — reason about what to do, do it, learn from the result, loop.
Key points
Interleave reasoning and actions
Think → act (tool) → observe → repeat
Grounds answers in real tool outputs
The backbone of tool-using agents
Common mistakes
Letting the loop run unbounded
No error handling on failed actions
Reasoning that ignores the observations
Try it: Trace a ReAct loop for "what’s the weather in the user’s city?".
Example code
<!doctype html><html><head><meta charset="utf-8"></head>
<body style="background:#06040d;color:#e6e0ff;font-family:monospace;padding:20px"><pre>think: need the city → act: get_location()
observe: "NYC" → act: get_weather("NYC")
observe: 21°C → answer</pre></body></html>