DEV Community

Cover image for From Build to Telemetry - Bedrock Agents with Strands SDK
N Chandra Prakash Reddy for AWS Community Builders

Posted on • Originally published at devopstour.hashnode.dev

From Build to Telemetry - Bedrock Agents with Strands SDK

I got the great opportunity to attend the AWS User Group Chennai Meetup on 15 Nov 2025. There were a lot of great sessions throughout the day, but one speaker totally stole the show in my book. "From Build to Telemetry - Bedrock Agents with Strands SDK" was presented by Jaya Ganesh, an Application Developer at Genesys.

I mean, it’s very easy these days to construct a great AI chatbot on your home PC. But to take that AI, give it tools, make it autonomous, and deploy it safely in a production environment? That’s a whole new animal. That sounds familiar?

That was the task for this session. I took a lot of notes and images, and I want to show you exactly how you can turn fragile AI scripts into solid, production-ready systems with Amazon Bedrock and the Strands SDK.

Laying the Groundwork: Generative AI and Bedrock

The session started with the basics and then moved on to complicated agents. The backbone of Generative AI are Large Language Models (LLMs) and Foundational Models (FMs) that understand and generate text based on human cues.

But running these models yourself is a headache. Or to put another way, you want to focus on building features, not managing infrastructure. And that’s exactly what Amazon Bedrock offers. It's a fully managed, serverless API that lets you access industry leading models from Anthropic (like Claude), Meta, Amazon, and more.

More than access to models, Bedrock delivers enterprise-grade security. Your data is kept private and never used to train the base models. It’s also filled with features like as Prompt Management, Prompt Caching, and built-in Guardrails to help keep AI behaviors under check.

Traditionally, you might invoke a model using a simple API call like this:

import boto3
import json

bedrock_runtime = boto3.client('bedrock-runtime', region_name="us-east-1")

response = bedrock_runtime.converse(
    modelId="anthropic.claude-3-5-haiku-20241022-v1:0",
    messages=[
        {"role": "user", "content": [{"text": "Explain AI agents in one sentence."}]}
    ]
)
print(response['output']['message']['content'][0]['text'])
Enter fullscreen mode Exit fullscreen mode

This works really well for simple questions and answers. But here's the thing: It's all reactive. The AI only works when you tell it to.

The Paradigm Shift: Moving to Agentic AI

Traditional chatbots are amazing, but they do require continual human control. Agentic AI is a game changer.

An Agentic AI is a system that operates autonomously and independently to fulfill pre-determined goals. It takes the initiative rather than waiting to be told what to do. It predicts requirements and makes decisions and acts. Imagine your database is like a library . Traditional AI is like a librarian that only answers when you ask a question . Agentic AI is like a librarian that notices when a book is out of place , categorizes it , and updates the catalog without you ever asking .

The Agentic Loop

These agents operate on a continuous, four-step loop:

  1. Perceive: Collects real-time data from APIs or connected systems.

  2. Reason: Uses the LLM to interpret context and plan multi-step actions.

  3. Act: Executes tasks through tool integrations.

  4. Learn: Improves through feedback loops.

Enter Strands SDK and AgentCore

You might be asking yourself how to actually do this without creating thousands of lines of boilerplate code. The answer is in Strands SDK and Amazon Bedrock AgentCore.

AgentCore delivers production ready serverless runtime, controlled state and observability. Strands SDK is the Python framework you use to build on it. Strands offers model flexibility, state management, and simple interface with OpenTelemetry for monitoring.

Here is how simple it is to create your first agent using Strands:

from strands import Agent
from strands.models import BedrockModel

# Create a Bedrock model configuration
model = BedrockModel(
    model_id="anthropic.claude-3-5-sonnet-20241022-v2:0",
    max_tokens=1024
)

# Create an agent
agent = Agent(
    model=model,
    system_prompt="You are a helpful AI assistant specialized in AWS."
)

response = agent("What are the benefits of serverless computing?")
Enter fullscreen mode Exit fullscreen mode

Giving Your Agent a Brain: State and Memory

Without the ability to remember earlier interactions, an agent cannot do complex tasks. Strands handles state in three different ways:

  • Request State: Context just for a single interaction.

  • Conversation History: The back-and-forth chat history.

  • Agent State: Key-value storage for long-term details (like user preferences) that persists across multiple requests.

In production, you can’t merely rely on your laptop’s memory to perform session persistence. Strands provides a FileSessionManager for local testing, however it is straightforward to replace this with an S3SessionManager to store session data on Amazon S3 for distributed cloud environments.

Optimizing the Context Window

LLMs are limited in how much text they can process at once. If your talk goes on too long, the agent will crash or forget stuff. The session shared excellent conversation management ways to solve this.

