ReAct Prompting
A prompting framework that combines reasoning traces with action-taking, enabling AI to think and act interleaved.
Also known as: Reasoning and Acting, ReAct Framework, Reason-Act Loop
Category: Techniques
Tags: ai, prompting, ai-agents, reasoning, llm-techniques, tool-use
Explanation
ReAct (Reasoning + Acting) is a prompting paradigm that interleaves reasoning with actions, allowing language models to both think through problems and interact with external tools or environments. Unlike pure reasoning approaches, ReAct grounds thinking in real-world feedback.
The ReAct loop follows this pattern:
1. **Thought**: The model reasons about what to do next
2. **Action**: The model takes an action (search, lookup, calculate, etc.)
3. **Observation**: The result of the action is observed
4. **Repeat**: Continue until the task is complete
Example ReAct trace:
- Thought: I need to find when Einstein was born
- Action: Search[Albert Einstein birthday]
- Observation: Albert Einstein was born March 14, 1879
- Thought: Now I can answer the question
- Action: Finish[March 14, 1879]
Key benefits:
- **Grounded reasoning**: Actions provide real information rather than relying solely on model knowledge
- **Transparent process**: The reasoning trace shows how conclusions were reached
- **Error recovery**: If an action fails, the model can reason about alternatives
- **Tool use**: Naturally extends to using APIs, databases, and other tools
ReAct is foundational to modern AI agents and coding assistants that need to gather information, execute code, and iteratively solve problems. It bridges pure language reasoning with practical task completion.
Related Concepts
← Back to all concepts