CH 02 · ReAct, Reasoning and Acting Together · 03/06
Read as one pageThe core loop: Thought, Action, Observation
ReAct runs the model in a loop of three repeating moves:
- Thought: the model reasons about what it knows and what it needs next.
- Action: the model uses a tool, for example searching the web or a database. This is its tool use.
- Observation: the result of the action comes back and the model reads it.
Then it loops again, thinking about the new observation, taking another action, and so on, until it has enough to answer.
flowchart TD
Q[Question] --> T[Thought:<br/>what do I need to find out?]
T --> A[Action:<br/>use a tool, e.g. search]
A --> O[Observation:<br/>read the tool's result]
O --> D{Enough to answer?}
D -->|No| T
D -->|Yes| Ans[Final answer]
The crucial design choice is the observation and action cycle. The model is no longer reasoning in a sealed box; each loop pulls fresh, real information in, which the next thought can use.
Field check
See it worked. Then try it.
An observation comes from the environment. A plausible thought is not evidence that an action succeeded.
Worked example
Thought: the page probably contains the launch date. Action: open the page. Observation: the page returns a 404.
The next step must account for the 404, rather than treating the predicted date as retrieved evidence.
Finished this idea?
Your learning progress stays in this browser.