ReAct — Reason, Act, Observe
A customer asked, "Has order 4471 shipped, and when will it arrive?" Answering from the model alone produced a confident, invented delivery date. The shop's order system knows the real answer. The job is to let the model reason about what it needs, go and get it, and then reason from what it actually found.
The rule
Think, act, then look at the real result — and repeat.
ReAct (short for reason + act) interleaves three kinds of step:
- Thought — the model reasons about what it knows and what it needs next.
- Action — the model calls a tool with a specific input: search, database lookup, calculator.
- Observation — the tool's real output is added to the context. The model did not write it; the system did.
The loop repeats until the model has enough to give a final answer. This is the basic pattern behind most AI agents.
Question: Has order 4471 shipped, and when will it arrive?
Thought: I need the order's current status.
Action: lookup_order(4471)
Observation: status=shipped; shipped_on=3 June; carrier_eta=6 June
Thought: I have both facts the customer asked for.
Answer: Yes — your order shipped on 3 June and should arrive around 6 June.ReAct combines two earlier ideas. Like chain-of-thought, it reasons in steps. Like retrieval, it grounds the answer in real data. And because the observation comes from a real system, the model's next thought responds to facts rather than its own guesses, which cuts hallucination sharply.
In a real application, a program sits in the loop: when the model writes an action, the program pauses generation, runs the tool, pastes the result in as the observation, and lets the model continue. Modern APIs support this directly through tool calling, where the model emits a structured request instead of plain text.