Building Agents in Code with Strands Agents
This lesson covers Strands Agents, the open-source AWS SDK for building agents in code with a model-driven approach, and how Strands agents are deployed.
Learning outcomes
After completing this lesson, you will be able to:
- Create an agent with a model, system prompt and tools.
- Add tools, MCP servers and hooks.
- Choose a multi-agent pattern and deployment target.
- Choose between Strands Agents and Bedrock Agents.
The model-driven approach
In Strands Agents, an Agent is created with a model, a system prompt and a list of tools, then called with a user message. The SDK runs the agent loop: it sends the conversation and tool definitions to the model, executes requested tools, returns results and repeats until the model finishes. Amazon Bedrock is the default model provider, and other providers can be configured. Because the model drives the plan, adding a capability usually means adding a tool rather than writing workflow code.
from strands import Agent, tool
from strands.models import BedrockModel
@tool
def get_order_status(order_id: str) -> dict:
'''Return the live status and estimated delivery date of an order.
Args:
order_id: Order number such as "1182".
'''
return orders_api.status(order_id)
agent = Agent(
model=BedrockModel(model_id="us.amazon.nova-pro-v1:0", temperature=0.2),
system_prompt="You are a retail support agent. Use tools for any order question.",
tools=[get_order_status],
)
result = agent("Where is order 1182?")Tools, MCP and custom behaviours
A Python function decorated with @tool becomes a tool; its docstring and type hints form the description and input schema. Strands also includes prebuilt tools and connects to MCP servers through an MCP client, so tools hosted elsewhere are used like local ones. Hooks and callback handlers add custom behaviour around the loop, such as logging each tool call, blocking a tool that needs approval, or rewriting arguments.
Conversation managers keep context within limits (sliding window or summarisation), and session managers persist agent state, for example to S3, so a conversation can continue across requests. Strands emits OpenTelemetry traces and metrics for observability.
Strands Agents essentials
Multi-agent patterns and deployment
Strands supports several multi-agent patterns: agents as tools, where an orchestrator agent calls specialist agents wrapped as tools; swarms, where agents hand tasks to each other autonomously; graphs, where agents are connected in a defined structure with conditional edges; and workflows of dependent tasks. It also supports the Agent2Agent (A2A) protocol for agents to communicate across frameworks.
Strands agents run anywhere Python runs: in Amazon Bedrock AgentCore Runtime for managed, session-isolated hosting, in Lambda for short tasks, or in containers on ECS, EKS or Fargate. The following table compares Strands with Bedrock Agents.
The following diagram shows the agent, its tools and where it runs.

Strands multi-agent patterns
Choosing a framework
A development team needs an agent that uses tools from three internal MCP servers, requires custom logic to block certain tool calls pending approval, and must run with session isolation and minimal infrastructure management.
Strands Agents provides MCP clients and hooks for the approval logic, and AgentCore Runtime hosts it with session isolation and no servers to manage. Bedrock Agents would require wrapping the MCP tools as action groups and offers less control over the loop.
Where does Strands take a tool's description and parameters from?
Show answer
From the @tool function's docstring and type hints.
Exam Tips
Remember for the exam
- Strands: model + system prompt + tools; the model drives the plan.
- @tool docstrings and type hints become the tool definition.
- MCP client, hooks, conversation and session managers.
- Multi-agent: agents as tools, swarm, graph, workflow.
- Host on AgentCore Runtime, Lambda or containers.