# ReAct

ReAct is an agent design pattern that interleaves reasoning, tool actions, and observations so a foundation model can solve problems using external evidence.

Cloud concept. Updated 2026-10-29. Page: https://blowstack.com/tools/cloud-concepts-hub/react

> ReAct, short for reasoning and acting, lets an agent decide what information or operation it needs next, invoke an appropriate tool, and use the result to guide its next decision. It matters when a task requires multiple dependent steps, current information, calculations, or controlled interactions with external systems rather than a single generated answer.

Practice exams covering ReAct: [AIP-C01 AWS Certified Generative AI Developer - Professional](https://blowstack.com/practice-exams/aws-certified-generative-ai-developer-professional).

## 6 key aspects of ReAct

ReAct combines adaptive tool selection and external feedback with explicit execution controls, bounded loops, and outcome-based evaluation.

1. **Interleaved reasoning and action**: The agent selects a next action using its task context and previous observations, rather than committing to an unchanging sequence. Tool results can change both the next step and the final answer.
2. **Evidence-driven problem decomposition**: Complex requests are broken into smaller information-gathering or execution steps. Each step should resolve a specific uncertainty or advance a measurable task objective.
3. **Explicit tool contracts**: Tools expose defined operations with validated inputs and structured results. Keep authorization and execution controls outside the model so generated arguments cannot bypass application policy.
4. **Bounded orchestration**: Use explicit completion conditions, iteration limits, timeouts, and cost budgets. Handle tool failures as observations when recovery is appropriate, and terminate or escalate when progress stops.
5. **Controlled side effects**: Separate read-only investigation from operations that modify resources or business records. Require appropriate approval and use idempotent execution for actions that might be retried.
6. **Observable, testable behavior**: Record tool requests, validated arguments, results, execution status, and concise decision summaries with sensitive data protected. Evaluate observable outcomes without depending on access to private model reasoning.

## Cloud services for ReAct

In a custom implementation, AWS Step Functions coordinates a bounded loop, Amazon Bedrock supplies model inference, and AWS Lambda executes validated tools. Each tool result becomes an observation for the next model invocation until the workflow reaches completion, an approval boundary, or an execution limit. Amazon CloudWatch captures operational signals across these components. Alternatively, Agents for Amazon Bedrock can manage much of the agent orchestration, with Lambda-backed action groups providing application operations. Choose a clear orchestration owner so nested loops do not create uncontrolled retries or unexpected costs.

- **[AWS Step Functions](https://blowstack.com/tools/cloud-services-hub/aws-step-functions)**: Implements the control flow around a ReAct agent using Task and Choice states, explicit loops, retries, and error handling. The application must define the model interaction, tool dispatch, iteration counters, and termination rules.
- **[Amazon Bedrock](https://blowstack.com/tools/cloud-services-hub/amazon-bedrock)**: Provides foundation model inference and, for supported models, tool-use interfaces that an application can use to build a ReAct loop. Agents for Amazon Bedrock provides managed orchestration for multistep tasks involving action groups and knowledge retrieval; this is an alternative to building the entire loop yourself.
- **[AWS Lambda](https://blowstack.com/tools/cloud-services-hub/aws-lambda)**: Runs tool adapters that validate inputs, call business APIs, perform calculations, and return structured observations. Execution roles and application-level authorization constrain what each tool can do.
- **[Amazon CloudWatch](https://blowstack.com/tools/cloud-services-hub/amazon-cloudwatch)**: Collects application logs and metrics for agent iterations, tool errors, latency, and termination outcomes. Use correlation identifiers and redact sensitive inputs and outputs to make investigations useful without unnecessarily exposing data.

## ReAct exam questions

Real practice exam questions on ReAct, with the correct answer and its explanation.

### Question 1 (AIP-C01)

**Question:**

A retailer is validating a returns assistant that uses an Amazon Bedrock foundation model to select read-only tools. For a damaged-item claim, the assistant first retrieves the order. If the order identifies a third-party seller, the assistant must retrieve that seller's return policy. If the order identifies the retailer as the seller, the assistant must retrieve the retailer's policy instead. The seller identity is available only in the order-tool response.

The assistant produces convincing explanations and correct recommendations on common test cases. However, engineers suspect that it sometimes selects subsequent tools from assumptions about the customer request rather than from the actual order result. They need an automated integration test that specifically detects this defect without inspecting the model's private reasoning.

Which test design BEST meets these requirements?

**Correct answer:** Create paired runs with identical requests and pre-tool conversation state, but inject different valid order-tool responses that require different policy lookups. Deliver each response through the normal tool-result path, record subsequent tool requests, and assert that each run requests the policy required by its injected seller identity before recommending a resolution.

**Explanation:** Changing only the tool observation isolates whether the assistant uses external evidence to select its next action. The paired fixtures require different, objectively checkable continuations. Recording actual tool requests tests the observation-to-action dependency central to ReAct without requiring access to private reasoning.

## Practice ReAct in a full exam

Questions on ReAct in each practice exam, with every answer option and an explanation for each:

- [AIP-C01](https://blowstack.com/practice-exams/aws-certified-generative-ai-developer-professional): 8 questions

## What is ReAct

ReAct combines reasoning and acting in an iterative problem-solving loop. An agent evaluates a task and the evidence available so far, selects an action, receives an observation from the environment, and decides whether to continue or provide a final answer. Actions commonly include searching documents, querying a database, running a calculation, or calling an application API. Observations are the actual results of those actions, not results invented by the model.

The central benefit is adaptive decomposition. Instead of generating an entire plan and assuming every step will succeed, the agent can revise its approach after each observation. For example, an incident investigation assistant might retrieve a failed deployment's metadata, inspect relevant error metrics, and then query configuration history only if the first results suggest a configuration change. Each tool result influences what happens next.

In cloud applications, the model usually proposes tool calls while application code or a managed agent runtime executes them. The tool interface should define the operation, input schema, output structure, and expected error responses. The execution layer validates arguments, checks authorization, invokes the tool, and returns a structured observation. A model-generated request is a proposal, not permission to perform an operation.

AWS Step Functions can implement this loop as an explicit workflow. A Task state invokes a foundation model through Amazon Bedrock or application code. A Choice state routes a structured response to tool execution, completion, or error handling. Another Task executes the selected operation, and the workflow adds its result to the interaction context before invoking the model again. The workflow must explicitly track iteration limits, remaining budget, and stopping conditions; Step Functions does not supply ReAct reasoning automatically.

For example, a support agent investigating an incorrect invoice could retrieve the invoice, query the applicable pricing agreement, and calculate the expected amount. If the agreement is missing, the next action should request clarification or escalate rather than invent a discount. Issuing a refund should be a separate, authorized operation with approval requirements and an idempotency key, because retries must not create duplicate financial transactions.

ReAct is related to, but not synonymous with, chain-of-thought reasoning. Chain-of-thought approaches involve intermediate reasoning, whereas ReAct specifically couples decision-making with actions and feedback from the environment. Traditional ReAct demonstrations show thought, action, and observation traces, but production implementations do not need to expose or store private model reasoning. Structured tool requests, observations, concise decision summaries, and final answers provide useful operational records without requiring disclosure of internal reasoning.

The trade-offs include additional model calls, tool latency, token consumption, and more failure paths than a fixed workflow. Agents can repeat unsuccessful actions, choose irrelevant tools, or follow malicious instructions embedded in retrieved content. Enforce maximum iterations, timeouts, bounded retries, least-privilege tool permissions, and approval gates for consequential operations. Treat tool output as untrusted data, not instructions that can override application policy.

ReAct does not guarantee factual correctness, optimal planning, or successful execution. Retrieval-augmented generation alone is not necessarily ReAct, and a single tool call does not establish an iterative reasoning-and-action loop. Prefer deterministic workflows when the required sequence is already known. Evaluate ReAct systems using task success, evidence quality, tool-selection accuracy, unauthorized-action attempts, latency, and cost rather than the apparent sophistication of their explanations.

## Learn ReAct in lessons

2 short lessons on ReAct in 1 certification course.

- AIP-C01: ReAct: implementing a bounded reasoning–action loop (Premium), https://app.blowstack.com/lessons/react-implementing-a-bounded-reasoning-action-loop-aip-c01
- AIP-C01: Chain-of-Thought Prompting vs ReAct (Premium), https://app.blowstack.com/lessons/chain-of-thought-prompting-vs-react-aip-c01
