Pattern · beginner
ReAct Pattern
ReAct interleaves reasoning traces with tool actions so agents can think, act, and observe in a loop.
ReAct (Reason + Act) is an agent pattern that interleaves intermediate reasoning with tool use. The model writes a thought, chooses an action, observes the result, and repeats.
When to use
- Tasks needing adaptive tool use
- Debugging-friendly traces (thoughts + actions)
- Single-agent problems without heavy multi-actor coordination
Structure
Thought: ...
Action: tool_name(args)
Observation: ...
Thought: ...
Action: finish(answer)
In modern stacks, “Thought” may be internal, and actions are structured function calls—but the loop is the same.
Implementation notes
- Cap iterations
- Feed tool errors back as observations
- Prefer structured actions over free-text tool DSL when possible
- Don’t require verbose thoughts in production if latency/cost dominate—keep the loop
Failure modes
- Verbose reasoning without action
- Ignoring observations
- Looping on the same failed action
Evaluation tips
Grade both final answers and whether observations influenced subsequent actions (no “ignore the tool result” behavior).
FAQ
Frequently asked questions
What is the ReAct pattern?
ReAct (Reason + Act) is an agent pattern that alternates explicit reasoning steps with tool actions and observations until the task is complete.