ReAct
The Reasoning + Acting pattern where an LLM alternates between thinking out loud and calling tools, the foundation of most modern AI agents.
What Is ReAct
ReAct (Reasoning + Acting) is the agent loop pattern introduced by Yao et al. in 2022, where an LLM alternates between two kinds of output: Thought (reasoning about what to do next) and Action (calling a tool or API). The model observes the tool’s result, reasons again, acts again, and repeats until the task is done. Use the term whenever you’re describing how a tool-using agent actually decides what to do.
How It Works
- Thought — natural-language reasoning step, e.g., “The user wants weather; I need to call the weather API for their city.”
- Action — structured tool invocation, e.g.,
getWeather(city="Kyiv") - Observation — the tool’s return value, fed back into the model’s context
- Loop — Thought → Action → Observation, repeated until the model emits a final answer instead of another action
Modern implementations often skip the explicit “Thought:” prefix (the model still reasons internally via chain-of-thought) and just alternate tool calls with model responses. Function calling and MCP are infrastructure layers that make ReAct loops reliable in production.
Why It Matters
ReAct is the design pattern behind every coding agent (Claude Code, Cursor Composer, Cline), every research agent (Perplexity’s agentic search, OpenAI’s deep research), and most multi-step workflows in LangGraph, CrewAI, and AutoGen. If you’ve ever wondered “how does this agent know to call a tool,” the answer is some variant of ReAct.
Examples
- Claude Code — runs a ReAct loop over Read / Edit / Bash / Glob tools
- Cursor Composer — ReAct over file-system and shell tools
- Perplexity Deep Research — ReAct over web search and page fetch
- OpenAI Operator — ReAct over browser actions (click, type, scroll)