AWS Logo
Menu
Build AI agents with the Strands Agents SDK with Amazon Q Developer CLI

Build AI agents with the Strands Agents SDK with Amazon Q Developer CLI

Learn to create direct API integrations, build Strand Agents, integrate MCP servers, & leverage Anthropic Claude on Amazon Bedrock for powerful reasoning.

Published May 21, 2025
Last Modified May 26, 2025
Enterprises are doubling down on Agents. As per Gartner report, one third of interactions with generative AI services will invoke action models and autonomous agents for task completion!
 
The artificial intelligence landscape is rapidly evolving, and enterprises are increasingly looking to AI agents to automate complex tasks and drive efficiency. As Gartner predicts, a significant one-third of interactions with generative AI services will soon involve action models and autonomous agents. Staying ahead of this curve requires robust, flexible, and easily deployable solutions. Enter Strands Agent, a powerful new framework designed to empower your enterprise with cutting-edge AI capabilities.

Introducing Strands Agents

Open source python SDK for building agents using just a few lines of code
  • At its core, Strands Agent is engineered to be Model Agnostic. We understand that a one-size-fits-all approach doesn't work in the diverse world of Large Language Models (LLMs). That's why Strands Agent allows you to leverage a variety of LLMs with minimal configuration. Whether you prefer to run open-source LLMs locally, ensuring data privacy and control, or tap into the power of cloud services, Strands Agent provides seamless access. Integrate with a wide range of LLM providers, including LiteLLM, OpenAI, Databricks, NVIDIA, and others. Furthermore, you can extend agent capabilities with your custom LLM Gateways, offering unparalleled flexibility.
  • Deploy Anywhere is not just a feature; it's a core tenet of Strands Agent. We believe that AI should adapt to your infrastructure, not the other way around. Deploy and run agents in any environment where your Python applications thrive. This includes popular platforms like ECS, Lambda, and EC2, ensuring that Strands Agent fits effortlessly into your existing workflows.
  • The true power of AI agents lies in their ability to interact with the world around them. Strands Agent offers a Broad Selection of Tools to make this a reality. Extend agent capabilities by allowing them to interact with external systems, access critical data, and more. Expand the tools your agents use by leveraging our custom tool interface. This allows for deep integration with MCP servers, enabling your agents to connect with a wide array of tools and services, unlocking new levels of automation and insight.
  • In today's dynamic environment, flexibility is key. Strands Agent is Highly Flexible, providing the safeguards and observability you need to operate with confidence. Implement robust guardrails to ensure responsible AI behavior. Benefit from native observability, comprehensive monitoring, and thorough evaluation capabilities. Engage with a growing builder community to share knowledge and accelerate innovation.
  • Finally, Seamless Integration is at the heart of Strands Agent. We've built upon a foundation of powerful open-source tools like LiteLLM, Mem0, RAGAS, Tavily, and Langfuse to ensure that Strands Agent integrates smoothly into your development ecosystem, allowing you to build and deploy sophisticated AI agents faster than ever before.
  • Embrace the future of enterprise AI with Strands Agent. Build smarter, deploy faster, and unlock the full potential of autonomous agents within your organization.

From Zero to Stock Genius: How Amazon Q Developer CLI Helped Me Build a Strands Agent Demo, Fast!

I had a goal: to build a working demo showcasing the power of Strands agents. My first thought? How do I even get the raw material – real-time stock details? That initial question led me down a path, and like many developers, my journey started with a search, landing me squarely on the Polygon.io website. Their financial data APIs looked promising. I quickly signed up and generated an API key.
Now, for the exciting part. Instead of getting bogged down in boilerplate code or complex SDK integrations, I turned to a tool that’s rapidly becoming indispensable in my workflow: Amazon Q CLI. I just opened my terminal, typed /Q chat, and that was it. My AI coding companion was ready.

Phase 1: Getting the Basics Right – Direct API Integration

My first step was to understand the Polygon API and what it could offer. I prompted Amazon Q, right there in my CLI: "Help me call the Polygon API with this key and find out what data I can get for a stock ticker."
Q didn't just give me documentation links; it helped me formulate the actual API calls. Within minutes, I was pulling key stock information:
  • High and low values for the day
  • Trading volume for a given ticker (like 'AMZN' or 'GOOGL')
