← AI Terminology
ReAct
ReAct (Reasoning + Acting) is a prompting and agent framework that interleaves explicit reasoning traces ("Thought:") with tool-use actions ("Action:") and observations ("Observation:") — enabling LLMs to reason about what to do next based on prior observations rather than acting blindly.
It is the foundational architecture for LLM agents with tool use.
It is the foundational architecture for LLM agents with tool use.
Why It Matters in AI
Standard LLM tool use can be brittle: the model calls a tool, gets a result, and must implicitly reason about what it means. ReAct externalises the reasoning — the model explicitly writes out its thinking ("I need to search for X because Y") before acting, then incorporates the observation into its next thought. This improves task success rates dramatically, allows debugging of agent reasoning traces, and enables multi-step tool use chains where each step builds on prior observations.
Key Points
| Aspect | Description |
|---|---|
| Paper | Yao et al. 2022: "ReAct: Synergizing Reasoning and Acting in Language Models" |
| Action | Tool call with arguments — search, calculate, look_up, etc. |
| Thought | Free-text reasoning about current state, plan, and next step — not sent to the tool |
| LangChain | create_react_agent(llm, tools) — standard ReAct agent implementation |
| Structure | Thought → Action → Observation → Thought → Action… repeating until a Final Answer is produced |
| Observation | Tool output returned to the model — feeds into the next Thought |
Simple Analogy
A detective narrating their case file: "I need to check where the suspect was at 9pm (Thought). I'll review the hotel records (Action). The records show a check-in at 9:15pm (Observation). This means the suspect couldn't have committed the 9pm crime (Thought)." Each step of reasoning is explicit and informed by the prior observation — far more reliable than jumping to conclusions.
Common Usage Examples
- LangChain:
agent = create_react_agent(llm, tools=[search, calculator]); AgentExecutor(agent, tools).invoke({"input": "..."}) - Manual ReAct prompt:
"Thought: I should search for the current price. Action: search["NVDA stock price"]" Observation: NVDA is trading at $135. Thought: Now I need to calculate the portfolio value…- HuggingFace smolagents:
CodeAgent(tools=[search_tool], model=llm)— ReAct-based agent framework - Claude tool use:
tool_usecontent blocks naturally implement ReAct — each tool call + result is a cycle
Summary
In short: ReAct interleaves explicit reasoning traces with tool-use actions and observations — the foundational architecture for reliable LLM agents, enabling step-by-step multi-tool workflows where each action is grounded in prior reasoning.