A SlidingWindowConversationManager can be used to only keep the past 20 messages. Or, better yet, a SummarizingConversationManagerusing a smaller, cheaper model (such Claude Haiku) that intelligently compresses earlier messages while leaving the most current messages alone.

Equipping Agents with Tools

An agent is only as good as the tools it’s working with. Imagine you're ordering meals on Swiggy, you need the app to talk to the restaurant, the delivery guy and the payment gateway.

Strands allows you to construct regular Python functions and simply fit your agent with them with a simple @tool decorator.

from strands import Agent, tool

@tool
def check_shipping_options(zip_code: str, product_id: str) -> dict:
    """Check available shipping options."""
    # Logic to call your shipping API goes here
    return {"method": "Express", "cost": 15.00}

# Pass the tool to the agent
website_chatbot = Agent(
    model=model,
    tools=[check_shipping_options],
    system_prompt="You are a helpful shopping assistant."
)
Enter fullscreen mode Exit fullscreen mode

When the user asks about shipping, the agent automatically reasons that it needs to run the check_shipping_options function, executes it, and formats the output for the user.

Scaling Up: Multi-Agent Patterns

This is where it gets super powerful. Sometimes you give an agent too much responsibility and he gets lost. Or, better yet, you can split and conquer using Multi-Agent patterns.

  1. Workflow Pattern: A choreographed performance. A Researcher agent provides data to an Analyst agent, which provides data to a Writer agent.

  2. Agents as Tools: The “Orchestrator” agent gets the user prompt, then determines to query a specialist Billing Agent or a Tech Support Agent.

  3. Swarm Pattern: A very collaborative environment where an Architect, a Coder and a Reviewer send a task back and forth till it is great.

The golden rule for multi-agent systems? Always specify clear responsibilities, precise time limits, and avoid agents being locked in an unending dialog loop with each other.

Observability and Guardrails

When your agent is out in the wild, you need to know what it is doing. Strands deeply integrates with OpenTelemetry and systems such as Langfuse.

Telemetry setup provides you with three pillars of observability: Traces (end to end flow of the request). Metrics (quantitative data like token consumption and costs). Logs. You may even establish Custom Spans around your tools to monitor exactly how many milliseconds your payment processing tool took to run.

And to keep the AI safe, Amazon Bedrock Guardrails are like the bumpers at a bowling alley. They can be configured to automatically block harmful content, redact PII (e.g. credit card details) and avoid prompt injection attacks. For example, if a user asks a shopping agent about an approaching political election, the Guardrail immediately jumps in and stops the off-topic remark.

The Final Mile: Production Deployment

Long story short, you can’t deploy a local script, thus it’s pointless. Strands and AgentCore make this shockingly easy. Your agent code can be packaged as either a ZIP file (for basic Python setups) or as a Docker container (for heavy dependencies).

You just need to add an entry point decorator around your main function for deployment to AgentCore Runtime:

from bedrock_agentcore_starter_toolkit import Runtime
import boto3

agentcore_runtime = Runtime()

# Configure the deployment
response = agentcore_runtime.configure(
    entrypoint="ecommerce_agent/main.py",
    auto_create_ecr=True,
    requirements_file="ecommerce_agent/requirements.txt",
    agent_name="ecommerce_agent"
)

# Launch it!
launch_result = agentcore_runtime.launch()
Enter fullscreen mode Exit fullscreen mode

When deployed, your application can safely invoke this agent hosted in the cloud with boto3.

Key Takeaways

Some things to take away from this session:

  1. Reactive to Proactive: We're expanding beyond the standard chatbot. Agentic AI is autonomous, anticipates needs, and acts through a continuous cycle of perception, reasoning, action, and learning.

  2. Memory is Crucial: Agents must have brains to be useful. Short-term and long-term state management is a key area to keep your context windows optimum and your agents intelligent.

  3. Divide and Conquer: Don’t overburden one agent. Enhance the reliability and precision of routing jobs to specialized agents with multi-agent patterns like Swarm or Workflow.

  4. Safety and Visibility: You can’t control what you can’t see. For real world production, you must trace execution timings, manage token costs, and enforce Bedrock Guardrails.

Conclusion

In the end, the difference between writing a toy AI script on your laptop and deploying a durable, production-ready AI agent is huge. But tools like Amazon Bedrock AgentCore and the Strands SDK provide a lovely bridge over that divide. Managed memory, simple tool integration, and deep observability provide us what we need to construct scalable, autonomous systems safely.

About the Author

As an AWS Community Builder, I enjoy sharing the things I've learned through my own experiences and events, and I like to help others on their path. If you found this helpful or have any questions, don't hesitate to get in touch! 🚀

🔗 Connect with me on LinkedIn

References

Event: AWS User Group Chennai Meetup

Topic: From Build to Telemetry - Bedrock Agents with Strands SDK

Date: November 15, 2025

Also Published On

AWS Builder Center

Hashnode

Top comments (0)