4.1.1. Amazon Bedrock Agents and Strands Agents
💡 First Principle: Amazon Bedrock Agents manages the reasoning loop, tool orchestration, session memory, and response synthesis as a fully managed service — you define what tools exist and what the agent should accomplish, and Bedrock handles the iterative planning and execution. This eliminates thousands of lines of orchestration code.
Bedrock Agents architecture — the key components:
Agent configuration — what you define:
| Component | What It Is | Configuration |
|---|---|---|
| Foundation Model | The reasoning engine | Choose any Bedrock model |
| Instructions | The agent's operating mandate | System-prompt-level instructions |
| Action Groups | Tools the agent can call | Lambda functions + OpenAPI schema describing parameters |
| Knowledge Bases | Documents the agent can search | Attach existing Bedrock Knowledge Base |
| Memory | Cross-session context persistence | Enable session memory (stored in managed store) |
| Guardrails | Content safety enforcement | Attach Bedrock Guardrails configuration |
Action Group definition — the exam-critical pattern: Each action group requires an OpenAPI schema that tells the agent what the tool does, what parameters it accepts, and what it returns. The agent uses this schema to decide when and how to call the tool:
# Lambda function implementing an action group tool
def lambda_handler(event, context):
action = event['actionGroup']
api_path = event['apiPath']
if api_path == '/get-customer-orders':
customer_id = event['requestBody']['content']['application/json']['properties'][0]['value']
# Query DynamoDB for customer orders
orders = query_orders(customer_id)
return {
'messageVersion': '1.0',
'response': {
'actionGroup': action,
'apiPath': api_path,
'httpStatusCode': 200,
'responseBody': {'application/json': {'body': json.dumps(orders)}}
}
}
AWS Strands Agents — the open-source, code-first framework launched in 2025. Where Bedrock Agents is configuration-driven (no-code/low-code), Strands is Python-first for developers who need full programmatic control:
from strands import Agent, tool
from strands_tools import use_aws
@tool
def search_orders(customer_id: str) -> dict:
"""Search customer order history by customer ID."""
return query_dynamodb(customer_id)
@tool
def update_order_status(order_id: str, status: str) -> str:
"""Update the status of an existing order."""
return update_dynamodb(order_id, status)
agent = Agent(
model="us.anthropic.claude-3-5-sonnet-20241022-v2:0",
tools=[search_orders, update_order_status, use_aws],
system_prompt="You are an order management assistant..."
)
response = agent("Find all pending orders for customer C-12345 and mark them as processing")
AWS Agent Squad for multi-agent coordination:
⚠️ Exam Trap: Bedrock Agents adds latency proportional to the number of reasoning steps — a 5-step task may take 15–45 seconds end-to-end. For latency-sensitive user-facing applications with SLAs under 5 seconds, simple prompt chaining via Bedrock Prompt Flows or direct InvokeModel calls are more appropriate than Bedrock Agents.
Reflection Question: You need to build a system that answers questions about internal HR documents AND can submit time-off requests to Workday via REST API. Which Bedrock Agents components do you configure for each capability, and what Lambda function pattern implements the Workday integration?