But I wanted more. "Okay Q," I prompted, "now how can I get the latest news articles for this stock? And what about buy/sell recommendations based on market sentiment?" Again, Q assisted in crafting the right queries and interpreting the responses. The direct integration was looking solid, and the insights I could potentially derive were already exciting.

Phase 2: Upping the Ante – Introducing Strands, MCP Server, and Claude

With the foundational data access sorted, it was time to bring in the intelligence – the Strands agent. This is where things could have gotten complicated, fast. I needed to:
  1. Introduce a Model Context Protocol (MCP) Server: This would allow my Strands agent to interact with the Polygon API in a standardized way, treating it as a callable tool.
  2. Integrate Strand agents: The core of my demo, responsible for orchestrating tasks.
  3. Leverage Claude for reasoning: I wanted my agent to use Claude's powerful reasoning capabilities to process the stock data and news, and then formulate those buy/sell recommendations.
This multi-step integration felt daunting, but with Amazon Q CLI, it was a step-by-step, guided process. I could ask things like, "How do I set up an MCP Server for the Polygon API and make it available as a tool for a Strands agent?" or "Show me how to configure my Strands agent to use Claude for analyzing this data and generating a recommendation." Q provided code snippets, configuration guidance, and explanations, breaking down complex tasks into manageable chunks. It was like pair programming with an incredibly knowledgeable and patient partner.

Phase 3: Making it Visual – Streamlit for the Front End

My agent was now smart, but I needed a way to show it off. A command-line output is fine for development, but a user interface makes a demo shine. My next thought: "I need a front end."
Guess who I turned to?
"Amazon Q," I typed into my CLI, "can you help me create a front end for this stock analysis agent using Streamlit?"
And just like that, Q guided me through scaffolding a Streamlit application. It helped generate the Python code to take inputs (like the stock ticker), call my Strands agent, and then display the results – the stock data, news summaries, and those Claude-powered recommendations – in a clean, interactive web interface.

Pro Tip:

Here's a pro tip for building applications with the AWS Q CLI: You can save frequent milestones using the /save <timestamp>.json command and take a break. To resume your work, load your previous Amazon Q session conversation history using the command /load <filename>.json. Ensure you replace <filename>.json with the actual name of your JSON file and that the file is located in the current working directory. This allows you to pick up exactly where you left off.

In the previous image, you saw that I saved the conversation to a JSON file. Now, I will quit Q Chat and relaunch it to start with a fresh slate. Then, I will load the JSON file to bring back all previous conversations with Q, as shown in the following image.

The Result: A Working Demo, Get real-time stock data, news, and trend analysis powered by specialized agent strands and Amazon Bedrock Claude

This architecture shows how the different components work together:
1. Foundation Model Layer: Amazon Bedrock Claude provides the intelligence that powers all strand agents, enabling advanced reasoning and natural language processing capabilities.
2. Orchestration Layer:
• The Coordinator manages the execution of multiple strand agents
• Task Manager distributes work to specialized strands
• Memory Store provides shared memory for all strands to store and retrieve data
3. Agent Layer: Specialized strand agents that each focus on a specific aspect:
• Stock Agent (Strand 1): Retrieves current stock price data
• News Agent (Strand 2): Gathers and analyzes latest news articles
• Analysis Agent (Strand 3): Combines data to provide insights and recommendations
4. Tool Layer: External APIs and tools that the strands use:
• Polygon API Connector: For real-time stock data
• News API Connector: For retrieving relevant news articles
• Data Analysis Tools: For trend analysis and sentiment detection


Get Started with Strand Agents

What started as a simple idea for a Strands agent demo quickly materialized into a functional application. From understanding an external API to integrating sophisticated AI agents with advanced reasoning, and finally, to building a user-friendly front end – Amazon Q CLI was the common thread that simplified each stage. It handled the undifferentiated heavy lifting, allowing me to focus on the "what" and the "why," while it expertly assisted with the "how."
If you're a developer looking to explore new technologies, integrate complex systems, or just build faster, I can't recommend Amazon Q CLI enough. Open your terminal, type /Q chat, and see how it can transform your workflow.
I hope you've enjoyed reading the blog so far. If it has been helpful to you, please let me know in the comments. PS: The views expressed are mine and do not belong to my employer. If you have any feedback on this blog, feel free to comment or reach out to me on LinkedIn!
 

3 Comments