ReAct agents use a repeating pattern: a model decides what information or action it needs, an application executes an approved tool request, and the model uses the returned observation to choose what happens next. For example, a support agent can request an order lookup, receive the current status, then draft an answer or route the case to a person. The application, not the model’s prose, performs the lookup.
ReAct means reasoning and acting. The research pattern interleaves model reasoning traces with task-specific actions and observations. It is not a universal runtime, API, or guarantee of correct answers. The paper appeared as a 2022 preprint and was published at ICLR 2023. In practice, a ReAct-style loop needs a model, tool definitions, an execution layer, state, validation, and explicit stopping rules. Read the original ReAct paper for the task-specific research context.
This article treats ReAct as an operational design pattern rather than a promise of autonomous reliability. The useful question is not whether a model can call a tool, but whether the surrounding workflow can validate the request, control side effects, preserve evidence, and assign ownership when the result is incomplete.
What is a ReAct agent?
An ordinary text-generation prompt asks a model to answer from its available context. Tool or function calling lets a model return a structured request, such as a function name and arguments. Application code then decides whether to execute it, runs the function, and can send the result back to the model. Google’s Gemini function-calling documentation describes this application-side execution cycle.
A complete workflow adds approved tools, permission checks, state, validation, error handling, and decisions about whether to continue, stop, or ask a person. Retrieved information is evidence to evaluate, not an automatic truth guarantee. A source can be stale, incomplete, irrelevant, or conflicting. Require evidence for factual claims and define what happens when evidence is missing.
How the reasoning, action, and observation loop works
A practical loop starts with the task and the state already collected. The model proposes a bounded next step. The execution layer checks the request and calls an allowed tool. The workflow records the result or error. Then the model or a deterministic rule selects the next step. A read action, such as searching an order, is different from a write action, such as issuing a refund or changing a CRM record.
Here is a hypothetical support trace. The field names are an implementation example, not a standard ReAct API:
Stage: tool_request
Tool: order_lookup
Arguments:
order_id: "ord_illustrative_1042"
Validation: order_id present; caller permitted to view order
Stage: tool_result
Status: success
Observation:
shipment_status: "delayed"
last_updated: "2026-04-12T10:30:00Z"
Stage: next_decision
Action: draft_reply
Evidence: order_lookup result above
Review_required: true
Give the loop an exit condition: sufficient evidence for a response, a fixed maximum number of tool rounds, a tool failure that needs escalation, or a policy rule requiring human review. Record the requested tool and arguments, execution status, relevant result or evidence, and the decision that followed. An audit record does not require exposing a model’s private chain-of-thought.
For operational traceability, log what the agent requested, what the tool returned, and what decision followed. Do not make access to private chain-of-thought a logging requirement.
A practical ReAct design for customer support
Consider a hypothetical workflow triggered by a new support email. The input includes the message, sender ID, thread ID, and a stable source event ID. The support platform remains the system of record for the conversation. The knowledge base owns product guidance. A named support operations queue owns ambiguous identity, conflicting records, sensitive cases, and unresolved tool errors.
Bound the model’s work to classifying an allowed category, proposing a search query, summarizing retrieved evidence, drafting a reply, and flagging review. Do not let model confidence decide whether a customer is authorized for a refund or whether a consequential action is permitted. A possible output contract is:
{
"category": "billing",
"urgency": "normal",
"search_query": "refund timing policy",
"source_records": [
{
"source_id": "kb_illustrative_8",
"source_url": "https://example.org/policy",
"retrieved_at": "2026-04-12T10:30:00Z",
"excerpt": "Illustrative retrieved policy text"
}
],
"draft_reply": "Illustrative draft for review.",
"review_required": true,
"reason_code": "billing_policy_review"
}
Validate required fields, types, and allowed values before routing. Check that externally verifiable statements in the draft are supported by retrieved records. Match an order or ticket using a stable identifier, not just a name or a model-generated guess. If evidence is absent or conflicting, do not fill the gap with a plausible answer. Route it to the support owner.
This is an illustrative adaptation of the LangGraph instructional customer-support graph, which documents classification, search, ticketing, drafting, review, and sending patterns. It is not a ready-to-deploy support integration.
| Trigger | AI job | Validation and action | Fallback |
|---|---|---|---|
| Support email | Classify, search, draft | Check evidence and customer ID; save to support thread | Support operations handles conflicting identity or sensitive cases |
| Policy question | Form subqueries, compare records, draft a sourced summary | Map claims to source records; answer or create a review request | Subject-matter reviewer resolves conflicting evidence |
| CRM update | Propose a change from an approved source | Verify record ID and field rules; write only after the pre-write gate | CRM owner handles ambiguous matches or protected fields |
How to make the loop controllable
Define each tool as an interface contract: its purpose, required arguments, allowed values, read or write status, expected result fields, common errors, reversibility, and whether repeating the call is safe. Validate structured model output before execution. Use deterministic rules for authorization, protected fields, amounts, and required identifiers. Reserve the model for semantic tasks such as classifying a message or summarizing evidence.
Put a gate in front of CRM writes
Before a CRM update, verify the matched record ID, compare proposed values with current values, reject protected-field changes, and check whether the source event has already been processed. Route low-confidence matches or policy-controlled changes for approval. After writing, inspect the returned result and confirm the intended record and fields changed. A successful tool response alone does not prove that the intended business process completed.
Prevent duplicate processing at the correct data grain. For an inbound event, a useful key is the source system plus its stable event ID. For an individual tool action, use a key that distinguishes the workflow run, step, action, and target. For citation records, include the workflow run, source URL, retrieved version or content hash, and citation position when multiple citations can come from one source. For an aggregate report, use the entity, reporting period, model, prompt version, and metric definition. Do not store a run-level summary at the same grain as an individual observation.
When concurrent workers are possible, enforce uniqueness with a database constraint or use a transactional upsert. A check-then-create sequence can still create duplicates if two workers pass the check at the same time. Keep raw source events, parsed fields, model decisions, tool requests, tool responses, approvals, final writes, and citation records distinct so an owner can identify where a failure occurred.
Represent retrieval outcomes separately: results found, valid empty result, permission denied, timeout, rate limit, malformed response, and ambiguous match. Set bounded retries for transient failures, but do not blindly retry a non-idempotent write. Keep the event ID, run ID, evidence references, tool results, approval, and final destination in workflow state so an owner can resume or audit the case.
A unique key must match the row being protected. Use a source event key for event ingestion, a run and step key for a tool action, and a citation-level key for evidence records. A single workflow run ID is not enough when one run can create several calls or citations.
For teams connecting configured app actions to an agent, Zapier automation services may be relevant. The controls above remain workflow design requirements, not implied features of an app connector.
When to choose ReAct and when not to
Use fixed rules, filters, or a conventional workflow when the steps are stable, inputs are structured, and branches can be written and tested explicitly. Consider a bounded ReAct loop when the next action should depend on information retrieved during the run, available sources vary, or the task must choose among several tools.
A practical rule is simple: if the same input should always follow the same known path, start with deterministic automation. If an observation should change the next step, test an agent against that baseline. Each additional model or tool round can add latency, cost, context, and a failure point. Measure tool-selection accuracy, evidence support, completion rate, escalation quality, latency, and cost on representative requests.
The original ReAct paper reports results for its evaluated tasks and setup. It does not show that ReAct is the best architecture for every workflow or that tool use guarantees factual answers.
Implementation options and what they actually provide
LangGraph documents graph nodes, shared state, retries for transient failures, and human interruption with a checkpointer and a thread ID used to resume execution. These are implementation primitives for explicit branching and review, not a turnkey support system or a universal production recommendation.
Gemini function calling provides a model-generated function name and structured arguments, but application code executes the function and returns its result. Structured output is also distinct from a function request: returning valid JSON does not validate permissions or carry out a downstream action.
Zapier MCP connects a compatible client to configured app tools through a Zapier MCP server. The client requests a tool, Zapier executes the configured action, and the result returns to the client. Its MCP quickstart covers creating a server, adding tools, connecting a client, and testing. The official overview says the client must support Streamable HTTP and that SSE is not supported. MCP supplies app actions, not an explicit ReAct loop or business rules for validation, approval, deduplication, or safe retries. Check current product compatibility, plan usage, and documentation before implementation.
Use a graph when explicit state, branching, retries, and review steps are central. Use an MCP integration to expose configured app actions to a compatible client. In either case, the builder remains responsible for the surrounding execution policy, permissions, state model, evidence handling, and side-effect controls.
A small pilot before production
Build a test set with routine requests as well as missing data, conflicting sources, permission failures, ambiguous identity, and duplicate events. Compare the agent with a deterministic baseline. Start with read-only tools or draft-only output. Grant write access only after target selection, validation, approval policy, and duplicate prevention have been tested.
- Representative tests cover normal, missing, conflicting, denied, ambiguous, and duplicate cases.
- Success measures include completion, evidence support, tool choice, escalation quality, latency, and cost.
- Permissions are bounded, and consequential actions have a defined approval rule.
- Duplicate events are blocked with a stable key and database-enforced uniqueness or an atomic upsert where concurrency matters.
- A named owner handles exceptions, credentials, tool changes, review queues, and incident follow-up.
Expand only if the agent meets the defined measures against the baseline without unacceptable unsupported answers, duplicate side effects, or unresolved ownership gaps. Keep the initial pilot narrow, review failures, and widen permissions only when the workflow demonstrates that its gates work.
Teams evaluating the surrounding workflow, permissions, and implementation approach can explore AI agent design and implementation. The appropriate starting point is a bounded process with measurable outcomes, not an assumption that every workflow needs an autonomous loop.
