AWS Builder Center
Building My First AI Agent with Strands and Amazon Bedrock: The Code, the Challenges, and the Lessons

Building My First AI Agent with Strands and Amazon Bedrock: The Code, the Challenges, and the Lessons

A hands-on journey building AI agents with Python, Strands Agents, and Amazon Bedrock using Anthropic Claude. From setting up my first agent to troubleshooting unexpected model quota challenges, here's what I learned along the way.

Cloud & AI Builder | Cyber Security Specialist | AWS Community Leader | Uganda 🇺🇬

It started with a simple idea

I've been getting increasingly interested in AI agents and how they can move beyond ordinary question and answer interactions to actually perform tasks, use tools, and help solve real problems.
I wanted to get my hands dirty and understand what building an AI agent really looks like, especially within the AWS ecosystem.
Rather than just reading about agents or watching demonstrations, I decided to build one myself.

For this experiment, I chose Strands Agents, Python, and Amazon Bedrock, using Anthropic Claude as the underlying model.
What attracted me to Strands was its developer friendly approach to agent development. Instead of spending too much time writing orchestration logic from scratch, I could focus on defining what my agent should do and how it should behave.
And that was where the journey began.

Getting started with Strands Agents

Before writing the actual agent, I needed to prepare my development environment.
Since I was using Python, I started by creating a virtual environment and installing the Strands Agents SDK.

python -m venv .venv

Activate the environment:

# Windows
.venv\Scripts\activate
# Linux/macOS
source .venv/bin/activate

Then install the SDK:

pip install strands-agents

I also needed to make sure my AWS credentials were properly configured:

aws configure

This allowed my local Python application to authenticate with AWS services.
One thing worth mentioning is that having AWS credentials alone doesn't automatically mean you can invoke every foundation model available through Amazon Bedrock. You still need the appropriate IAM permissions and model access or inference configuration.

Connecting Strands to Amazon Bedrock

This was probably my favourite part of the setup.
Strands makes it relatively straightforward to connect an agent to a model provider. Amazon Bedrock is supported directly, meaning I didn't have to build a separate integration layer.
I wanted to use Claude, so I configured my agent to use an Anthropic Claude model available through Amazon Bedrock.
A simplified example looks like this:

from strands import Agent
from strands.models import BedrockModel
# Configure the Claude model through Bedrock
model = BedrockModel(
model_id="YOUR_CLAUDE_MODEL_ID",
region_name="YOUR_AWS_REGION",
temperature=0.7
)
# Create the agent
agent = Agent(
model=model,
system_prompt="""
You are a helpful AI assistant.
Provide clear, accurate and useful responses.
"""
)
# Interact with the agent
response = agent("Hello! Introduce yourself.")
print(response)

I used a placeholder for the model ID because the exact Claude model identifier depends on the model version and inference configuration available in your AWS Region.
At this point, I had the basic building blocks:
  • Python as my development language.
  • Strands Agents as the agent framework.
  • Amazon Bedrock as the model service.
  • Anthropic Claude as the foundation model.
It looked like everything was coming together.
But then I encountered a problem I hadn't anticipated.

The unexpected challenge: My Bedrock model quotas were showing zero!

This was the point where things became interesting.
After setting up my environment and configuring the model, I expected to start interacting with Claude through my agent.
Instead, I ran into a model availability and quota issue.
When I checked the relevant model quotas in Amazon Bedrock, I noticed that the values were showing 0.
That was frustrating because I had already done the coding and configuration. I was ready to test my agent, but I couldn't get the model invocation working as expected.
Naturally, I started looking into what could be wrong.
Was it my Python implementation? Had I configured the wrong model ID? Was something missing from my IAM permissions? Or was it an issue with the Bedrock account configuration?
I went through the configurations, reviewed the setup, and tried to understand where the problem was coming from.
Eventually, I decided to take a different approach.

I contacted AWS Support.
Rather than continuing to guess and make random configuration changes, I raised the issue with AWS Support and explained what I was experiencing.
This turned out to be an important decision.
With their assistance, I was able to get the issue addressed and move forward with my development.
It taught me something I think every developer working with cloud services should understand: sometimes the issue isn't in your code. It can be related to service access, account configuration, quotas, or other infrastructure-level restrictions.
There is nothing wrong with asking for support when you've exhausted your troubleshooting options. In fact, knowing when to seek help is part of becoming a better engineer.


Finally, getting my agent to work

Once the Bedrock issue was resolved, I could get back to what I originally wanted to do: building and interacting with my agent.
One thing I appreciated about Strands was how little code was required to get a basic agent running.
But building an agent is not simply about connecting a model to a Python script.
An agent becomes much more interesting when you give it tools.
For example, consider an agent that can perform calculations. Instead of relying entirely on Claude to reason through mathematical operations, you can provide it with an actual Python function.

from strands import Agent, tool
from strands.models import BedrockModel
@tool
def calculate(expression: str) -> str:
"""Evaluate a basic mathematical expression."""
try:
result = eval(expression, {"__builtins__": {}})
return str(result)
except Exception:
return "Unable to calculate the expression."
model = BedrockModel(
model_id="YOUR_CLAUDE_MODEL_ID"
)
agent = Agent(
model=model,
tools=[calculate],
system_prompt="""
You are a helpful assistant.
Use the calculator tool whenever mathematical
calculations are required.
"""
)
response = agent("What is 250 multiplied by 40?")
print(response)

This is where the idea of agentic AI starts becoming clearer.
The model can understand a request, decide when a tool is useful, invoke that tool, and use its result to formulate a response.
Instead of just generating text, the agent can interact with capabilities that you provide.
That is a very different experience from building an ordinary chatbot.

What I learned from the experience

Looking back, this was more than just another Python project.
There were several lessons I took away:
1. Start building instead of waiting until you know everything.
I didn't need to understand every aspect of agentic AI before getting started. Working through the implementation helped me understand the concepts much better.

2. Your cloud configuration matters as much as your code.
You can write perfectly reasonable Python code and still run into problems because of permissions, model availability, quotas, or service configuration.

3. Don't underestimate AWS Support.
My Bedrock quota experience reminded me that troubleshooting doesn't always mean changing code. Sometimes you need help from the people responsible for the service.

4. Give your agents tools.
The real potential of agentic AI becomes more apparent when models can interact with external functions and services instead of simply responding to prompts.

5. Experiment with different models and configurations.
Strands gives developers flexibility when working with different model providers. Understanding that flexibility opens up more possibilities for experimentation.

What's next?

This experiment has made me even more interested in exploring agentic AI within the AWS ecosystem.
I want to go beyond simple conversational agents and explore how we can build agents that interact with APIs, automate repetitive tasks, retrieve information, and solve practical problems.
I'm particularly interested in exploring more of what Amazon Bedrock offers and how Strands can help developers build useful, real-world AI applications.
For anyone who has been thinking about getting started with AI agents, my advice is simple: pick a tool, set up your environment, and start building.
You will probably encounter a few errors along the way. I certainly did.
But sometimes the most valuable part of building something is figuring out why it doesn't work.
And that is where much of the learning happens.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article