concept
ReAct Pattern
created 2026-04-27 ai · agents · react · langgraph · pattern
ReAct Pattern
ReAct (Reasoning + Acting) is the foundational agent loop. The LLM alternates between reasoning about the task, calling a tool, and observing the result. Introduced by Yao et al. (2022), it is now the default agent pattern in LangGraph.
The Loop
1. THINK — LLM reasons about what to do next (internal chain-of-thought)
2. ACT — LLM emits a tool call with arguments
3. OBSERVE — Tool executes, result is appended to message history
4. REPEAT — Loop back to THINK until LLM produces a final answer (no tool call)
LangGraph Implementation
LangGraph implements ReAct as a two-node graph with a conditional edge:
[LLM Node] → has tool calls? → YES → [Tool Node] → back to [LLM Node]
→ NO → END
from langchain.agents import create_agent
agent = create_agent(
model="anthropic:claude-sonnet-4-6",
tools=[search, calculate, format_output],
system_prompt="You are a helpful assistant."
)
The create_agent() function (previously create_react_agent()) builds this graph, binds tools to the model, and handles the conditional routing.
Key Parameters
model— LLM identifier or instancetools— list of tool functionssystem_prompt— agent instructionsresponse_format— structured output schema (optional)state_schema— custom state beyond messages (optional)middleware— hooks for modifying model requests/responsesname— identifier for multi-agent systems
Practical Limits
ReAct works well with 1-12 tools in a single domain for tasks requiring <10 tool calls. Beyond these thresholds, consider AI Agent Architectures|multi-agent patterns:
- >12 tools: LLM struggles to select correctly. Use skills or subagents.
- >10 sequential tool calls: Context bloat. Use subagents for isolation.
- Multiple domains: Single prompt can’t specialize. Use handoffs or subagents.
- Complex planning: ReAct has no explicit planning step. Consider plan-then-execute patterns.
In kulify Projects
- fajb-next:
createReactAgent()with 12+ tools for article editing - master-bot: Simple agent loop with availability tools
- Vorma (Furniq): Tools return
__stateUpdatefor 3D config
Related
- AI Agent Architectures — full spectrum from ReAct to deep agents
- LangGraph Agent Pattern — recurring pattern across projects
- LangGraph Multi-Agent Patterns — what comes after ReAct