Building a “Hello World” agent
An excerpt from AI Agents on AWS exploring the foundations of agentic systems in production environments
What makes AI Agents on AWS interesting is that it focuses on the harder transition from experimentation to deployable systems. In this excerpt, AWS specialists Mona and Bunny Kaushik walk through the foundations of building a simple agent using Amazon Bedrock, SageMaker Studio, and the Strands SDK, offering a practical starting point for developers looking to move from prompts to production-oriented agent workflows.
We will host all the notebooks in our book GitHub repository at https://github.com/PacktPublishing/Agents-on-AWS. Before you write any code, ensure that your environment is properly set up. The following prerequisites are required to run the examples in this section. For detailed, step-by-step setup instructions (for Amazon SageMaker Studio, VS Code, or Kiro IDE), refer to the project README: https://github.com/PacktPublishing/Agents-on-AWS/blob/main/README.md
You should have the following in place:
Python 3.10 or higher installed
An AWS account with Amazon Bedrock model access enabled (go to Console → Bedrock → Model access, and enable models such as Nova Lite, Nova Pro, or Claude)
Appropriate IAM permissions attached to your user or role
Refer to the README for full policy details, but at a minimum, ensure access to:
bedrock:InvokeModel
bedrock:InvokeModelWithResponseStream
sagemaker:InvokeEndpoint (for SageMaker-hosted models)
s3:GetObject and s3:PutObject (for data/artifacts)
bedrock-agentcore: (required for AgentCore deployments in Chapter 6, Production Deployment and Enterprise Integration)
You will also require a working development environment. You can use either:
Amazon SageMaker Studio (recommended), with a JupyterLab space configured, or
A local IDE such as VS Code or Kiro
The following table summarizes the setup instructions for both the local IDE and SageMaker Studio:
Let’s move on to setting up the development environment where we will run our first agent.
Setting up your environment in Amazon SageMaker studio
In the following sections, we run the code from SageMaker Studio JupyterLab notebook instances. You can also use your preferred IDE, such as VS Code or PyCharm, but make sure your local environment is configured to work with AWS, as discussed in the prerequisites, or follow this guide: https://github.com/PacktPublishing/Agents-on-AWS/blob/main/README.md
Complete the following steps:
On the SageMaker AI console, choose Domains in the navigation pane, then open your domain.
In the navigation pane under Applications and IDEs, choose Studio.
On the User profiles tab, locate your user profile, then choose Launch and Studio.
In SageMaker Studio, launch an ml.t3.medium JupyterLab notebook instance.
Now that your environment is ready, you can begin building and running your first agent.
To begin building agents, start by cloning the GitHub repo and navigating to the folder chapter1 in the terminal of the JupyterLab:
# clone githubgit clone https://github.com/PacktPublishing/Agents-on-AWScd chapter1Open the notebook and proceed with the installation of Strands SDK by clicking the notebook cell as shown in the code below:
pip install strands-agents -qpip install strands-agents-tools -qpip install uv yfinance matplotlib beautifulsoup4 pandas requests -q
After installing the packages, restart the kernel. With that, you are ready to define and interact with a simple agent.
Creating a simple agent
In this example, we import the Agent class from the strands module and interact with the agent by passing a message. The agent processes the input using the underlying LLM and returns a response.
This simple Python example shows how to interact with an Amazon Bedrock Agent using the strands library:
from strands import Agent
# Define the agent with a system prompt
agent = Agent()
# Interact with the agent
response = agent(”Explain Amazon Bedrock Agents”)
print(response)
The agent is created with a system prompt (or defaults) and then sent a question (in this case, Explain Amazon Bedrock Agents). The agent processes the query and returns a natural language response, which is printed out. This demonstrates how easily you can build conversational AI apps powered by Amazon Bedrock with minimal code.
With this, we covered how to build a simple agent with a few lines of code using Strands SDK.
The example itself is intentionally simple, but the book's broader direction is not. From memory and tool use to orchestration, governance, and multi-agent architectures, AI Agents on AWS is designed to help practitioners understand what it actually takes to build reliable agentic systems in enterprise environments, not just prototype them.


