AWS Logo
Menu
Getting Started with Strands Agents: A Step-by-Step Guide

Getting Started with Strands Agents: A Step-by-Step Guide

This blog is a step-by-step guide to getting started with Strands Agents.

Navnit Shukla
Amazon Employee
Published May 17, 2025
When AWS announced the Strands Agents open source SDK on May 16th, I jumped at the opportunity to explore it. The idea of building AI agents with just a few lines of code was too compelling to ignore—especially since this SDK moves away from rigid workflow definitions and embraces a model-driven approach that leverages the native reasoning capabilities of language models.
At its core, a Strands agent is built from three components:
  1. A Model (like Claude, LLaMA, or a Bedrock-hosted LLM),
  2. A set of Tools (which can be Python functions or MCP-powered services),
  3. And a Prompt (which defines the task and the system behavior).
These three ingredients enable the agent to autonomously execute complex tasks—from answering user questions to orchestrating multi-step workflows. The agent interacts in a continuous agentic loop, invoking the model to reason, reflect, and decide whether to respond, call a tool, or take the next step. Strands takes care of the execution behind the scenes, returning a final response when the task is complete.
This is a step-by-step guide to help you get started with Strands Agents. It walks you through the setup process, explains the core concepts, and makes it easier to build your first agent. Whether you’re new to AI agents or just exploring what AWS Strands has to offer, this guide is here to help you get up and running smoothly.
Prerequisites
Before diving into Strands, make sure you have these essentials in place:
1. AWS Account with Bedrock Access
  • An active AWS account
  • Access to Amazon Bedrock service
  • Model access enabled for foundation models (Claude, Titan, etc.) in the AWS Bedrock console
  • IAM permissions for both bedrock:InvokeModel and bedrock:ConverseStream operations
2. AWS CLI Configuration
  • AWS CLI installed and configured with appropriate credentials
  • A dedicated profile with Bedrock permissions (recommended for isolation)
3. GitHub Access Token
  • Create a GitHub personal access token with appropriate permissions
  • Set the token as an environment variable:
  • This token is needed for accessing GitHub repositories and potentially for package installations
4. Python Environment
  • Python 3.10+ installed (Strands requires Python 3.10 or newer)
  • Virtual environment tool for dependency management
Step 1: Setting Up Your Environment
Let's start by creating a clean Python environment and installing the necessary packages:
Step 2: Configuring AWS Credentials
This is where I encountered my first challenge. Proper AWS configuration is critical for your agent to access Bedrock models:
Pro Tip: Make note of the exact model IDs and regions where you have access. This will be crucial for troubleshooting later.
Step 3: Creating Your Project Structure
Following the Strands quickstart guide, let's set up a clean project structure:
Create the requirements.txt file:
Create the __init__.py file:
Step 4: Building Your Agent
Now, let's create the agent.py file with our Strands agent implementation. This is where I encountered the most significant issues with region configuration and model access:
Step 5: Running Your Agent
Now you can run your agent:
Result :
Troubleshooting Common Issues
During my implementation, I encountered several challenges that weren't covered in the initial documentation. Here are the most common issues and their solutions:
1. AccessDeniedException for Model ID
Issue: AccessDeniedException: You don't have access to the model with the specified model ID
This was the first major roadblock I hit. Despite having access to Claude models in my AWS account, I kept getting this error.
Solution: The problem was that Strands was defaulting to the us-west-2 region, but my model access was in us-east-1. Setting the AWS_REGION environment variable before importing Strands fixed this issue.
2. Region Configuration Issues
Issue: Strands using the wrong AWS region
Solution:
  • Set the AWS_REGION environment variable before importing Strands
  • Update your AWS profile's default region: aws configure set region us-east-1 --profile bedrock
  • Check your AWS config file for default region settings
3. Authentication Issues
Issue: Expired tokens or missing credentials
Solution:
  • Refresh your AWS credentials
  • Check if your credentials file is properly configured
  • Verify the profile name is correct
4. API Compatibility Issues
Issue: Strands using APIs you don't have access to
I discovered that Strands was using the ConverseStream operation, which requires specific permissions.
Solution:
  • Ensure your IAM role has permissions for both bedrock:InvokeModel and bedrock:ConverseStream
  • Try different model versions that might use different APIs
  • Update the Strands library to the latest version
Conclusion
Strands Agents represents an exciting step forward in AI agent development, offering a streamlined approach that leverages the reasoning capabilities of large language models. While I encountered some initial challenges during setup, the framework delivers on its promise of creating powerful agents with minimal code once properly configured.
The key lessons from my experience are:
  • Pay careful attention to AWS region configuration
  • Ensure you have the right model access and permissions
  • Set environment variables before importing Strands
  • Use debug logging to troubleshoot issues
By following this guide, you should be able to avoid the pitfalls I encountered and get started with Strands Agents quickly. The framework's flexibility and support for multiple model providers make it a valuable addition to any AI developer's toolkit.
I'm excited to see how the Strands ecosystem grows with contributions from the community and how developers will leverage this framework to build increasingly sophisticated AI agents. If you encounter any issues not covered in this guide, I encourage you to join the Strands community on GitHub and share your experiences.
 

Any opinions in this post are those of the individual author and may not reflect the opinions of AWS.

1 Comment