ReAct Prompting
Definition
ReAct (Reasoning + Acting) prompting combines chain-of-thought reasoning with action execution, creating agents that think about what to do, take actions, observe results, and iterate.
Why It Matters
ReAct bridges the gap between reasoning and action. Instead of just generating text, ReAct-style agents can search for information, use tools, and interact with external systems while maintaining explicit reasoning about their choices. This makes AI agents more capable and their behavior more interpretable.
How It Works
ReAct follows a loop:
- Thought: “I need to find out X to answer this question”
- Action: search(“query”) or call_tool(“function”)
- Observation: [result from the action]
- Repeat until the task is complete
- Final Answer: synthesize the gathered information
When to Use
Use ReAct prompting for: building agents that use external tools, tasks requiring information lookup, multi-step problems with intermediate actions, and situations where you need transparency into agent reasoning. For pure reasoning without external actions, standard chain-of-thought is simpler.
Source
ReAct prompts LLMs to generate reasoning traces and task-specific actions in an interleaved manner, improving performance on knowledge-intensive tasks.
https://arxiv.org/abs/2210.03629