A ReAct run produces an interleaved trace: Thought ("I need the order before I can check the policy"), Action (lookup_order), Observation (the order record), Thought ("the order is within the return window"), and so on. The structure looks simple, but each observation grounds the next reasoning step in something real, which is precisely what a pure reasoning chain lacks.
Interleaving beats plan-then-execute for open-ended tasks. A plan written up front commits to steps before any facts are known and fails silently when reality diverges. ReAct re-plans after every observation, so a missing record, an empty search or an unexpected error becomes new information rather than a broken plan. The trade-off is latency and cost — every step is a model call — which is why deterministic sub-sequences are lifted out of the loop into ordinary code wherever possible.
Modern frameworks implement the same loop with better plumbing. LangGraph ships a prebuilt ReAct agent as a stateful graph with checkpoints; the OpenAI Agents SDK runs an equivalent loop with handoffs, guardrails and tracing around it. The characteristic production failures are loops that never terminate and reasoning that drifts from the goal, and both are handled the same way: iteration and spend caps enforced in code, typed tools with unambiguous results, and stop conditions checked outside the model.
A concrete run shows why the pattern earns its cost. Asked to refund the order mentioned in an angry email, the agent reasons that it needs the order first, calls lookup_order with the sender's address, reads the record, reasons that the purchase falls inside the returns window, calls check_policy to confirm, then issues the refund and drafts the reply. Each step depends on facts only the previous action could supply, so no plan written in advance could have contained them. That dependence on unknown intermediate facts is the dividing line between tasks that need the loop and tasks that need a script.
Where teams go wrong is leaving deterministic work inside the loop. If steps two through five always run in the same order whenever step one succeeds, that sequence is code rather than reasoning, and routing it through a model adds cost, latency and a chance of deviation for no benefit. The mature form of most production agents is a ReAct loop wrapped around a small number of genuine decision points, with everything between those points compiled down to ordinary functions that run exactly the same way every time.
Codazz builds this in production — AI Agent Development.