ReAct makes a model think, act, observe, and repeat until it reaches an answer.
ConceptWhat it is
ReAct, short for Reason and Act, is an agent pattern where the model alternates between generating a reasoning trace and taking an action, observing the result before deciding its next reasoning step.
It exists because pure chain-of-thought reasoning can drift ungrounded from reality, while pure tool-calling lacks visible justification; interleaving the two keeps the model's plan anchored to actual observations at each step.
How it worksThe mechanics
The model produces a thought describing what it should do next, followed by an action such as a tool call, then receives an observation with the result; this thought-action-observation cycle repeats, with each new thought conditioned on prior observations, until the model emits a final answer.
At a glanceSee it
Zoom in and the abstract loop is really a growing scratchpad — re-feeding the full transcript each turn is what grounds every claim, and also what makes tokens per turn climb toward the context limit.
A tool failure is just another observation, so the model reads the error and re-plans — self-correcting unless the same error recurs until the step cap forces a stop.
When to use itWhere it fits
- Multi-step research or lookup tasks needing iterative refinement.
- Tasks where each action's result should inform the next reasoning step.
- Debuggable agents where visible reasoning traces aid trust and troubleshooting.
- Question answering that requires several tool calls before converging.
When NOT to use itLimits & anti-patterns
- Single-step lookups, where the reasoning loop adds unnecessary overhead.
- Cost-sensitive applications, since each loop iteration is an extra model call.
- Tasks needing strict determinism, where a fixed pipeline is more predictable than open-ended looping.
Trade-offsAdvantages & costs
Advantages
- Grounds reasoning in real observations rather than pure speculation.
- Visible thought traces improve interpretability and debugging.
- Flexible enough to handle unforeseen intermediate results.
- Simple pattern to implement on top of existing tool-calling support.
Trade-offs & costs
- Can loop longer than necessary, increasing latency and cost.
- Risk of the model getting stuck in repetitive or circular reasoning.
- Reasoning traces can leak sensitive intermediate details if exposed to users.
- Harder to bound worst-case run time without explicit step limits.
ExampleIn the real world
A financial-research agent uses a ReAct loop to look up a company's latest filing, reason about what additional data it needs, query a market-data API, and iterate until it can produce a grounded valuation summary.
ToolsHow to implement it
- LangChain ReAct agentprebuilt implementation of the thought-action-observation loop.
- LangGraphmodels the loop explicitly as a cyclical graph with state.
- OpenAI or Claude tool usesupplies the underlying action-calling mechanism.
- LangSmithtraces and visualizes each thought-action-observation step.
Cost & effortWhat it takes
Cost and latency scale linearly with the number of loop iterations, each an extra model call. Engineering effort is low to prototype, moderate to add step limits and guardrails for production.