Deconstructing Yao et al.'s Reasoning and Acting Framework
ReAct stands for Reasoning + Acting. Instead of guessing an answer or blindly running scripts, an agent talks to itself in a structured loop: THOUGHT (analyzing what information is missing), ACTION (calling a specific tool to fetch it), and OBSERVATION (reading what the tool returned). It repeats this cycle until the goal is solved.
The ReAct Cognitive Cycle
- 11. Thought (Deliberation)The agent analyzes the user's request and states its reasoning plan: 'I need to check the inventory database first.'
- 22. Action (Tool Invocation)The agent halts text generation and emits a structured function call: 'call_sql_query({ sku: 'WIDGET-99' })'.
- 33. Observation (Feedback)The execution engine runs the tool and returns the result: 'Stock: 0; Next shipment: Tomorrow at 9 AM.'
- 44. Final Answer (Resolution)The agent digests the observation and responds to user: 'Widget-99 is out of stock today, but 50 units arrive tomorrow.'