<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Laura Salinas</title>
    <description>The latest articles on DEV Community by Laura Salinas (@lausalin).</description>
    <link>https://dev.to/lausalin</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2961139%2F1ef5780a-c649-4402-9b4f-d5f5be866b63.jpg</url>
      <title>DEV Community: Laura Salinas</title>
      <link>https://dev.to/lausalin</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/lausalin"/>
    <language>en</language>
    <item>
      <title>Predicting Your AI Agent's Cost</title>
      <dc:creator>Laura Salinas</dc:creator>
      <pubDate>Fri, 27 Feb 2026 17:31:46 +0000</pubDate>
      <link>https://dev.to/aws/predicting-your-ai-agents-cost-6m9</link>
      <guid>https://dev.to/aws/predicting-your-ai-agents-cost-6m9</guid>
      <description>&lt;p&gt;I spent 2025 speaking at various developer/tech events around North America and out of all the feedback I received there was one thing that kept resurfacing: &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;Agents sounds interesting-- but how can I better predict the costs as I experiment?&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Today I'm hoping to shed some light on how you can predict costs for agents you develop and deploy on AWS. The tools and methods I'll cover are specific to deploying agents using AWS services, so be sure to check pricing with any third-party tools, extensions etc to get a full picture of what your costs can be if you're using those within your applications as well. &lt;/p&gt;

&lt;p&gt;Suffice it to say, estimating costs &lt;strong&gt;&lt;em&gt;before&lt;/em&gt;&lt;/strong&gt; you go to production is tricky because agent costs are emergent, basically they depend on how many steps the agent takes, how long the context grows, what tools it invokes, and how often it's called. I'll address the elements that we &lt;strong&gt;&lt;em&gt;can&lt;/em&gt;&lt;/strong&gt; control and share best practices for areas that are controlled/modified as you develop. &lt;/p&gt;

&lt;h2&gt;
  
  
  Pricing Out Your Agent
&lt;/h2&gt;

&lt;p&gt;The cost of your agent is not simply the amount of input and output tokens consumed during user queries. What I've realized from speaking to developers of all levels, is there's a fundamental misunderstanding of what "counts" when you're pricing out an agent for a particular project. There are additional costs in the agent workflow that can include (amongst others):&lt;/p&gt;

&lt;p&gt;1) System Prompts&lt;br&gt;
2) Tool Schemas&lt;br&gt;
3) Retrieved Context&lt;br&gt;
4) Intermediate Reasoning Steps&lt;br&gt;
5) Tool Call Results&lt;/p&gt;

&lt;p&gt;Now this isn't a post about managing your context or contextual engineering, so if you want to take a side quest and learn more about managing context for your agents, I recommend checking out the blog &lt;a href="https://builder.aws.com/content/2zxXacEGKEpYD8xNfWo4YaFZRYi/on-contextual-engineering-and-efficient-agents-part-1?trk=c6a9670e-a495-43a4-85ae-16eae0a1aadc&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;"On Contextual Engineering"&lt;/a&gt; by an AWS Gen AI  Specialist. &lt;/p&gt;

&lt;p&gt;Alright with those primers out of the way, let's discuss how you can track and predict the cost of your agent proof of concept before you take it to production. &lt;/p&gt;
&lt;h2&gt;
  
  
  &lt;a href="https://calculator.aws/#/createCalculator/bedrockagentcore?trk=c6a9670e-a495-43a4-85ae-16eae0a1aadc&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;AWS Pricing Calculator&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;The first place to start with back of the napkin math is the AWS Pricing Calculator. As it relates to building and deploying agents on AWS, the recommended pathway as of this write up is to use &lt;a href="https://aws.amazon.com/bedrock/agentcore/?trk=c6a9670e-a495-43a4-85ae-16eae0a1aadc&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;Amazon Bedrock AgentCore&lt;/a&gt;. If you have not heard of AgentCore don't fret, it's still relatively new in the world of AWS having been generally released on October 13, 2025. If you want to brush up on essentials first I cover my first impressions with a simple demo in a previous post: &lt;/p&gt;

&lt;p&gt;

&lt;/p&gt;
&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/aws/first-impressions-with-amazon-bedrock-agentcore-5dje" class="crayons-story__hidden-navigation-link"&gt;First Impressions with Amazon Bedrock AgentCore&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;
          &lt;a class="crayons-logo crayons-logo--l" href="/aws"&gt;
            &lt;img alt="AWS logo" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F1726%2F2a73f1e6-7995-4348-ae37-44b064274c59.png" class="crayons-logo__image"&gt;
          &lt;/a&gt;

          &lt;a href="/lausalin" class="crayons-avatar  crayons-avatar--s absolute -right-2 -bottom-2 border-solid border-2 border-base-inverted  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2961139%2F1ef5780a-c649-4402-9b4f-d5f5be866b63.jpg" alt="lausalin profile" class="crayons-avatar__image"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/lausalin" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Laura Salinas
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Laura Salinas
                
              
              &lt;div id="story-author-preview-content-2837852" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/lausalin" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2961139%2F1ef5780a-c649-4402-9b4f-d5f5be866b63.jpg" class="crayons-avatar__image" alt=""&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Laura Salinas&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

            &lt;span&gt;
              &lt;span class="crayons-story__tertiary fw-normal"&gt; for &lt;/span&gt;&lt;a href="/aws" class="crayons-story__secondary fw-medium"&gt;AWS&lt;/a&gt;
            &lt;/span&gt;
          &lt;/div&gt;
          &lt;a href="https://dev.to/aws/first-impressions-with-amazon-bedrock-agentcore-5dje" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Sep 10 '25&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/aws/first-impressions-with-amazon-bedrock-agentcore-5dje" id="article-link-2837852"&gt;
          First Impressions with Amazon Bedrock AgentCore
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/aws"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;aws&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/beginners"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;beginners&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/agents"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;agents&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/ai"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;ai&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
          &lt;a href="https://dev.to/aws/first-impressions-with-amazon-bedrock-agentcore-5dje" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left"&gt;
            &lt;div class="multiple_reactions_aggregate"&gt;
              &lt;span class="multiple_reactions_icons_container"&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/exploding-head-daceb38d627e6ae9b730f36a1e390fca556a4289d5a41abb2c35068ad3e2c4b5.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/multi-unicorn-b44d6f8c23cdd00964192bedc38af3e82463978aa611b4365bd33a0f1f4f3e97.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/sparkle-heart-5f9bee3767e18deb1bb725290cb151c25234768a0e9a2bd39370c382d02920cf.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
              &lt;/span&gt;
              &lt;span class="aggregate_reactions_counter"&gt;23&lt;span class="hidden s:inline"&gt; reactions&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/a&gt;
            &lt;a href="https://dev.to/aws/first-impressions-with-amazon-bedrock-agentcore-5dje#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              Comments


              3&lt;span class="hidden s:inline"&gt; comments&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            7 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;




&lt;p&gt;Within the calculator you can toggle various components AgentCore offers such as Runtime, Gateway, Memory, Identity, Observability, Browser Tools and Code Interpreter. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy7ho2o24gh6rsx4v6qac.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy7ho2o24gh6rsx4v6qac.png" alt=" "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For a basic agent you can start calculating costs with Runtime for basic functionality, and perhaps toggle Memory if you're looking to add native short-term (STM) or long-term (LTM) memory to the agent.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;⚠️ Note: This does not yet factor in LLM usage which would require adding &lt;a href="https://calculator.aws/#/createCalculator/bedrock?trk=c6a9670e-a495-43a4-85ae-16eae0a1aadc&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;Amazon Bedrock estimates&lt;/a&gt; to your calculation to get a full picture.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Here's a conservative example for a proof of concept I'm working on only with AgentCore Runtime costs factored in: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq9nsqntgkdn0i4g10mll.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq9nsqntgkdn0i4g10mll.png" alt=" "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcyj61mdib039rn4hmic6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcyj61mdib039rn4hmic6.png" alt=" "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With this first pass you can start to understand month over month what your agent costs begin to look like. Of course this is not an exact science, as your agent grows over time and its use in the larger application stabilizes, your costs may look different than initial calculations in the calculator. &lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://aws.amazon.com/aws-cost-management/aws-cost-explorer?trk=c6a9670e-a495-43a4-85ae-16eae0a1aadc&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;AWS Cost Explorer&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Ok, so you have a basic idea of what it &lt;strong&gt;&lt;em&gt;could&lt;/em&gt;&lt;/strong&gt; cost. Now let's dive one step further (this requires your AWS account) and learn how to track &amp;amp; understand charges once you &lt;strong&gt;are&lt;/strong&gt; building. My favorite way to do this natively with no extra 3rd party tooling is with the built in &lt;a href="https://us-east-1.console.aws.amazon.com/costmanagement/home?trk=c6a9670e-a495-43a4-85ae-16eae0a1aadc&amp;amp;sc_channel=el#/cost-explorer" rel="noopener noreferrer"&gt;Cost Explorer tool&lt;/a&gt; in the AWS console. &lt;/p&gt;

&lt;p&gt;Here's what you get from using Cost Explorer&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Interactive graph visuals&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Ability to drill down by service, region, API call and more&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Review data 3yrs in the past and forecast ahead up to 1yr&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Easily save reports and exports as CSVs&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;u&gt;Tracking&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;The first thing I like to do when diving into my project costs is setting the appropriate filters in the &lt;strong&gt;Report parameters&lt;/strong&gt; pane.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Date Range&lt;/strong&gt;: Specific periods I tested the agent &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Granularity&lt;/strong&gt;: Daily&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dimension&lt;/strong&gt;: I rotate between these to see details about specific usage&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;a. &lt;strong&gt;Usage type&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn5wwakscdkk75jq7hz4g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn5wwakscdkk75jq7hz4g.png" alt=" "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;b. &lt;strong&gt;API Operation&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2yyevk8ur9bb2yf45pj8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2yyevk8ur9bb2yf45pj8.png" alt=" "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Typically you won't see values trending negative, but I am demonstrating this in a &lt;a href="https://aws.amazon.com/free/?trk=c6a9670e-a495-43a4-85ae-16eae0a1aadc&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;Free Tier account&lt;/a&gt; so I am not being charged for any of this sample workload, the blue bars in these graphs are AWS credits applying to the account. &lt;/p&gt;

&lt;p&gt;&lt;u&gt;Forecasting&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;From the same &lt;strong&gt;Report parameters&lt;/strong&gt; pane you can forecast by selecting how many months into the future you want the algorithm to run through. This can help paint a picture of what expected costs may look like if your agent utilization remains the same over time. Obviously with spikier workloads and high traffic scenarios this is a bit harder to predict over time but you can at the very least find a baseline usage model to grow/shrink from.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bonus Round! 🤑
&lt;/h2&gt;

&lt;p&gt;I know what you're thinking: isn't this all a little archaic to be doing manually...?&lt;/p&gt;

&lt;p&gt;Well you can actually try out an &lt;a href="https://awslabs.github.io/mcp/servers/aws-pricing-mcp-server?trk=c6a9670e-a495-43a4-85ae-16eae0a1aadc&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;MCP server&lt;/a&gt; built exclusively for AWS Pricing to enable your coding assistant to connect and use this information on your behalf.&lt;/p&gt;

&lt;p&gt;I'm using the &lt;a href="https://kiro.dev/?trk=c6a9670e-a495-43a4-85ae-16eae0a1aadc&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;Kiro Agentic IDE&lt;/a&gt; and can one-click install the pricing MCP server for ease of use as I chat with the agent while I code. &lt;/p&gt;

&lt;p&gt;Kiro gives me some detailed information on how I can think about pricing the agent:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwyl7x7wvl6kt3v9pzq7b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwyl7x7wvl6kt3v9pzq7b.png" alt=" "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And even takes it one step further to generates a sample pricing example that I can use to plug-and-play with my values:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa6mddba17dux3kpwno6h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa6mddba17dux3kpwno6h.png" alt=" "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Additional Resources 📚&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aws.amazon.com/blogs/machine-learning/demystifying-amazon-bedrock-pricing-for-a-chatbot-assistant/?trk=c6a9670e-a495-43a4-85ae-16eae0a1aadc&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;Blog: Demystifying Amazon Bedrock Pricing&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://aws.amazon.com/free/?trk=c6a9670e-a495-43a4-85ae-16eae0a1aadc&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;AWS Free Tier Details&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://awslabs.github.io/mcp/servers/aws-pricing-mcp-server?trk=c6a9670e-a495-43a4-85ae-16eae0a1aadc&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;AWS Pricing MCP Server&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>aws</category>
      <category>ai</category>
      <category>agents</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Using Amazon Bedrock with AWS Free Tier for the 10,000 AIdeas Competition 🛠️</title>
      <dc:creator>Laura Salinas</dc:creator>
      <pubDate>Tue, 06 Jan 2026 16:00:44 +0000</pubDate>
      <link>https://dev.to/aws/using-amazon-bedrock-with-aws-free-tier-for-the-10000-aideas-competition-554f</link>
      <guid>https://dev.to/aws/using-amazon-bedrock-with-aws-free-tier-for-the-10000-aideas-competition-554f</guid>
      <description>&lt;p&gt;If you're gearing up for the &lt;a href="https://builder.aws.com/connect/events/10000aideas" rel="noopener noreferrer"&gt;AWS 10,000 AIdeas Competition&lt;/a&gt; (running December 5, 2025 to January 21, 2026), you're probably thinking about two things: building something awesome &lt;em&gt;and&lt;/em&gt; not breaking the bank while you experiment.&lt;/p&gt;

&lt;p&gt;Well I have some good news for you builders: Alongside the new &lt;a href="https://aws.amazon.com/free/" rel="noopener noreferrer"&gt;AWS Free Tier&lt;/a&gt;, if you want to inject large language models (LLMs) into your application and take advatange of state of the art frontier models from folks like Anthropic, Meta, Amazon and others, &lt;a href="https://aws.amazon.com/bedrock/" rel="noopener noreferrer"&gt;Amazon Bedrock&lt;/a&gt; will be your best friend. With the new AWS Free Tier you've got some runway to build without worrying about surprise bills. Let's walk through how to maximize your &lt;em&gt;free&lt;/em&gt; credits to build a competitive application without emptying your wallet.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's This Hackathon All About?
&lt;/h2&gt;

&lt;p&gt;The Global 10,000 AIdeas Competition is one of the largest developer competitions in AWS history, inviting developers worldwide to build innovative AI applications using AWS tools. You can join the competition to compete for $250,000 in cash prizes as well as recognition at AWS re:Invent 2026 and across AWS channels.&lt;/p&gt;

&lt;p&gt;The requirement is simple: pitch an application idea for one of the five competition tracks: workplace efficiency, daily life enhancement, commercial solutions, social impact, or creative expression. Your initial submission is a written pitch—no code required at this stage—that describes what you want to build and why it matters.&lt;/p&gt;

&lt;p&gt;If selected as a semi-finalist, that's when you'll build your app. Your finished app needs to use the agentic IDE &lt;a href="https://kiro.dev/" rel="noopener noreferrer"&gt;Kiro&lt;/a&gt; for at least part of development, stay within AWS Free Tier limits, and be completely original and not yet published. For more details and FAQs about the competition you can head to the &lt;a href="https://builder.aws.com/connect/events/10000aideas" rel="noopener noreferrer"&gt;announcement post&lt;/a&gt;. &lt;/p&gt;

&lt;h2&gt;
  
  
  The New Free Tier: Everything You Need to Know
&lt;/h2&gt;

&lt;p&gt;Now let's dig into how to use free tier for this competition. AWS recently revamped Free Tier for new accounts (created after July 15, 2025), so here's how it breaks down:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;$100 in credits&lt;/strong&gt; when you sign up&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Up to $100 more in credits&lt;/strong&gt; by completing five onboarding activities (including one specifically for Bedrock!)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Total: Up to $200 in credits&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Duration: 6 months&lt;/strong&gt; (or until you exhaust your credits)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One of those extra $20 credit activities? &lt;strong&gt;Using Amazon Bedrock in the playground&lt;/strong&gt;. So literally just experimenting with LLMs in the &lt;a href="https://console.aws.amazon.com/bedrock" rel="noopener noreferrer"&gt;Bedrock console&lt;/a&gt; earns you credits. How easy is that?!&lt;/p&gt;

&lt;p&gt;It's important to note that &lt;strong&gt;Amazon Bedrock itself is not in the Always Free tier&lt;/strong&gt;—you will be using your free credits to pay for Bedrock usage if you chose to add this service to your application. &lt;/p&gt;

&lt;h2&gt;
  
  
  How Amazon Bedrock Pricing Works
&lt;/h2&gt;

&lt;p&gt;Before we dive into optimization, let's quickly break down how Bedrock charges you (because understanding this is half the battle):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Text models:&lt;/strong&gt; Pay per token (both input and output)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Image models:&lt;/strong&gt; Pay per image generated&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Embeddings:&lt;/strong&gt; Pay per input token&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Bedrock offers three main pricing tiers:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;On-Demand&lt;/strong&gt; - Pay as you go, no commitments (this is what you'll use)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Batch Mode&lt;/strong&gt; - 50% discount for non-urgent workloads using certain models&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Provisioned Throughput&lt;/strong&gt; - Reserved capacity (this is overkill for this competition)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For this competition, we recommended you use only on-demand standard tier pricing, which means every API call counts. The good news? You can predict costs pretty accurately since these calculations are token-based.&lt;/p&gt;

&lt;p&gt;If you're curious, you can check out the &lt;a href="https://aws.amazon.com/bedrock/pricing/" rel="noopener noreferrer"&gt;official pricing page&lt;/a&gt; for Amazon Bedrock which includes even more details than the ones I mention here.&lt;/p&gt;

&lt;h2&gt;
  
  
  Which Models Should You Use?
&lt;/h2&gt;

&lt;p&gt;Here's where some strategy comes in. Not all models are created equal when it comes to cost, and choosing wisely can make your $200 credits go &lt;em&gt;way&lt;/em&gt; further.&lt;/p&gt;

&lt;h3&gt;
  
  
  Budget-Friendly Champions 🏆
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;All prices in this blog are referencing the US-East-1 (N. Virginia) region.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Amazon Nova Micro&lt;/strong&gt; ($0.000035/1K input tokens, $0.00014/1K output tokens)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The cheapest of the Amazon models &lt;/li&gt;
&lt;li&gt;Great for simple tasks, routing, or classification&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Amazon Nova Lite&lt;/strong&gt; ($0.00006/1K input tokens, $0.00024/1K output tokens)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Still incredibly affordable&lt;/li&gt;
&lt;li&gt;Solid reasoning capabilities&lt;/li&gt;
&lt;li&gt;My pick for most hackathon use cases where you need good performance without burning through credits&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Meta Llama 3.3 70B&lt;/strong&gt; ($0.00072/1K input tokens, $0.00072/1K output tokens)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Great price-to-performance ratio&lt;/li&gt;
&lt;li&gt;Strong at reasoning and tool use&lt;/li&gt;
&lt;li&gt;Flat pricing (same rate for input and output) makes cost prediction easy &lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Where to Splurge (Strategically) 🤑
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Claude Sonnet 4.5&lt;/strong&gt; ($0.0033/1K input tokens, $0.0165/1K output tokens)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;More expensive, but incredibly capable&lt;/li&gt;
&lt;li&gt;Use for complex reasoning tasks where quality really matters&lt;/li&gt;
&lt;li&gt;Great for your demo/presentation application where you want to wow the judges&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Claude Haiku 4.5&lt;/strong&gt; ($0.0011/1K input tokens, $0.0055/1K output tokens)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Faster and cheaper than Sonnet&lt;/li&gt;
&lt;li&gt;Good middle ground for production-like scenarios&lt;/li&gt;
&lt;li&gt;My pick for a model if you're wanting to splurge&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I'll leave a knowledge nugget for those wanting more info on Claude Haiku 4.5, &lt;a href="https://www.anthropic.com/news/claude-haiku-4-5" rel="noopener noreferrer"&gt;this deep dive article by Anthropic&lt;/a&gt; shows just &lt;em&gt;how&lt;/em&gt; performant and &lt;em&gt;affordable&lt;/em&gt; this model is.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Power Move: Intelligent Prompt Routing
&lt;/h3&gt;

&lt;p&gt;Here's a pro tip that can save you up to 30% on costs: use Bedrock's &lt;strong&gt;Intelligent Prompt Routing&lt;/strong&gt;. This feature automatically routes simple queries to cheaper models (like Nova Lite or Haiku) and complex queries to more capable models (like Sonnet or Nova Pro). &lt;/p&gt;

&lt;p&gt;For a customer service agent, this means basic questions like "What are your hours?" go to the cheap model, while "I need help troubleshooting this complex integration issue" gets routed to the smart (expensive) model.&lt;/p&gt;

&lt;p&gt;There is a cost associated with this cool feature, but at $1 per 1,000 requests it might be worth experimenting with it! For more detailed info check out the &lt;a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-routing.html" rel="noopener noreferrer"&gt;documentation page&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Maximizing Your Free Credits: Battle-Tested Tips
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Start with Nova Lite or Nova Micro&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Build your application with these models first. Get the logic working, nail your tool integrations, and perfect your prompts. Only upgrade to more expensive models when you're confident your application works well.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Use Batch Mode for Testing&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you have large test suites or want to evaluate multiple prompt variations, try using Batch mode for a 50% discount compared to on-demand. It's not real-time, but for development and testing, it can be quite useful.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Optimize Your Prompts&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Shorter prompts = fewer tokens = lower costs. Every word counts. Be concise in your system prompts and examples.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Implement Prompt Caching&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Avoid making redundant API calls. If your agent asks the same question multiple times, cache the response. This feature might not be available with all models so double check the &lt;a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-caching.html" rel="noopener noreferrer"&gt;documentation&lt;/a&gt; to learn more.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Monitor Costs in Real-Time&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Head to the &lt;a href="https://console.aws.amazon.com/cost-management/home#/cost-explorer" rel="noopener noreferrer"&gt;AWS Cost Explorer&lt;/a&gt; and filter by:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Granularity:&lt;/strong&gt; Daily&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dimension:&lt;/strong&gt; Usage Type (This shows exactly which models are costing you money)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Service:&lt;/strong&gt; Bedrock&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Check this &lt;em&gt;daily&lt;/em&gt; during development. I can't stress enough how easy this is to do, you don't want to burn through $150 of credits on day three and realize it on day ten...&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. Set Up Budget Alerts&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Go to &lt;a href="https://console.aws.amazon.com/billing/home#/budgets" rel="noopener noreferrer"&gt;AWS Budgets&lt;/a&gt; and create a budget. &lt;/p&gt;

&lt;p&gt;For this specific competition you can set something up to simulate the burn rate of your free tier credits.&lt;/p&gt;

&lt;p&gt;Create a budget for $200 with alerts at:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;50% ($100 spent)&lt;/li&gt;
&lt;li&gt;75% ($150 spent)&lt;/li&gt;
&lt;li&gt;90% ($180 spent)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This way you get early warning before things get out of hand.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;⚡️Bonus:&lt;/strong&gt; setting up a cost budget is another one of those five onboarding tasks for the new Free Tier, so you automatically unlock another $20/$100 in extra AWS Credits by doing so!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. Use the Playground First&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The &lt;a href="//console.aws.amazon.com/bedrock/home?region=us-east-1#/text-generation-playground"&gt;Bedrock playground&lt;/a&gt; in the console lets you test prompts without writing code. It's the same cost, but way faster for iteration. Plus, remember—using it earns you $20 in credits!&lt;/p&gt;

&lt;h2&gt;
  
  
  Regional Considerations
&lt;/h2&gt;

&lt;p&gt;Not all models are available in all regions. The most model variety is in:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;us-east-1&lt;/strong&gt; (N. Virginia) - Best option for maximum model access&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;us-west-2&lt;/strong&gt; (Oregon) - Good alternative with most models&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Stick to these regions for the competition if you can to avoid any "model not available" headaches.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;I know this may seem like a lot, so if you're more of a visual/video learner we actually have FREE, live learning sessions this week from AWS experts that will cover how to use AWS Free Tier!&lt;/p&gt;

&lt;p&gt;Click below to register and attend one that fits your schedule:&lt;/p&gt;

&lt;p&gt;Americas - January 6, 12 pm PT (GMT-8) &lt;a href="https://amazon.zoom.us/webinar/register/WN_XR2cMyzMR1mo-DxTiJSJwA" rel="noopener noreferrer"&gt;Register&lt;/a&gt; &lt;br&gt;
Europe, Middle East, Africa - January 7, 12 pm London Time (GMT+0) &lt;a href="https://amazon.zoom.us/webinar/register/WN_wg7agWqRQUig0Dr2XFL4RA" rel="noopener noreferrer"&gt;Register&lt;/a&gt; &lt;br&gt;
Asia Pacific, Japan, China - January 7, 12 pm AEDT (GMT+11) &lt;a href="https://amazon.zoom.us/webinar/register/WN_RoBJWeq-S4WohMu0iNTCRA" rel="noopener noreferrer"&gt;Register&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now go build something cool. And seriously, set up those budget alerts first. Your wallet will thank you 😉&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Additional Resources 📚&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/bedrock/pricing/" rel="noopener noreferrer"&gt;Amazon Bedrock Pricing&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://builder.aws.com/connect/events/10000aideas" rel="noopener noreferrer"&gt;AWS 10,000 AIdeas Competition&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/free/" rel="noopener noreferrer"&gt;AWS Free Tier Details&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://docs.aws.amazon.com/bedrock/" rel="noopener noreferrer"&gt;Amazon Bedrock Documentation&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>aws</category>
      <category>hackathon</category>
      <category>ai</category>
    </item>
    <item>
      <title>Build Multi-Agent Systems Using the Agents as Tools Pattern</title>
      <dc:creator>Laura Salinas</dc:creator>
      <pubDate>Tue, 18 Nov 2025 00:23:43 +0000</pubDate>
      <link>https://dev.to/aws/build-multi-agent-systems-using-the-agents-as-tools-pattern-jce</link>
      <guid>https://dev.to/aws/build-multi-agent-systems-using-the-agents-as-tools-pattern-jce</guid>
      <description>&lt;p&gt;In my last post I covered the &lt;a href="https://strandsagents.com/latest/documentation/docs/user-guide/concepts/multi-agent/graph?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;Graph&lt;/a&gt; pattern and how structured, deterministic workflows can orchestrate multiple agents like a symphony orchestra following a conductor's score.👇🏼&lt;/p&gt;

&lt;p&gt;

&lt;/p&gt;
&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/aws/strands-multi-agent-systems-graph-4h7f" class="crayons-story__hidden-navigation-link"&gt;Strands Multi-Agent Systems: Graph&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;
          &lt;a class="crayons-logo crayons-logo--l" href="/aws"&gt;
            &lt;img alt="AWS logo" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F1726%2F2a73f1e6-7995-4348-ae37-44b064274c59.png" class="crayons-logo__image"&gt;
          &lt;/a&gt;

          &lt;a href="/lausalin" class="crayons-avatar  crayons-avatar--s absolute -right-2 -bottom-2 border-solid border-2 border-base-inverted  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2961139%2F1ef5780a-c649-4402-9b4f-d5f5be866b63.jpg" alt="lausalin profile" class="crayons-avatar__image"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/lausalin" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Laura Salinas
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Laura Salinas
                
              
              &lt;div id="story-author-preview-content-2976756" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/lausalin" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2961139%2F1ef5780a-c649-4402-9b4f-d5f5be866b63.jpg" class="crayons-avatar__image" alt=""&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Laura Salinas&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

            &lt;span&gt;
              &lt;span class="crayons-story__tertiary fw-normal"&gt; for &lt;/span&gt;&lt;a href="/aws" class="crayons-story__secondary fw-medium"&gt;AWS&lt;/a&gt;
            &lt;/span&gt;
          &lt;/div&gt;
          &lt;a href="https://dev.to/aws/strands-multi-agent-systems-graph-4h7f" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Oct 31 '25&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/aws/strands-multi-agent-systems-graph-4h7f" id="article-link-2976756"&gt;
          Strands Multi-Agent Systems: Graph
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/aws"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;aws&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/agents"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;agents&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/ai"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;ai&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/learning"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;learning&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
          &lt;a href="https://dev.to/aws/strands-multi-agent-systems-graph-4h7f" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left"&gt;
            &lt;div class="multiple_reactions_aggregate"&gt;
              &lt;span class="multiple_reactions_icons_container"&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/fire-f60e7a582391810302117f987b22a8ef04a2fe0df7e3258a5f49332df1cec71e.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/multi-unicorn-b44d6f8c23cdd00964192bedc38af3e82463978aa611b4365bd33a0f1f4f3e97.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/sparkle-heart-5f9bee3767e18deb1bb725290cb151c25234768a0e9a2bd39370c382d02920cf.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
              &lt;/span&gt;
              &lt;span class="aggregate_reactions_counter"&gt;9&lt;span class="hidden s:inline"&gt; reactions&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/a&gt;
            &lt;a href="https://dev.to/aws/strands-multi-agent-systems-graph-4h7f#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              Comments


              1&lt;span class="hidden s:inline"&gt; comment&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            5 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;




&lt;p&gt;In this final post in this multi agent series, I'm diving into &lt;a href="https://strandsagents.com/latest/documentation/docs/user-guide/concepts/multi-agent/agents-as-tools?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;Agents as Tools&lt;/a&gt;. I'll share code snippets and examples that you can follow along with to build your own multi-agent system.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Recap
&lt;/h2&gt;

&lt;p&gt;While Graphs provide structured coordination through dependencies and Swarms enable autonomous collaboration, the Agents as Tools pattern brings hierarchical delegation to multi-agent orchestration. Instead of a single agent trying to handle everything, tasks are delegated to the most appropriate specialized agent. &lt;/p&gt;

&lt;p&gt;One thing to note here, when using the Strands framework we are leaving the reasoning, decision making and tool selection to the model used at invocation time. When a query comes in, the agent’s LLM will parse the question and decide on a plan. We can thank Strands’s model-driven loop for this!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F73471ebplf1e2jn08qf4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F73471ebplf1e2jn08qf4.png" alt=" "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What Is an "Agents as Tools" System?
&lt;/h2&gt;

&lt;p&gt;Agents as Tools is an architectural pattern where specialized AI agents are wrapped as callable functions that can be used by other agents. This creates a clear hierarchical structure with two distinct types of agents:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Orchestrator Agent&lt;/strong&gt; acts like a manager. It handles user interaction, understands requests, and determines which specialized agent to call. Think of it as the traffic controller for your multi-agent system.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Specialized Tool Agents&lt;/strong&gt; are the domain experts. Each performs specific tasks when called by the orchestrator, bringing deep expertise in their focused area.&lt;/p&gt;

&lt;p&gt;Key characteristics of the Agents as Tools pattern:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Separation of concerns&lt;/strong&gt; - Each agent has one focused responsibility&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hierarchical delegation&lt;/strong&gt; - Clear chain of command (orchestrator routing requests) &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Modular architecture&lt;/strong&gt; - Add, remove, or modify specialists independently&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Optimized performance&lt;/strong&gt; - Agents have tailored prompts and tools for their domain&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The benefits of this pattern lie in its simplicity. Unlike Swarms where agents collaborate dynamically, or Graphs where execution follows dependencies, Agents as Tools uses straightforward function calls. The orchestrator simply decides which specialist to invoke based on the user's request.&lt;/p&gt;

&lt;h2&gt;
  
  
  How Agents as Tools Work
&lt;/h2&gt;

&lt;p&gt;The pattern relies on three core components working together:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The @tool Decorator&lt;/strong&gt; transforms your Python function into a tool that other agents can use. This is the key mechanism that wraps specialized agents as callable functions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Specialized Agents&lt;/strong&gt; are created within these tool functions. Each has a focused system prompt and relevant tools for its domain. They process specific types of requests when called.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Orchestrator Agent&lt;/strong&gt; receives the tool functions in its tools list. It reads the tool docstrings (which is why they're crucial!) to understand when to use each specialist.&lt;/p&gt;

&lt;p&gt;Here's the flow:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;User sends a request to the orchestrator&lt;/li&gt;
&lt;li&gt;Orchestrator analyzes the request against available tool docstrings&lt;/li&gt;
&lt;li&gt;Orchestrator selects and calls the appropriate specialized agent&lt;/li&gt;
&lt;li&gt;Specialized agent processes the request with its domain expertise&lt;/li&gt;
&lt;li&gt;Result flows back through the orchestrator to the user&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Creating Specialized Tool Agents
&lt;/h2&gt;

&lt;p&gt;Let's break down how to create specialized agents using the &lt;code&gt;@tool&lt;/code&gt; decorator:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;strands&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Agent&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tool&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;strands_tools&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;retrieve&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;http_request&lt;/span&gt;

&lt;span class="c1"&gt;# Define a specialized system prompt
&lt;/span&gt;&lt;span class="n"&gt;RESEARCH_ASSISTANT_PROMPT&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;
You are a specialized research assistant. Focus only on providing
factual, well-sourced information in response to research questions.
Always cite your sources when possible.
&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;

&lt;span class="nd"&gt;@tool&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;research_assistant&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;
    Process and respond to research-related queries.

    Args:
        query: A research question requiring factual information

    Returns:
        A detailed research answer with citations
    &lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="c1"&gt;# Strands Agents SDK makes it easy to create a specialized agent
&lt;/span&gt;        &lt;span class="n"&gt;research_agent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Agent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="n"&gt;system_prompt&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;RESEARCH_ASSISTANT_PROMPT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;tools&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;retrieve&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;http_request&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;  &lt;span class="c1"&gt;# Research-specific tools
&lt;/span&gt;        &lt;span class="p"&gt;)&lt;/span&gt;

        &lt;span class="c1"&gt;# Call the agent and return its response
&lt;/span&gt;        &lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;research_agent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="nb"&gt;Exception&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Error in research assistant: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nf"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The key elements to notice:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Clear, descriptive docstrings&lt;/strong&gt; - The LLM reads these to understand when to invoke your tool. Be detailed about what the agent handles and what parameters it expects.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Focused system prompt&lt;/strong&gt; - Each specialized agent should have a tightly focused prompt that defines its expertise and boundaries.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Error handling&lt;/strong&gt; - Always include try-except blocks to gracefully manage any issues that arise during execution.&lt;/p&gt;

&lt;h2&gt;
  
  
  Creating the Orchestrator
&lt;/h2&gt;

&lt;p&gt;The orchestrator is the brain of your multi-agent system. Here's an example of how to build it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;strands&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Agent&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;.specialized_agents&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;research_assistant&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;product_recommendation_assistant&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;trip_planning_assistant&lt;/span&gt;

&lt;span class="c1"&gt;# Define the orchestrator system prompt with clear tool selection guidance
&lt;/span&gt;&lt;span class="n"&gt;MAIN_SYSTEM_PROMPT&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;
You are an assistant that routes queries to specialized agents:
- For research questions and factual information → Use the research_assistant tool
- For product recommendations and shopping advice → Use the product_recommendation_assistant tool
- For travel planning and itineraries → Use the trip_planning_assistant tool
- For simple questions not requiring specialized knowledge → Answer directly

Always select the most appropriate tool based on the user&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;s query.
&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;

&lt;span class="c1"&gt;# Strands Agents SDK allows easy integration of agent tools
&lt;/span&gt;&lt;span class="n"&gt;orchestrator&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Agent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;system_prompt&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;MAIN_SYSTEM_PROMPT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;callback_handler&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;tools&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;research_assistant&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;product_recommendation_assistant&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;trip_planning_assistant&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notice something important: we're passing the specialized agent functions—those we decorated with &lt;code&gt;@tool&lt;/code&gt; directly into the orchestrator's tools list. The Strands SDK handles all the complexity of making this work on our behalf.&lt;/p&gt;

&lt;p&gt;The orchestrator's system prompt is critical. It should provide clear guidance on when to use each specialist, similar to training instructions for a manager coordinating a team.&lt;/p&gt;

&lt;h2&gt;
  
  
  When to Use Agents as Tools
&lt;/h2&gt;

&lt;p&gt;Agents as Tools is ideal when you have clearly defined specialist domains and need hierarchical delegation. It performs well when you want a simple, maintainable architecture where adding new capabilities means adding new tool functions.&lt;/p&gt;

&lt;p&gt;Use Agents as Tools when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You have distinct domain expertise that can be cleanly separated&lt;/li&gt;
&lt;li&gt;A hierarchical structure makes sense for your use case&lt;/li&gt;
&lt;li&gt;You want straightforward routing logic&lt;/li&gt;
&lt;li&gt;Each task type can be handled by a single specialist&lt;/li&gt;
&lt;li&gt;You're building a customer service system, virtual assistant, or help desk&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Best Practices 💡
&lt;/h2&gt;

&lt;p&gt;From implementing the Agents as Tools pattern, here are some best practices:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Write crystal-clear docstrings&lt;/strong&gt; - The LLM uses these to decide when to invoke your tool, so be descriptive and specific&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keep system prompts tightly focused&lt;/strong&gt; - Each specialized agent should know exactly what it's responsible for and nothing more&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Include comprehensive error handling&lt;/strong&gt; - Every tool function should gracefully handle failures and return meaningful error messages&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Give explicit routing guidance&lt;/strong&gt; - Your orchestrator prompt should clearly explain when to use each specialist&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use consistent response patterns&lt;/strong&gt; - Make sure all your specialized agents return responses in a similar format&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Comparing the Multi-Agent Patterns
&lt;/h2&gt;

&lt;p&gt;Now that we've covered all three patterns in this series, here's when to choose each:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Swarm when:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The problem benefits from exploration and brainstorming&lt;/li&gt;
&lt;li&gt;Agents need to dynamically decide who should handle what&lt;/li&gt;
&lt;li&gt;Collaboration and handoffs are central to the solution&lt;/li&gt;
&lt;li&gt;The optimal agent sequence isn't known upfront&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Use Graph when:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You have a clear workflow with known dependencies&lt;/li&gt;
&lt;li&gt;Deterministic execution order is important&lt;/li&gt;
&lt;li&gt;You need conditional branching or parallel processing&lt;/li&gt;
&lt;li&gt;You're modeling a business process&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Use Agents as Tools when:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You have clearly defined specialist domains&lt;/li&gt;
&lt;li&gt;A hierarchical structure with a coordinator makes sense&lt;/li&gt;
&lt;li&gt;You want simple, straightforward routing&lt;/li&gt;
&lt;li&gt;Each task type maps to a single specialist&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Often, you'll combine these patterns! For example, you might use Agents as Tools as your top-level pattern, with some specialists internally using a Graph or Swarm for their complex tasks.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrapping Up
&lt;/h2&gt;

&lt;p&gt;This completes our journey through Strands multi-agent patterns! We've covered Swarms for autonomous collaboration, Graphs for structured orchestration, and now Agents as Tools for hierarchical delegation.&lt;/p&gt;

&lt;p&gt;Each pattern has its strengths, and knowing when to use which is key to building effective multi-agent systems. Don't be afraid to mix and match patterns to solve your specific use case. As a reminder I have a &lt;strong&gt;FREE&lt;/strong&gt; &lt;a href="https://www.analyticsvidhya.com/courses/building-multi-agent-systems-with-strands-agents/?utm_source=new_course_home_page&amp;amp;trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;2hr video course&lt;/a&gt; that you can enroll in to learn all about multi-agent systems at your own pace with step by step code examples.&lt;/p&gt;

&lt;p&gt;Don't forget to give me a 🦄 if you got this far and let me know what else you're learning about in these agentic times!&lt;/p&gt;

&lt;p&gt;Happy building! &lt;/p&gt;

&lt;h3&gt;
  
  
  Additional Resources 📚
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.analyticsvidhya.com/courses/building-multi-agent-systems-with-strands-agents/?utm_source=new_course_home_page&amp;amp;trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;Free video course with code&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://github.com/strands-agents/samples/tree/main/01-tutorials/02-multi-agent-systems/01-agent-as-tool?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;Example Notebook for Agents as Tools&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://strandsagents.com/latest/documentation/docs/user-guide/concepts/multi-agent/agents-as-tools/?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;Agents as Tools Pattern Documentation&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://strandsagents.com/latest/user-guide/quickstart?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;Strands Agents Quickstart&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>aws</category>
      <category>beginners</category>
      <category>learning</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Strands Multi-Agent Systems: Graph</title>
      <dc:creator>Laura Salinas</dc:creator>
      <pubDate>Fri, 31 Oct 2025 17:00:00 +0000</pubDate>
      <link>https://dev.to/aws/strands-multi-agent-systems-graph-4h7f</link>
      <guid>https://dev.to/aws/strands-multi-agent-systems-graph-4h7f</guid>
      <description>&lt;p&gt;In my last post I covered the &lt;a href="https://strandsagents.com/latest/documentation/docs/user-guide/concepts/multi-agent/swarm?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;Swarm&lt;/a&gt; pattern and how multiple specialized agents can collaborate dynamically like an ant colony.👇🏼&lt;/p&gt;

&lt;p&gt;

&lt;/p&gt;
&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/aws/strands-multi-agent-systems-swarm-490j" class="crayons-story__hidden-navigation-link"&gt;Strands Multi-Agent Systems: Swarm&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;
          &lt;a class="crayons-logo crayons-logo--l" href="/aws"&gt;
            &lt;img alt="AWS logo" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F1726%2F2a73f1e6-7995-4348-ae37-44b064274c59.png" class="crayons-logo__image"&gt;
          &lt;/a&gt;

          &lt;a href="/lausalin" class="crayons-avatar  crayons-avatar--s absolute -right-2 -bottom-2 border-solid border-2 border-base-inverted  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2961139%2F1ef5780a-c649-4402-9b4f-d5f5be866b63.jpg" alt="lausalin profile" class="crayons-avatar__image"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/lausalin" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Laura Salinas
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Laura Salinas
                
              
              &lt;div id="story-author-preview-content-2951529" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/lausalin" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2961139%2F1ef5780a-c649-4402-9b4f-d5f5be866b63.jpg" class="crayons-avatar__image" alt=""&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Laura Salinas&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

            &lt;span&gt;
              &lt;span class="crayons-story__tertiary fw-normal"&gt; for &lt;/span&gt;&lt;a href="/aws" class="crayons-story__secondary fw-medium"&gt;AWS&lt;/a&gt;
            &lt;/span&gt;
          &lt;/div&gt;
          &lt;a href="https://dev.to/aws/strands-multi-agent-systems-swarm-490j" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Oct 24 '25&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/aws/strands-multi-agent-systems-swarm-490j" id="article-link-2951529"&gt;
          Strands Multi-Agent Systems: Swarm
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/aws"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;aws&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/agents"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;agents&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/ai"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;ai&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/learning"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;learning&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
          &lt;a href="https://dev.to/aws/strands-multi-agent-systems-swarm-490j" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left"&gt;
            &lt;div class="multiple_reactions_aggregate"&gt;
              &lt;span class="multiple_reactions_icons_container"&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/multi-unicorn-b44d6f8c23cdd00964192bedc38af3e82463978aa611b4365bd33a0f1f4f3e97.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/fire-f60e7a582391810302117f987b22a8ef04a2fe0df7e3258a5f49332df1cec71e.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/sparkle-heart-5f9bee3767e18deb1bb725290cb151c25234768a0e9a2bd39370c382d02920cf.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
              &lt;/span&gt;
              &lt;span class="aggregate_reactions_counter"&gt;7&lt;span class="hidden s:inline"&gt; reactions&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/a&gt;
            &lt;a href="https://dev.to/aws/strands-multi-agent-systems-swarm-490j#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              Comments


              &lt;span class="hidden s:inline"&gt;Add Comment&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            5 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;




&lt;p&gt;In this post we'll dive deeper into another of those patterns, &lt;a href="https://strandsagents.com/latest/documentation/docs/user-guide/concepts/multi-agent/graph?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;Graph&lt;/a&gt;. I'll share code snippets and a the repo with examples that you can follow along. &lt;/p&gt;

&lt;h1&gt;
  
  
  Strands Multi-Agent Systems: Graph
&lt;/h1&gt;

&lt;p&gt;While Swarms are all about autonomous collaboration and dynamic handoffs, the Graph pattern brings structure and determinism to multi-agent orchestration. You can think of it as the difference between a jazz band improvising together versus a symphony orchestra following a conductor's score. While both can be powerful, they ultimately serve different purposes.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Is a Graph Multi-Agent System?
&lt;/h2&gt;

&lt;p&gt;A Graph in Strands is a deterministic directed graph based agent orchestration system. In this system, agents are nodes in a graph and each node is executed based on edge dependencies. In practice what this means is the output from one node is passed as input to connected and dependent nodes.&lt;/p&gt;

&lt;p&gt;Unlike sequential workflows where agents simply pass results down a line, or swarms where agents collaborate dynamically, graphs provide structured coordination. Each agent knows exactly when to execute based on the completion of its dependencies.&lt;/p&gt;

&lt;p&gt;Key characteristics of the Graph pattern:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Deterministic execution order&lt;/strong&gt; based on graph structure&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Output propagation&lt;/strong&gt; along edges between nodes&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Clear dependency management&lt;/strong&gt; between agents&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Conditional logic&lt;/strong&gt; for dynamic workflows&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Support for cyclic patterns&lt;/strong&gt; with proper safeguards&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Nested multi-agent systems&lt;/strong&gt; (like another Graph as a node!)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The benefits of this pattern are its predictability. You define your agents, specify their relationships (dependencies), and let the graph handle the execution orchestration.&lt;/p&gt;

&lt;h2&gt;
  
  
  How Graphs Work
&lt;/h2&gt;

&lt;p&gt;Every graph consists of three core components working together:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;GraphNode&lt;/code&gt;&lt;/strong&gt; represents a node on the graph with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A unique identifier&lt;/li&gt;
&lt;li&gt;The executor (your actual Agent instance)&lt;/li&gt;
&lt;li&gt;Dependencies on other nodes&lt;/li&gt;
&lt;li&gt;Execution status tracking&lt;/li&gt;
&lt;li&gt;Performance metrics&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;GraphEdge&lt;/code&gt;&lt;/strong&gt; defines the connections between nodes, specifying:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Source and target nodes&lt;/li&gt;
&lt;li&gt;Optional conditions that determine if the edge should be traversed&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;GraphBuilder&lt;/code&gt;&lt;/strong&gt; provides a simple interface for constructing graphs, letting you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Add nodes to the graph&lt;/li&gt;
&lt;li&gt;Create edges between them&lt;/li&gt;
&lt;li&gt;Set entry points for execution&lt;/li&gt;
&lt;li&gt;Configure timeouts and max executions&lt;/li&gt;
&lt;li&gt;Validate the graph structure&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Input Propagation and Context Management
&lt;/h2&gt;

&lt;p&gt;One crucial aspect of graphs is how information flows between agents. The graph automatically builds input for each node based on its dependencies.&lt;/p&gt;

&lt;p&gt;Entry point nodes receive the original task as input, while dependent nodes receive a combined input that includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The original task description&lt;/li&gt;
&lt;li&gt;Results from all completed dependency nodes&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This ensures each agent has full context while maintaining clean separation of concerns. In this sample use case with 4 nodes, the report agent, for instance, gets both the original research agent and the fact-checking agent outputs without needing to coordinate directly with those agents.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgjtqj85s7k6xrpq569an.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgjtqj85s7k6xrpq569an.png" alt=" "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here's what the formatted input for a dependent node looks like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Original Task: [The original task text]

Inputs from previous nodes:
From [node_id]:
- [Agent name]: [Result text]

From [another_node_id]:
- [Agent name]: [Result text]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Practical Implementation
&lt;/h2&gt;

&lt;p&gt;Creating a graph involves defining your agents, building the graph structure, and executing it:&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Define Your Agents
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Create specialized agents
&lt;/span&gt;&lt;span class="n"&gt;researcher&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Agent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;researcher&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;system_prompt&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;You are a research specialist...&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;analyst&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Agent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;analyst&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;system_prompt&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;You are a data analysis specialist...&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;fact_checker&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Agent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;fact_checker&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;system_prompt&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;You are a fact checking specialist...&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;report_writer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Agent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;report_writer&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;system_prompt&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;You are a report writing specialist...&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 2: Build the Graph Structure
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Build the graph
&lt;/span&gt;&lt;span class="n"&gt;builder&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;GraphBuilder&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="c1"&gt;# Add nodes
&lt;/span&gt;&lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add_node&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;researcher&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;research&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add_node&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;analyst&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;analysis&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add_node&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fact_checker&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;fact_check&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add_node&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;report_writer&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;report&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Add edges (dependencies)
&lt;/span&gt;&lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add_edge&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;research&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;analysis&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add_edge&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;research&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;fact_check&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add_edge&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;analysis&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;report&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add_edge&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;fact_check&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;report&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Build the graph
&lt;/span&gt;&lt;span class="n"&gt;graph&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;build&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 3: Execute and Analyze Results
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Execute the graph on a task
&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;graph&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Research the impact of AI on healthcare and create a comprehensive report&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Access the results
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Execution order: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;node&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;node_id&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;node&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;execution_order&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Get performance metrics
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Total nodes: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;total_nodes&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Completed nodes: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;completed_nodes&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Failed nodes: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;failed_nodes&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Execution time: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;execution_time&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;ms&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Token usage: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;accumulated_usage&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The graph returns detailed results including execution status, which agents participated, individual agent outputs, performance metrics, and token usage statistics.&lt;/p&gt;

&lt;h2&gt;
  
  
  Common Graph Topologies
&lt;/h2&gt;

&lt;p&gt;There are three common graph patterns you might encounter:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Sequential Pipeline&lt;/strong&gt;: Good for quality control workflows where each step builds on the previous one. Research → Analysis → Review → Report.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl5jiznffrzfanbpd5epu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl5jiznffrzfanbpd5epu.png" alt=" "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Parallel Processing&lt;/strong&gt;: A coordinator distributes work to multiple specialists, then aggregates results. Great for comprehensive analysis from different perspectives/specialiazed agents.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsprxa1digbr9vdgqt1rd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsprxa1digbr9vdgqt1rd.png" alt=" "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Branching Logic&lt;/strong&gt;: A classifier determines which specialized branch to take. Useful for routing different types of requests to appropriate specialists.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5zod9wivd3mome70oq19.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5zod9wivd3mome70oq19.png" alt=" "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conditional Edges
&lt;/h2&gt;

&lt;p&gt;One powerful feature of graphs is conditional edges. Like you saw in the branching topology, they let you create dynamic workflows based on intermediate results:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;only_if_research_successful&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;Only traverse if research was successful.&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="n"&gt;research_node&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;results&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;research&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;research_node&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="bp"&gt;False&lt;/span&gt;

    &lt;span class="c1"&gt;# Check if research result contains success indicator
&lt;/span&gt;    &lt;span class="n"&gt;result_text&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;research_node&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;successful&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;result_text&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;lower&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="c1"&gt;# Add conditional edge
&lt;/span&gt;&lt;span class="n"&gt;builder&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add_edge&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;research&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;analysis&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;condition&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;only_if_research_successful&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  When to Use Graph
&lt;/h2&gt;

&lt;p&gt;A Graph is ideal when you need a structured process with conditional logic, branching, or loops with deterministic execution flow. It performs well for modeling business processes or any task where the next step is decided by the outcome of the current one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Best Practices 💡
&lt;/h2&gt;

&lt;p&gt;From exploring the graph pattern, here are some best practices:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Leverage conditional edges&lt;/strong&gt; - Create dynamic workflows based on intermediate results&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Handle failures gracefully&lt;/strong&gt; - Think about how node failures affect the overall workflow&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Nest strategically&lt;/strong&gt; - Use Swarms within Graphs for complex workflows combining structure and collaboration&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Set appropriate limits&lt;/strong&gt; - Use timeouts and max executions, especially for cyclic graphs&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Swarm vs. Graph: When to Choose Which?
&lt;/h2&gt;

&lt;p&gt;Now that we've covered two patterns, you might be wondering when to use each:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use Swarm when:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The problem benefits from exploration and brainstorming&lt;/li&gt;
&lt;li&gt;You want agents to dynamically decide who should handle what&lt;/li&gt;
&lt;li&gt;Collaboration and handoffs are central to the solution&lt;/li&gt;
&lt;li&gt;The optimal agent sequence isn't known upfront&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Use Graph when:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You have a clear workflow structure with known dependencies&lt;/li&gt;
&lt;li&gt;Deterministic execution order is important&lt;/li&gt;
&lt;li&gt;You need conditional branching or feedback loops&lt;/li&gt;
&lt;li&gt;Different parts of the workflow can run in parallel&lt;/li&gt;
&lt;li&gt;You're modeling a business process&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In the last post of this series we'll dive deeper into the Agents as Tools pattern, so stay tuned for that!&lt;/p&gt;

&lt;p&gt;Don't forget to give me a 🦄 if you got this far and let me know what pattern you're most excited to try in the comments!&lt;/p&gt;

&lt;h3&gt;
  
  
  Additional Resources 📚
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.analyticsvidhya.com/courses/building-multi-agent-systems-with-strands-agents/?utm_source=new_course_home_page&amp;amp;trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;Free video course with code&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://github.com/strands-agents/samples/tree/main/01-tutorials/02-multi-agent-systems/03-graph-agent?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;Example Notebook for Graph&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://strandsagents.com/latest/documentation/docs/user-guide/concepts/multi-agent/graph/?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;Graph Pattern Documentation&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://strandsagents.com/latest/user-guide/quickstart?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;Strands Agents Quickstart&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>aws</category>
      <category>agents</category>
      <category>ai</category>
      <category>learning</category>
    </item>
    <item>
      <title>Strands Multi-Agent Systems: Swarm</title>
      <dc:creator>Laura Salinas</dc:creator>
      <pubDate>Fri, 24 Oct 2025 14:00:00 +0000</pubDate>
      <link>https://dev.to/aws/strands-multi-agent-systems-swarm-490j</link>
      <guid>https://dev.to/aws/strands-multi-agent-systems-swarm-490j</guid>
      <description>&lt;p&gt;In my last post I started introducing the concept of multi agent systems and gave a brief overview of the 5 patterns you can explore with &lt;a href="https://strandsagents.com/latest?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;Strands Agents&lt;/a&gt; 👇🏼&lt;/p&gt;

&lt;p&gt;

&lt;/p&gt;
&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/aws/multi-agent-systems-with-strands-agents-from-theory-to-swarm-intelligence-1nm6" class="crayons-story__hidden-navigation-link"&gt;Multi-Agent Systems with Strands Agents&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;
          &lt;a class="crayons-logo crayons-logo--l" href="/aws"&gt;
            &lt;img alt="AWS logo" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F1726%2F2a73f1e6-7995-4348-ae37-44b064274c59.png" class="crayons-logo__image"&gt;
          &lt;/a&gt;

          &lt;a href="/lausalin" class="crayons-avatar  crayons-avatar--s absolute -right-2 -bottom-2 border-solid border-2 border-base-inverted  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2961139%2F1ef5780a-c649-4402-9b4f-d5f5be866b63.jpg" alt="lausalin profile" class="crayons-avatar__image"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/lausalin" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Laura Salinas
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Laura Salinas
                
              
              &lt;div id="story-author-preview-content-2941402" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/lausalin" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2961139%2F1ef5780a-c649-4402-9b4f-d5f5be866b63.jpg" class="crayons-avatar__image" alt=""&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Laura Salinas&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

            &lt;span&gt;
              &lt;span class="crayons-story__tertiary fw-normal"&gt; for &lt;/span&gt;&lt;a href="/aws" class="crayons-story__secondary fw-medium"&gt;AWS&lt;/a&gt;
            &lt;/span&gt;
          &lt;/div&gt;
          &lt;a href="https://dev.to/aws/multi-agent-systems-with-strands-agents-from-theory-to-swarm-intelligence-1nm6" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Oct 19 '25&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/aws/multi-agent-systems-with-strands-agents-from-theory-to-swarm-intelligence-1nm6" id="article-link-2941402"&gt;
          Multi-Agent Systems with Strands Agents
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/aws"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;aws&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/agents"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;agents&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/ai"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;ai&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/learning"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;learning&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
          &lt;a href="https://dev.to/aws/multi-agent-systems-with-strands-agents-from-theory-to-swarm-intelligence-1nm6" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left"&gt;
            &lt;div class="multiple_reactions_aggregate"&gt;
              &lt;span class="multiple_reactions_icons_container"&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/multi-unicorn-b44d6f8c23cdd00964192bedc38af3e82463978aa611b4365bd33a0f1f4f3e97.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/fire-f60e7a582391810302117f987b22a8ef04a2fe0df7e3258a5f49332df1cec71e.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/sparkle-heart-5f9bee3767e18deb1bb725290cb151c25234768a0e9a2bd39370c382d02920cf.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
              &lt;/span&gt;
              &lt;span class="aggregate_reactions_counter"&gt;10&lt;span class="hidden s:inline"&gt; reactions&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/a&gt;
            &lt;a href="https://dev.to/aws/multi-agent-systems-with-strands-agents-from-theory-to-swarm-intelligence-1nm6#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              Comments


              &lt;span class="hidden s:inline"&gt;Add Comment&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            4 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;




&lt;p&gt;In this post we'll dive deeper into one of those patterns, &lt;a href="https://strandsagents.com/latest/documentation/docs/user-guide/concepts/multi-agent/swarm?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;Swarm&lt;/a&gt;. I'll share coding snippets and a the repo with examples that you can follow along. &lt;/p&gt;

&lt;h3&gt;
  
  
  What Is Swarm Intelligence?
&lt;/h3&gt;

&lt;p&gt;Think about an ant colony: thousands of individual ants, each following simple rules, yet together they build complex structures, find optimal food sources, and adapt to challenges. No single ant directs the colony, yet collective intelligence emerges.&lt;/p&gt;

&lt;p&gt;Agent swarms apply this same principle found in nature to artificial intelligence. Instead of one powerful agent trying to solve everything, we create multiple specialized agents that work together as a team. Each agent has its own expertise, but they share knowledge and can coordinate their efforts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key characteristics of agent swarms:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Self-organizing teams with shared working memory&lt;/li&gt;
&lt;li&gt;Tool-based coordination between agents&lt;/li&gt;
&lt;li&gt;Autonomous collaboration without central control&lt;/li&gt;
&lt;li&gt;Dynamic task distribution based on agent capabilities&lt;/li&gt;
&lt;li&gt;Collective intelligence through shared context&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This pattern often leads to &lt;strong&gt;emergent intelligence&lt;/strong&gt;, or the idea that a group of specialized agents working together can solve problems more effectively than even the most sophisticated single agent. Why you may ask? Well the theory lies in the understanding that as agents work together, they're approaching unexpected behaviors, creativity, and problem-solving capabilities that were not explicitly coded by their developers.&lt;/p&gt;

&lt;h3&gt;
  
  
  How Swarms Work
&lt;/h3&gt;

&lt;p&gt;In the Strands Agents framework, each agent in a swarm has access to four critical components:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Full Task Context&lt;/strong&gt; - Every agent sees the complete problem&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Agent History&lt;/strong&gt; - They know which agents have worked on the task&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Shared Knowledge&lt;/strong&gt; - They access insights from other agents&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Handoff Capability&lt;/strong&gt; - They can transfer control to specialist agents&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Coordination Mechanisms
&lt;/h3&gt;

&lt;p&gt;Effective coordination is what separates a swarm from just multiple agents working separately. The Strands framework provides built-in coordination tools to make this easy to accomplish. &lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;Handoff Tool&lt;/strong&gt; allows agents to transfer control precisely. For example, a handoff tool can give an agent named &lt;code&gt;coder&lt;/code&gt; the context and let it implement the necessary Python code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Handoff Tool Description: Transfer control to another agent in the swarm for specialized help.
&lt;/span&gt;&lt;span class="nf"&gt;handoff_to_agent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;agent_name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;coder&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;I need help implementing this algorithm in Python&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;algorithm_details&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;...&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Shared context&lt;/strong&gt; ensures every agent has the full picture. When an agent receives a handoff, they see:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The handoff message explaining why they were called&lt;/li&gt;
&lt;li&gt;The original user request&lt;/li&gt;
&lt;li&gt;Which agents worked on this previously&lt;/li&gt;
&lt;li&gt;Shared knowledge from all previous agents&lt;/li&gt;
&lt;li&gt;List of other available specialists&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Swarms in Strands also support &lt;strong&gt;multi-modal inputs&lt;/strong&gt;—not just text, but images as well. This means your swarm can analyze diagrams, process reports, and generate a comprehensive analysis all in one workflow.&lt;/p&gt;

&lt;p&gt;Here's an example of a multi-modal agent swarm:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;strands&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Agent&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;strands.multiagent&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Swarm&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;strands.types.content&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;ContentBlock&lt;/span&gt;

&lt;span class="c1"&gt;# Create agents for image processing workflow
&lt;/span&gt;&lt;span class="n"&gt;image_analyzer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Agent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;image_analyzer&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;system_prompt&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;You are an image analysis expert...&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;report_writer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Agent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;report_writer&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;system_prompt&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;You are a report writing expert...&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Create the swarm
&lt;/span&gt;&lt;span class="n"&gt;swarm&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Swarm&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;image_analyzer&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;report_writer&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;

&lt;span class="c1"&gt;# Create content blocks with text and image
&lt;/span&gt;&lt;span class="n"&gt;content_blocks&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="nc"&gt;ContentBlock&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Analyze this image and create a report about what you see:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="nc"&gt;ContentBlock&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;image&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;format&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;png&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;source&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;bytes&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;image_bytes&lt;/span&gt;&lt;span class="p"&gt;}}),&lt;/span&gt;
&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="c1"&gt;# Execute the swarm with multi-modal input
&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;swarm&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;content_blocks&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Practical Implementation
&lt;/h3&gt;

&lt;p&gt;Creating a swarm involves three key steps:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Define Your Agents&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Create specialized agents
&lt;/span&gt;&lt;span class="n"&gt;researcher&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Agent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;researcher&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;system_prompt&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;You are a research specialist...&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;coder&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Agent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;coder&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;system_prompt&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;You are a coding specialist...&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;reviewer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Agent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;reviewer&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;system_prompt&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;You are a code review specialist...&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;architect&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Agent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;architect&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;system_prompt&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;You are a system architecture specialist...&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 2: Create a swarm and configure behavior and safety parameters&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Create a swarm with these agents, starting with the researcher
&lt;/span&gt;&lt;span class="n"&gt;swarm&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Swarm&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;coder&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;researcher&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;reviewer&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;architect&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="n"&gt;entry_point&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;researcher&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="c1"&gt;# Start with the researcher
&lt;/span&gt;    &lt;span class="n"&gt;max_handoffs&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;max_iterations&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;execution_timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mf"&gt;900.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="c1"&gt;# 15 minutes
&lt;/span&gt;    &lt;span class="n"&gt;node_timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mf"&gt;300.0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;       &lt;span class="c1"&gt;# 5 minutes per agent
&lt;/span&gt;    &lt;span class="n"&gt;repetitive_handoff_detection_window&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="c1"&gt;# There must be &amp;gt;= 3 unique agents in the last 8 handoffs
&lt;/span&gt;    &lt;span class="n"&gt;repetitive_handoff_min_unique_agents&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 3: Execute and Analyze Results&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Execute the swarm on a task
&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;swarm&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Design and implement a simple REST API for a todo app&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Access node history
&lt;/span&gt;&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Node history: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;node&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;node_id&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;node&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;node_history&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The swarm constructor can return detailed results including execution status, which agents participated, individual agent outputs, performance metrics, and token usage statistics.&lt;/p&gt;

&lt;h3&gt;
  
  
  When to Use Swarm
&lt;/h3&gt;

&lt;p&gt;A Swarm is ideal when your problem can be broken down into sub-tasks that benefit from different specialized perspectives. It's best for exploration, brainstorming, or synthesizing information from multiple sources through collaborative handoffs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Context Management at Scale 📊
&lt;/h2&gt;

&lt;p&gt;One challenge worth mentioning with swarms is managing shared context at scale. When every agent has access to the full context, things can get bloated quickly. &lt;/p&gt;

&lt;p&gt;Strands has an interesting solution to this with the &lt;code&gt;use_llm&lt;/code&gt; tool. This allows you to have dynamic LLMs that perform specific tasks and return just the results, keeping the main agent's context lean. You can check out more details in the &lt;a href="https://strandsagents.com/latest/documentation/docs/user-guide/concepts/tools/community-tools-package/#agentsworkflows:~:text=of%20agentic%20reasoning-,use_llm,-%3A%20Run%20a%20newtrk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;Strands community built tools&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Best Practices 💡
&lt;/h2&gt;

&lt;p&gt;From my exploration of swarm patterns, here are some best practices to keep in mind:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Create specialized agents&lt;/strong&gt; - Define clear roles for each agent in your swarm&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Set appropriate timeouts&lt;/strong&gt; - Base these on task complexity and expected runtime&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Enable repetitive handoff detection&lt;/strong&gt; - Prevent ping-pong behavior between agents&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In the coming weeks we'll dive deeper into Graph and Agents as Tools patterns, so stay tuned for that!&lt;/p&gt;

&lt;p&gt;Don't forget to give me a 🦄 if you got this far and let me know what pattern you're most excited to try in the comments!&lt;/p&gt;

&lt;h3&gt;
  
  
  Additional Resources 📚
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.analyticsvidhya.com/courses/building-multi-agent-systems-with-strands-agents/?utm_source=new_course_home_page&amp;amp;trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;Free video course with code&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://github.com/strands-agents/samples/tree/main/01-tutorials/02-multi-agent-systems/02-swarm-agent?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;Example Notebook for Swarm&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://strandsagents.com/latest/documentation/docs/user-guide/concepts/multi-agent/swarm?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;Swarm Pattern Documentation&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://strandsagents.com/latest/user-guide/quickstart?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;Strands Agents Quickstart&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>aws</category>
      <category>agents</category>
      <category>ai</category>
      <category>learning</category>
    </item>
    <item>
      <title>Multi-Agent Systems with Strands Agents</title>
      <dc:creator>Laura Salinas</dc:creator>
      <pubDate>Sun, 19 Oct 2025 20:26:48 +0000</pubDate>
      <link>https://dev.to/aws/multi-agent-systems-with-strands-agents-from-theory-to-swarm-intelligence-1nm6</link>
      <guid>https://dev.to/aws/multi-agent-systems-with-strands-agents-from-theory-to-swarm-intelligence-1nm6</guid>
      <description>&lt;p&gt;As AI agents continue to evolve, I've been diving deep into multi-agent systems and specifically how we can leverage certain patterns to tackle complex problems that single agents simply can't handle alone. Think of it like assembling a team of specialists rather than relying on one generalist to do everything.&lt;/p&gt;

&lt;p&gt;In this post I'll walk through the fundamentals of multi-agent systems and introduce some key patterns you should know about.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Are Multi-Agent Systems? 🤖
&lt;/h2&gt;

&lt;p&gt;At its core, a multi-agent system is composed of multiple autonomous agents that interact with each other to achieve a mutual goal—one that's typically too complex or too large for any single agent to reach alone.&lt;/p&gt;

&lt;h3&gt;
  
  
  Core Principles
&lt;/h3&gt;

&lt;p&gt;Three key principles govern effective multi-agent systems:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Orchestration&lt;/strong&gt; - A controlling logic or structure to manage the flow of information and tasks between agents. This is like having a conductor in an orchestra, ensuring everyone knows when to play their part.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Specialization&lt;/strong&gt; - Each agent has a specific role or expertise, and a set of tools that it can use. Rather than having generalist agents, we create specialists. One might excel at data analysis, another at natural language processing, and another at writing code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Collaboration&lt;/strong&gt; - Agents communicate and share information to build upon each other's work. This isn't just parallel processing—it's true collaboration where agents build upon each other's contributions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Architectural Designs 🏗️
&lt;/h2&gt;

&lt;p&gt;Multi-agent systems can be organized into three main types, each suited to different types of problems:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Hierarchical Systems&lt;/strong&gt; use a central orchestrator agent that interprets the overall task, decomposes it into subtasks, and delegates those to worker agents, each optimized for a particular domain. This mirrors traditional organizational structures with clear chains of command.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Broadcast Systems&lt;/strong&gt; share information broadly across all agents simultaneously. This ensures everyone has the same context, but can lead to information overload.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Graph-Based Systems&lt;/strong&gt; allow for complex communication patterns where agents form networks of relationships. These agents may operate independently or with other agents by sharing information, dividing responsibilities, and collectively reasoning toward a goal.&lt;/p&gt;

&lt;h2&gt;
  
  
  Fundamental Patterns 🎯
&lt;/h2&gt;

&lt;p&gt;Now let's explore the five primary patterns of multi-agent systems. Each has distinct characteristics and use cases:&lt;/p&gt;

&lt;h3&gt;
  
  
  Pattern 1: Swarm
&lt;/h3&gt;

&lt;p&gt;The Swarm pattern represents a dynamic, collaborative team of agents that autonomously hand off tasks. A developer provides a pool of agents, and the agents themselves decide the path.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Characteristics:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Autonomous decision-making about handoffs&lt;/li&gt;
&lt;li&gt;Emergent execution paths&lt;/li&gt;
&lt;li&gt;Shared context across all agents&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Pattern 2: Workflow
&lt;/h3&gt;

&lt;p&gt;The Workflow pattern represents a structured coordination of tasks across multiple AI agents, where each agent performs specialized functions in a defined sequence or pattern. Here, a developer defines all tasks and their dependencies in code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Characteristics:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Predictable execution&lt;/li&gt;
&lt;li&gt;Excellent for repeatable processes&lt;/li&gt;
&lt;li&gt;Efficient parallel processing&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Pattern 3: Graph
&lt;/h3&gt;

&lt;p&gt;The Graph pattern combines structure with flexibility. A structured, developer-defined flowchart where an agent decides which path to take. Developers define all nodes (agents) and edges (transitions) in advance, but the actual path is determined dynamically by the agents.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Characteristics:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Structured yet flexible&lt;/li&gt;
&lt;li&gt;Conditional logic and branching&lt;/li&gt;
&lt;li&gt;Error handling through defined paths&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Pattern 4: Agent as Tool
&lt;/h3&gt;

&lt;p&gt;An architectural pattern where specialized AI agents are wrapped as callable functions (tools) that can be used by other agents.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Characteristics:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Clear separation of concerns&lt;/li&gt;
&lt;li&gt;Hierarchical delegation&lt;/li&gt;
&lt;li&gt;Modular architecture that's easy to maintain&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Pattern 5: Agent-to-Agent (A2A) Protocol
&lt;/h3&gt;

&lt;p&gt;Announced in April 2025, this pattern represents a breakthrough in multi-agent architecture. It's an open standard that enables AI agents from different platforms, organizations, and implementations to discover, communicate, and collaborate seamlessly.&lt;/p&gt;

&lt;p&gt;Unlike the previous patterns which operate within a single system, A2A creates a distributed ecosystem where agents can work across organizational and technical boundaries. Each A2A-enabled agent exposes an "agent card", which is a standardized description of its capabilities, skills, and interfaces.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Characteristics:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Multi-agent workflows across platforms&lt;/li&gt;
&lt;li&gt;Agent marketplaces for discovering and using agents from different providers&lt;/li&gt;
&lt;li&gt;Cross-platform integration&lt;/li&gt;
&lt;li&gt;Distributed AI systems at scale&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Collaboration, Negotiation, and Emergent Behavior 🌟
&lt;/h2&gt;

&lt;p&gt;What makes multi-agent systems truly powerful is how agents collaborate and sometimes negotiate to achieve optimal outcomes.&lt;/p&gt;

&lt;h3&gt;
  
  
  Collaboration Mechanisms
&lt;/h3&gt;

&lt;p&gt;Each pattern handles collaboration differently. In Graph systems, a single, shared dict object is passed to all agents, who can freely read and modify it. In Swarm systems, a "shared context" or working memory is available to all agents, containing the original request, task history, and knowledge from previous agents.&lt;/p&gt;

&lt;h3&gt;
  
  
  Negotiation and Decision Making
&lt;/h3&gt;

&lt;p&gt;In swarm patterns especially, agents must negotiate who should handle what tasks. This isn't pre-programmed though, the agents use their understanding of the problem and their capabilities to make these decisions autonomously.&lt;/p&gt;

&lt;h3&gt;
  
  
  Emergent Behavior
&lt;/h3&gt;

&lt;p&gt;Perhaps most interesting is emergent behavior. These are complex problem-solving patterns that arise from simple agent interactions. A swarm might develop unexpected but effective solution paths that no single developer anticipated.&lt;/p&gt;

&lt;p&gt;For instance, in a customer service swarm, agents might develop novel escalation patterns based on customer sentiment analysis, creating more effective resolution paths than any pre-defined workflow.&lt;/p&gt;

&lt;h2&gt;
  
  
  Choosing the Right Pattern 🎨
&lt;/h2&gt;

&lt;p&gt;Choosing the right pattern is critical for building an effective system. Consider:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Deterministic vs. emergent behavior&lt;/strong&gt; - Do you need predictable outcomes or are you exploring possibilities?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Problem complexity&lt;/strong&gt; - How many moving parts and dependencies exist?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Parallel execution requirements&lt;/strong&gt; - Can tasks run simultaneously or must they be sequential?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Error handling needs&lt;/strong&gt; - How critical is it to have defined error paths?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cross-platform requirements&lt;/strong&gt; - Do you need agents from different organizations to collaborate?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As AI systems become more sophisticated, multi-agent architectures will enable us to tackle increasingly complex challenges by harnessing the collective intelligence of specialized AI agents working in harmony.&lt;/p&gt;

&lt;p&gt;In the coming weeks I'm planning to dive deeper into Swarm, Graph and Agents as Tools patterns, so stay tuned for that!&lt;/p&gt;

&lt;p&gt;Don't forget to give me a 🦄 if you got this far and let me know what pattern you're most excited to try in the comments!&lt;/p&gt;

&lt;h3&gt;
  
  
  Additional Resources 📚
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://strandsagents.com/latest/user-guide/quickstart?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;Strands Agents Quickstart&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://strandsagents.com/latest/documentation/docs/user-guide/concepts/multi-agent/multi-agent-patterns?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;Strands Agents Multi-Agent Documentation&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>aws</category>
      <category>agents</category>
      <category>ai</category>
      <category>learning</category>
    </item>
    <item>
      <title>First Impressions with Amazon Bedrock AgentCore</title>
      <dc:creator>Laura Salinas</dc:creator>
      <pubDate>Wed, 10 Sep 2025 23:28:36 +0000</pubDate>
      <link>https://dev.to/aws/first-impressions-with-amazon-bedrock-agentcore-5dje</link>
      <guid>https://dev.to/aws/first-impressions-with-amazon-bedrock-agentcore-5dje</guid>
      <description>&lt;p&gt;As we continue to see AI agents progress in their capabilities and versatility, I've been hearing from developers that most of their experience deploying agents remains local and experimental. Whether you're developing agents with tools like &lt;a href="https://strandsagents.com/latest/documentation/docs?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;Strands Agents&lt;/a&gt;, &lt;a href="https://www.crewai.com?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;Crew AI&lt;/a&gt;, &lt;a href="https://www.langchain.com/langgraph?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;LangGraph&lt;/a&gt; and others, the fact of the matter is moving from PoC to production-ready is mystifying, if not impossible at scale.&lt;/p&gt;

&lt;p&gt;In this post I'll cover some basics on a new AWS service to address this and my first experience using it.&lt;/p&gt;

&lt;p&gt;Now, as we look at this challenge I mentioned with PoC → Production, it's not surprising to see the preview launch of &lt;a href="https://aws.amazon.com/bedrock/agentcore?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;Amazon Bedrock AgentCore&lt;/a&gt; trying to fill this much needed gap for developers. &lt;/p&gt;

&lt;p&gt;For those who aren't aware, on July 16th AWS announced AgentCore to enable developers to deploy AI agents at scale using the well know ideals of a flexible, scaleable infrastructure and essential security controls (amongst other things). &lt;/p&gt;

&lt;p&gt;Of the many interesting things to come with this announcement is a somewhat unique mental model for an AWS service- AgentCore presents itself as a modular (think Lego pieces) toolbox of components allowing developers to pick what components they need and use them together or independently as their use case changes. &lt;/p&gt;

&lt;p&gt;In addition to its modularity, AgentCore is attempting to set itself apart by offering &lt;em&gt;&lt;em&gt;both&lt;/em&gt;&lt;/em&gt; model and agent framework choice (i.e., you don't have to use Amazon Bedrock and you can use open source frameworks).  &lt;/p&gt;

&lt;h3&gt;
  
  
  Understanding AgentCore Components 🧩
&lt;/h3&gt;

&lt;p&gt;Here's a simple breakdown of the 7 AgentCore components that are in preview:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;AgentCore Runtime:&lt;/strong&gt; a secure, serverless runtime for deploying and scaling AI agents and tools using any open-source framework, any protocol, and any model. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AgentCore Identity:&lt;/strong&gt; a secure, scalable agent identity and access management capability. Compatible with existing identity providers, eliminating needs for user migration or rebuilding authentication flows. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AgentCore Memory:&lt;/strong&gt; provides support for both short-term memory for multi-turn conversations and long-term memory that can be shared across agents and sessions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AgentCore Code Interpreter:&lt;/strong&gt; enables agents to securely execute code in isolated sandbox environments. Offers advanced configuration support and seamless integration with popular frameworks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AgentCore Browser:&lt;/strong&gt; provides a fast, secure, cloud-based browser runtime to enable AI agents to interact with websites at scale.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AgentCore Gateway:&lt;/strong&gt; a secure way for agents to discover and use tools along with easy transformation of APIs, Lambda functions, and existing services into agent-compatible tools. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AgentCore Observability:&lt;/strong&gt; helps developers trace, debug, and monitor agent performance in production through unified operational dashboards. Support for OpenTelemetry compatible telemetry and detailed visualizations of each step of the agent workflow.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As of this post, the preview for Bedrock AgentCore is currently only available in US East (N. Virginia), US West (Oregon), Asia Pacific (Sydney), and Europe (Frankfurt).&lt;/p&gt;

&lt;h3&gt;
  
  
  My experience with AgentCore Runtime 🔨
&lt;/h3&gt;

&lt;p&gt;I took a day to hack with AgentCore knowing absolutely nothing about it, and though I can't say it was a completely user-friendly experience, I'll walkthrough some areas I did enjoy and what I hope the team working on it can improve as it prepares for general availability. &lt;/p&gt;

&lt;p&gt;I started my AgentCore journey by going to the place I figured had the best setup for a true beginner: the official &lt;a href="https://github.com/awslabs/amazon-bedrock-agentcore-samples/tree/main?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;AWS Samples GitHub&lt;/a&gt;, from here there were several options for what I wanted to learn-&lt;/p&gt;

&lt;p&gt;1) Hosting Agents on Runtime&lt;br&gt;
2) Hosting an MCP Server on Runtime&lt;br&gt;
3) Advanced Concepts&lt;br&gt;
4) Hosting TypeScript based MCP on Runtime&lt;/p&gt;

&lt;p&gt;I opted for the first option and the tutorials here come in three flavors as seen below&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fijegnf3ndeqjbplnsxfd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fijegnf3ndeqjbplnsxfd.png" alt=" " width="800" height="146"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I've been working quite a bit with the Strands Agents framework and wanted to use my Antropic API key, so I followed the &lt;a href="https://github.com/awslabs/amazon-bedrock-agentcore-samples/tree/main/01-tutorials/01-AgentCore-runtime/01-hosting-agent/03-strands-with-openai-model?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;OpenAI example&lt;/a&gt; for my hack as it was the closest to what I wanted to do. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Note: While I'm usually a fan of Jupyter Notebooks I found this one a bit challenging to follow and noticed it adds a lot of complexity to what is already a somewhat complex service to use. I've given feedback to the team but wanted to share my 2 cents if you're also using some of these notebook tutorials.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The example in the notebook creates a tool for the agent which I opted out of and instead use a pre-existing &lt;a href="https://github.com/strands-agents/tools/blob/main/src/strands_tools/use_aws.py?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;Strands tool for AWS use&lt;/a&gt;. My code looks a bit different than what you'll find in the notebook. For context here is what my agent.py file looks like and how I prepared it for use with AgentCore Runtime.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;⚠️Note: The &lt;code&gt;use_aws&lt;/code&gt; tool looks for my AWS profile locally to authenticate using &lt;code&gt;~/.aws/credentials&lt;/code&gt;, you'll need that setup before attempting to use this tool or any others that require AWS account use.&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;


&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;bedrock_agentcore.runtime&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;BedrockAgentCoreApp&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;strands&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Agent&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;strands.models.anthropic&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;AnthropicModel&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;strands_tools&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;use_aws&lt;/span&gt; 

&lt;span class="n"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;BedrockAgentCoreApp&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="n"&gt;model&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;AnthropicModel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;client_args&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;api_key&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getenv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;api_key&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="c1"&gt;# **model_config
&lt;/span&gt;    &lt;span class="n"&gt;max_tokens&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;1028&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;model_id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;claude-sonnet-4-20250514&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;params&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;temperature&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.3&lt;/span&gt;&lt;span class="p"&gt;,}&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;agent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Agent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tools&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;use_aws&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;

&lt;span class="nd"&gt;@app.entrypoint&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;strands_agent_anthropic&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;
    Invoke the agent with a payload
    &lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="n"&gt;user_input&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;payload&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;prompt&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;agent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;user_input&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;content&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;text&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s"&gt;n&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;__name__&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;__main__&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Main things to highlight here are lines of code you need in order to prepare your agent to work with Runtime, they're listed in the notebook, but I'll share here for simplicity as well:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Import the Runtime App with &lt;code&gt;from bedrock_agentcore.runtime import BedrockAgentCoreApp&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Initialize the App in your code with &lt;code&gt;app = BedrockAgentCoreApp()&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Decorate the invocation function with the &lt;code&gt;@app.entrypoint&lt;/code&gt; decorator&lt;/li&gt;
&lt;li&gt;Let AgentCore Runtime control the running of the agent with &lt;code&gt;app.run()&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once this is complete I need to deploy the agent to Runtime. This can be done in one of two ways, either manually (several more steps, more to manage and requires experience with docker) &lt;strong&gt;OR&lt;/strong&gt; using the AgentCore &lt;a href="https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/getting-started-starter-toolkit.html?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;starter toolkit&lt;/a&gt; which is a CLI toolkit that manages a lot of the deployment steps for you. For those that want to maintain full control over their agent's implementation, this section of the &lt;a href="https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/getting-started-custom.html?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;documentation&lt;/a&gt; describes how to deploy agents to Runtime &lt;em&gt;without&lt;/em&gt; the toolkit.&lt;/p&gt;

&lt;p&gt;Using the starter toolkit the next steps are fairly straightforward. &lt;/p&gt;

&lt;p&gt;1) Configure the agent with default values using: &lt;code&gt;agentcore configure -e agent.py&lt;/code&gt; in the terminal. &lt;br&gt;
2) Host the agent in Runtime using: &lt;code&gt;agentcore launch&lt;/code&gt; in the terminal. &lt;/p&gt;

&lt;p&gt;If all goes well on the backend I should see a success message on the terminal that looks like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fno75c15pnqgz2e3tehij.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fno75c15pnqgz2e3tehij.png" alt=" " width="800" height="285"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To invoke the agent I can use &lt;code&gt;agentcore invoke '{"prompt": "how many VPCs do I have in us-west-2?"}'&lt;/code&gt; in the terminal &lt;em&gt;(this is an example prompt for my particular agent which uses a Strands tool to extract information in my AWS account)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Looks like everything is working well because I can see the results from that agent interaction in my terminal:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F27ivzh5ohpgdwtnl23pa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F27ivzh5ohpgdwtnl23pa.png" alt=" " width="800" height="256"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now let me quickly cover the painpoints I discovered along the way...&lt;/p&gt;

&lt;h3&gt;
  
  
  Challenges, pain points etc. 😵‍💫
&lt;/h3&gt;

&lt;p&gt;In using the sample notebooks there is &lt;u&gt;&lt;strong&gt;no&lt;/strong&gt;&lt;/u&gt; mention of enabling observability for the agent which is a &lt;strong&gt;requirement&lt;/strong&gt; as stated in step 1 of the getting started &lt;a href="https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/getting-started-starter-toolkit.html#starter-toolkit-enable-observability?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;documentation&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;TLDR; you need to enable CloudWatch Transaction Search in order for AgentCore Runtime to properly invoke your agent.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;This led to several hard to debug/track invokation errors in my terminal. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;My particular agent was performing a boto3 operation using EC2 and thus required IAM permissions that are not default. Finding the IAM execution role for the agent to edit these permissions was particularly tricky.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;FYI you can find this agent execution role in one of three ways:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;1) Searching the IAM AWS console for “agentcore'” and working backwards to find the role&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxzkr5247e61h7astosti.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxzkr5247e61h7astosti.png" alt=" " width="800" height="233"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;2) Open the hidden yaml file generated at time of configuration and look under ‘execution role’&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feppn3e8wvghpgkdkpi46.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feppn3e8wvghpgkdkpi46.png" alt=" " width="800" height="181"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;3) Navigate to the AgentCore AWS console → agent runtime → agent name → versions → IAM service role &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx5ir2po34byaxhjx1vgg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx5ir2po34byaxhjx1vgg.png" alt=" " width="800" height="386"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Overall once I was setup correctly to use Runtime things did work smoothly and the start toolkit was valuable, however there is still a lot of room for folks to get tripped up when using this and unfortnatley the examples themselves need some sharpening to avoid common pitfalls. &lt;/p&gt;

&lt;p&gt;In the coming weeks I'm looking to explore other components of AgentCore such as Memory and Gateway so stay tuned for that. &lt;/p&gt;

&lt;p&gt;Don't forget to give me a 🦄 if you got this far and let me know what else you'd like to see a write up on in the comments!&lt;/p&gt;

&lt;h3&gt;
  
  
  Additional Resources 📚
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/what-is-bedrock-agentcore.html?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;Amazon Bedrock AgentCore Documentation&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://github.com/awslabs/amazon-bedrock-agentcore-samples/tree/main?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;Amazon Bedrock AgentCore Samples&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://catalog.us-east-1.prod.workshops.aws/workshops/015a2de4-9522-4532-b2eb-639280dc31d8/en-US?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;Diving Deep into Bedrock AgentCore- Workshop&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>aws</category>
      <category>beginners</category>
      <category>agents</category>
      <category>ai</category>
    </item>
    <item>
      <title>Using Strands Agents with Anthropic API 🧬</title>
      <dc:creator>Laura Salinas</dc:creator>
      <pubDate>Tue, 08 Jul 2025 21:00:40 +0000</pubDate>
      <link>https://dev.to/aws/using-strands-agents-with-anthropic-20jn</link>
      <guid>https://dev.to/aws/using-strands-agents-with-anthropic-20jn</guid>
      <description>&lt;p&gt;It's been a few weeks since I talked about using &lt;a href="https://strandsagents.com/latest?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;Strands Agents&lt;/a&gt; for the first time and I wanted to add a quick update on two pieces I've been experimenting with this week.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Using Anthropic as a model provider instead of Amazon Bedrock&lt;/li&gt;
&lt;li&gt;Using other helpful built-in tools&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you haven't already setup Strands, check out my last post to get started.&lt;/p&gt;


&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/aws/first-impressions-with-strands-agents-sdk-4hha" class="crayons-story__hidden-navigation-link"&gt;First Impressions with Strands Agents SDK 🧬&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;
          &lt;a class="crayons-logo crayons-logo--l" href="/aws"&gt;
            &lt;img alt="AWS logo" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F1726%2F2a73f1e6-7995-4348-ae37-44b064274c59.png" class="crayons-logo__image"&gt;
          &lt;/a&gt;

          &lt;a href="/lausalin" class="crayons-avatar  crayons-avatar--s absolute -right-2 -bottom-2 border-solid border-2 border-base-inverted  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2961139%2F1ef5780a-c649-4402-9b4f-d5f5be866b63.jpg" alt="lausalin profile" class="crayons-avatar__image"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/lausalin" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Laura Salinas
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Laura Salinas
                
              
              &lt;div id="story-author-preview-content-2616406" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/lausalin" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2961139%2F1ef5780a-c649-4402-9b4f-d5f5be866b63.jpg" class="crayons-avatar__image" alt=""&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Laura Salinas&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

            &lt;span&gt;
              &lt;span class="crayons-story__tertiary fw-normal"&gt; for &lt;/span&gt;&lt;a href="/aws" class="crayons-story__secondary fw-medium"&gt;AWS&lt;/a&gt;
            &lt;/span&gt;
          &lt;/div&gt;
          &lt;a href="https://dev.to/aws/first-impressions-with-strands-agents-sdk-4hha" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Jun 23 '25&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/aws/first-impressions-with-strands-agents-sdk-4hha" id="article-link-2616406"&gt;
          First Impressions with Strands Agents SDK 🧬
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/aws"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;aws&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/beginners"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;beginners&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/learning"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;learning&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/opensource"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;opensource&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
          &lt;a href="https://dev.to/aws/first-impressions-with-strands-agents-sdk-4hha" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left"&gt;
            &lt;div class="multiple_reactions_aggregate"&gt;
              &lt;span class="multiple_reactions_icons_container"&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/multi-unicorn-b44d6f8c23cdd00964192bedc38af3e82463978aa611b4365bd33a0f1f4f3e97.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/fire-f60e7a582391810302117f987b22a8ef04a2fe0df7e3258a5f49332df1cec71e.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/sparkle-heart-5f9bee3767e18deb1bb725290cb151c25234768a0e9a2bd39370c382d02920cf.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
              &lt;/span&gt;
              &lt;span class="aggregate_reactions_counter"&gt;16&lt;span class="hidden s:inline"&gt; reactions&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/a&gt;
            &lt;a href="https://dev.to/aws/first-impressions-with-strands-agents-sdk-4hha#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              Comments


              5&lt;span class="hidden s:inline"&gt; comments&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            6 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


&lt;h3&gt;
  
  
  Using Anthropic as a model provider
&lt;/h3&gt;

&lt;p&gt;As a refresher from my last post, Strands Agents can be used with a variety of model providers including Amazon Bedrock (which I covered last) as well as Anthropic, OpenAI, Ollama, LiteLLM and more. &lt;/p&gt;

&lt;p&gt;Today I'm testing integration with my Anthropic API and continuing to use some of the built-in tools Strands offers.&lt;/p&gt;

&lt;p&gt;To get started, I head to the &lt;a href="https://strandsagents.com/latest/user-guide/concepts/model-providers/anthropic?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;Strands model provider documentation&lt;/a&gt; and install the optional Anthropic dependency with &lt;code&gt;pip install 'strands-agents[anthropic]'&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;Now I can import the dependency in my Python application with &lt;code&gt;from strands.models.anthropic import AnthropicModel&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;I test that the integration works by executing a simple sample:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;strands&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Agent&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;strands.models.anthropic&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;AnthropicModel&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;dotenv&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;load_dotenv&lt;/span&gt;

&lt;span class="n"&gt;model&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;AnthropicModel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;client_args&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;api_key&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getenv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;api_key&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="c1"&gt;# **model_config
&lt;/span&gt;    &lt;span class="n"&gt;max_tokens&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;1028&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;model_id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;claude-sonnet-4-20250514&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;params&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;temperature&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;agent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Agent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;agent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;What was the most visited city in the world in 2024?&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The response in my terminal:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feles9mezvdb64hh6l8wy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feles9mezvdb64hh6l8wy.png" alt=" "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Using other built-in tools
&lt;/h3&gt;

&lt;p&gt;In my last post I touched on the &lt;code&gt;http_request&lt;/code&gt; &lt;a href="https://github.com/strands-agents/tools/blob/main/src/strands_tools/http_request.py?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;tool&lt;/a&gt; which gives my agent the ability to Make API calls, fetch web data, and call local HTTP servers. This time I wanted to check out the &lt;code&gt;use_aws&lt;/code&gt; &lt;a href="https://github.com/strands-agents/tools/blob/main/src/strands_tools/use_aws.py?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;tool&lt;/a&gt; which gives my agent the ability to interact with AWS Services across a variety of simple to complex use cases. &lt;/p&gt;

&lt;p&gt;I have a lot of S3 buckets in my AWS account and it would be nice to get a list of all these buckets before I run an audit on what I can delete. Using natural language I should be able to tell Strands to list all of these for me.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;strands&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Agent&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;strands.models.anthropic&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;AnthropicModel&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;strands_tools&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;use_aws&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;dotenv&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;load_dotenv&lt;/span&gt;

&lt;span class="n"&gt;model&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;AnthropicModel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;client_args&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;api_key&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getenv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;api_key&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="c1"&gt;# **model_config
&lt;/span&gt;    &lt;span class="n"&gt;max_tokens&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;1028&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;model_id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;claude-sonnet-4-20250514&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;params&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;temperature&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;0.3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;agent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Agent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tools&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;use_aws&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;List all my S3 buckets in us-west-2&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;agent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The response in my terminal:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9cwklvxi0bzej1ilb1pm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9cwklvxi0bzej1ilb1pm.png" alt=" "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When I execute the file I see Strands understands it's been asked a question it needs to use a tool for, and appropriately goes through the &lt;code&gt;use_aws&lt;/code&gt; option to generate the response. While I explicitly called out the region as &lt;code&gt;us-west-2&lt;/code&gt;, the response explains that the &lt;code&gt;list_buckets&lt;/code&gt; operation in the tool extracts &lt;strong&gt;all&lt;/strong&gt; S3 buckets across my account by default, hence the other ones that are populating in the response. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;⚠️Note: The &lt;code&gt;use_aws&lt;/code&gt; tool looks for my AWS profile locally to authenticate from &lt;code&gt;~/.aws/credentials&lt;/code&gt;, you'll need that setup before attempting to use this tool or any others that require AWS account use.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That's it for this quick update, don't forget to give me a 🦄 if you got this far and let me know what else you'd like to see in the comments!&lt;/p&gt;

&lt;h3&gt;
  
  
  Additional Resources 📚
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://strandsagents.com/latest/user-guide/quickstart?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;Strands Agents Quickstart&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://community.aws/content/2xP1AQ52ofPdLawEbDI5EEUhmhH/building-ai-agents-with-strands-part-1-creating-your-first-agent?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;Dennis Traub's 4 part blog series on Strands&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://catalog.us-east-1.prod.workshops.aws/workshops/76c0e7e3-72c0-4781-a90d-5cfa494032e5/en-US/strands-agents?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;Connecting Strands to MCP- Workshop&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>aws</category>
      <category>opensource</category>
      <category>learning</category>
      <category>anthropic</category>
    </item>
    <item>
      <title>First Impressions with Strands Agents SDK 🧬</title>
      <dc:creator>Laura Salinas</dc:creator>
      <pubDate>Mon, 23 Jun 2025 06:00:00 +0000</pubDate>
      <link>https://dev.to/aws/first-impressions-with-strands-agents-sdk-4hha</link>
      <guid>https://dev.to/aws/first-impressions-with-strands-agents-sdk-4hha</guid>
      <description>&lt;p&gt;It's been exactly 3 months since I last wrote about agents and the industry has certainly made leaps since then. With the release of more support for agentic workflows across CSPs (cloud service provider), this felt like the right time to dive into one of the options still warm on the press, &lt;a href="https://strandsagents.com/latest?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;Strands Agents SDK&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I first heard about Strands as I logged back into work after a week vacation in Japan. Talk about bleeding edge, I'm away for 7 days and suddenly there's a brand new open source SDK that's making a splash. &lt;/p&gt;

&lt;p&gt;If you somehow missed this announcement last month, I highly recommend giving the official &lt;a href="https://aws.amazon.com/blogs/opensource/introducing-strands-agents-an-open-source-ai-agents-sdk?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;launch blog&lt;/a&gt; a read to get familiar.&lt;/p&gt;

&lt;p&gt;The TLDR 👉🏼 Strands Agents is an open source SDK that takes a model-driven approach to building and running AI agents in just a few lines of code (and seriously in &amp;lt;10 lines I'm up and running). &lt;/p&gt;

&lt;p&gt;Best part yet? This isn't just a 'stay in your prototype and experiment' type of solution. Teams at AWS have already been using Strands Agents in stealth mode before the public release. In fact, if you've gotten your hands on &lt;a href="https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/command-line-installing.html?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;Q CLI&lt;/a&gt; for an agentic coding experience, then you're already reaping the benefits of an AWS team that built and shipped with Strands Agents in just &lt;strong&gt;3 weeks&lt;/strong&gt; 🤯&lt;/p&gt;

&lt;p&gt;With that background, I wanted to play around with Strands Agents to see how quickly I could get started and what my first impressions are so far. Let's go 🤘🏼&lt;/p&gt;

&lt;h2&gt;
  
  
  Setup
&lt;/h2&gt;

&lt;p&gt;Pretty straightforward, in the &lt;a href="https://strandsagents.com/latest?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;documentation&lt;/a&gt; you can find instructions on installation.&lt;/p&gt;

&lt;p&gt;I create a new python file in my local repository and create a virtual environment to install packages related to this project.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Core functionality using &lt;code&gt;pip3 install strands-agents&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Built in tools using &lt;code&gt;pip3 install strands-agents-tools&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;⚠️ Note: I'm using AWS as the model provider to run Strands which means I've already set up AWS credentials and enabled model access. The default model provider for Strands is Amazon Bedrock and the default model is Claude 3.7 Sonnet in the &lt;strong&gt;US Oregon (us-west-2) region&lt;/strong&gt;. I don't cover AWS CLI setup here, but check out the &lt;a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;docs&lt;/a&gt; if you haven't done that first.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Creating your first agent
&lt;/h2&gt;

&lt;p&gt;With setup and model provider access complete I can get started building my first agent. &lt;/p&gt;

&lt;p&gt;From the Strands documentation I start my python file with the skeleton code needed (again this is &amp;lt;10 lines to get to basic use)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;strands&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Agent&lt;/span&gt;

&lt;span class="c1"&gt;# Create an agent with default settings
&lt;/span&gt;&lt;span class="n"&gt;agent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Agent&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="c1"&gt;# Ask the agent a question
&lt;/span&gt;&lt;span class="nf"&gt;agent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Tell me about agentic AI&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Running this with &lt;code&gt;python3 strands-agent.py&lt;/code&gt; and I see Strands goes to work using Claude 3.7 Sonnet to pose the query "Tell me about Agentic AI". We see a quick response in my terminal.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx5zsbvdz4mxuzhutanux.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx5zsbvdz4mxuzhutanux.png" alt=" " width="800" height="244"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now that I know things are working we can get a bit more creative.&lt;/p&gt;

&lt;h2&gt;
  
  
  Building complexity in agents
&lt;/h2&gt;

&lt;p&gt;Let's say I want to create an agent that helps new pet parents find a dog that best meets their lifestyle. Maintaining the same idea as the example code above, we create an agent, &lt;code&gt;dog_breed_helper&lt;/code&gt;, and use the following system prompt.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;You are a dog breed expert specializing in helping new pet parents decide what breed meets their lifestyles. Your expertise covers dog behavior, dog training, basic veterinary care, and dog breed standards.

    When giving recommendations:
    1. Provide both benefits and challenges of owning that breed
    2. Give examples when necessary
    3. Avoid jargon, but indicate when complex concepts are important

Your goal is to help pet parents make an informed decision about their choice in a dog.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;⚠️ There's certainly room for improvement in this system prompt, but the point here is to experiment and show you how easy it is to contextualize and ground an agent.&lt;/p&gt;

&lt;p&gt;To test this agent I use a query like &lt;em&gt;"Which dog should I adopt as a first time owner if I have an office job m-f 9-5, like to hike on weekends and don't know much about training?"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I execute the file, &lt;code&gt;python3 dog_breed_agent.py&lt;/code&gt; and the results are below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgqtkm7fd26rfygo14y6a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgqtkm7fd26rfygo14y6a.png" alt=" " width="800" height="481"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, I want to test one of the capabilities of Strands Agents that allows me to take my dog helper agent to the next level. This capability is to integrate tools to extend my agent's own knowledge. &lt;/p&gt;

&lt;p&gt;If you're not yet familiar with the term- "Tools" are what transform a basic conversational agent into a truly useful assistant that can interact with the world. In this example, I'll explore using the built-in tools provided by the Strands SDK. Tools allow my agent to interact with external systems, access data and manipulate its environment. &lt;/p&gt;

&lt;p&gt;To learn more you can check out which &lt;a href="https://strandsagents.com/latest/user-guide/concepts/tools/example-tools-package?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;built-in tools Strands offers&lt;/a&gt; to get started quickly. &lt;/p&gt;

&lt;p&gt;For my small experiment today I want to enhance my agent by having it search for information on the web. I can use the built in &lt;code&gt;http_request&lt;/code&gt; &lt;a href="https://github.com/strands-agents/tools/blob/main/src/strands_tools/http_request.py?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;tool&lt;/a&gt; to do this.&lt;/p&gt;

&lt;p&gt;To enable this tool use in my python application I add &lt;code&gt;from strands_tools import http_request&lt;/code&gt;and then add the function call to my system prompt &lt;code&gt;tools=[http_request]&lt;/code&gt;. I change my query to reflect both items I need help with.&lt;/p&gt;

&lt;p&gt;My updated python file looks like so:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;strands&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Agent&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;strands_tools&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;http_request&lt;/span&gt;

&lt;span class="c1"&gt;# Create a basic agent with a specialized system prompt
&lt;/span&gt;&lt;span class="n"&gt;dog_breed_helper&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Agent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;system_prompt&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;You are a dog breed expert specializing
    in helping new pet parents decide what breed meets their lifestyles. Your expertise
    covers dog behavior, dog training, basic veterinary care, and dog breed standards.

    When giving recommendations:
    1. Provide both benefits and challenges of owning that breed. 
    2. Only provide 3 recommendations at a time.
    3. Give examples when necessary
    4. Avoid jargon, but indicate when complex concepts are important

    Your goal is to help pet parents make an informed decision about their choice in a dog.
    &lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;tools&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;http_request&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;
Answer these questions:
1. Which dog should I adopt as a first time owner if I have an office job m-f 9-5, like to hike on weekends and don&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;t know much about training?
2. Search wikipedia for the top 5 most popular dog breeds of 2024
&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
&lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;dog_breed_helper&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;💡 What I notice when I execute the file is Strands automatically knows which tool(s) to invoke based on the context of our conversation. When I say search the web it knows it needs to call the &lt;code&gt;http_request&lt;/code&gt; tool to answer the question. This behavior is really impressive and opens up a lot of room to make these agents more than just simple text generators.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;⚠️ Note: I did run into some throttling limits when experimenting with the &lt;code&gt;http_request&lt;/code&gt; tool. If your queries are hanging longer than a few seconds you may see an error like the one I had which indicates AWS usage for the ConverseStream API is at capacity.&lt;br&gt;
&lt;code&gt;"An error occurred (ThrottlingException) when calling the ConverseStream operation (reached max retries: 4): Too many tokens, please wait before trying again."&lt;/code&gt;&lt;br&gt;
You can have Strands switch to another model by passing the model ID string directly. I tried Sonnet 3.5 by adding &lt;code&gt;model="anthropic.claude-3-5-sonnet-20240620-v1:0"&lt;/code&gt; to my agent definition.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;When executing correctly, the response I receive from my agent is the following:&lt;/p&gt;

&lt;p&gt;Answering the first question &lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxc3eelfu4494pxnfqawz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxc3eelfu4494pxnfqawz.png" alt=" " width="800" height="198"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Answering the second question&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F124vgjgluhzm9fxsus44.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F124vgjgluhzm9fxsus44.png" alt=" " width="800" height="206"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Learnings
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Creating an agent was easy and straightforward with functioning python app in &amp;lt;10 lines and &amp;lt;10min&lt;/li&gt;
&lt;li&gt;Adding complexity to agents using Strands can also be done easily whether through pre-built tools or adding custom tools&lt;/li&gt;
&lt;li&gt;Errors from model providers (in my case Amazon Bedrock) are still a challenge, make sure to understand your service/model quotas as you experiment&lt;/li&gt;
&lt;li&gt;Be open to switching to another version of a model if responses are lagging or being throttled&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let me know in the comments what your use cases for Strands Agents could be and leave a 🦄 if you made it this far!&lt;/p&gt;

&lt;h4&gt;
  
  
  Additional Resources 📚
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://strandsagents.com/latest/user-guide/quickstart?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;Strands Agents Quickstart&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://community.aws/content/2xP1AQ52ofPdLawEbDI5EEUhmhH/building-ai-agents-with-strands-part-1-creating-your-first-agent?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;Dennis Traub's 4 part blog series on Strands&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://catalog.us-east-1.prod.workshops.aws/workshops/76c0e7e3-72c0-4781-a90d-5cfa494032e5/en-US/strands-agents?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;Connecting Strands to MCP- Workshop&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>aws</category>
      <category>beginners</category>
      <category>learning</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Cost-effective security controls for Amazon Bedrock</title>
      <dc:creator>Laura Salinas</dc:creator>
      <pubDate>Mon, 28 Apr 2025 22:12:13 +0000</pubDate>
      <link>https://dev.to/aws/cost-effective-security-controls-for-amazon-bedrock-using-iam-identity-center-2p44</link>
      <guid>https://dev.to/aws/cost-effective-security-controls-for-amazon-bedrock-using-iam-identity-center-2p44</guid>
      <description>&lt;p&gt;In my last post I discussed my tips for tracking and forecasting Amazon Bedrock costs on the management console 👇🏼&lt;/p&gt;


&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/aws/amazon-bedrock-pricing-101-k3k" class="crayons-story__hidden-navigation-link"&gt;Amazon Bedrock Pricing 101 💰&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;
          &lt;a class="crayons-logo crayons-logo--l" href="/aws"&gt;
            &lt;img alt="AWS logo" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F1726%2F2a73f1e6-7995-4348-ae37-44b064274c59.png" class="crayons-logo__image"&gt;
          &lt;/a&gt;

          &lt;a href="/lausalin" class="crayons-avatar  crayons-avatar--s absolute -right-2 -bottom-2 border-solid border-2 border-base-inverted  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2961139%2F1ef5780a-c649-4402-9b4f-d5f5be866b63.jpg" alt="lausalin profile" class="crayons-avatar__image"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/lausalin" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Laura Salinas
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Laura Salinas
                
              
              &lt;div id="story-author-preview-content-2414808" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/lausalin" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2961139%2F1ef5780a-c649-4402-9b4f-d5f5be866b63.jpg" class="crayons-avatar__image" alt=""&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Laura Salinas&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

            &lt;span&gt;
              &lt;span class="crayons-story__tertiary fw-normal"&gt; for &lt;/span&gt;&lt;a href="/aws" class="crayons-story__secondary fw-medium"&gt;AWS&lt;/a&gt;
            &lt;/span&gt;
          &lt;/div&gt;
          &lt;a href="https://dev.to/aws/amazon-bedrock-pricing-101-k3k" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Apr 17 '25&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/aws/amazon-bedrock-pricing-101-k3k" id="article-link-2414808"&gt;
          Amazon Bedrock Pricing 101 💰
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/aws"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;aws&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/ai"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;ai&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/beginners"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;beginners&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/learning"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;learning&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
          &lt;a href="https://dev.to/aws/amazon-bedrock-pricing-101-k3k" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left"&gt;
            &lt;div class="multiple_reactions_aggregate"&gt;
              &lt;span class="multiple_reactions_icons_container"&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/fire-f60e7a582391810302117f987b22a8ef04a2fe0df7e3258a5f49332df1cec71e.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/raised-hands-74b2099fd66a39f2d7eed9305ee0f4553df0eb7b4f11b01b6b1b499973048fe5.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/sparkle-heart-5f9bee3767e18deb1bb725290cb151c25234768a0e9a2bd39370c382d02920cf.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
              &lt;/span&gt;
              &lt;span class="aggregate_reactions_counter"&gt;43&lt;span class="hidden s:inline"&gt; reactions&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/a&gt;
            &lt;a href="https://dev.to/aws/amazon-bedrock-pricing-101-k3k#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              Comments


              &lt;span class="hidden s:inline"&gt;Add Comment&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            5 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


&lt;p&gt;and after some discussions with readers on and offline, folks were wondering how they could also limit a user's Bedrock access (to models, to features, etc) via IAM policies.&lt;/p&gt;

&lt;p&gt;The intent here is to adhere to both organization security policies &lt;em&gt;and&lt;/em&gt; to budget constraints for developers experimenting and using AWS.&lt;/p&gt;

&lt;p&gt;Let's jump in and see how this can be done 🤘🏼&lt;/p&gt;

&lt;h2&gt;
  
  
  Refresher on IAM
&lt;/h2&gt;

&lt;p&gt;I hope if you're reading this you're intimately familiar with AWS IAM or &lt;a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/introduction.html?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;Identity Access Management&lt;/a&gt;, as it's the foundation for controlling access to AWS resources. From authentication to authorization, IAM provides the necessary infrastructure to get this done.&lt;/p&gt;

&lt;p&gt;You might be familiar with Amazon Bedrock access by way of the managed IAM policy &lt;code&gt;AmazonBedrockFullAccess&lt;/code&gt; which provides users with unrestricted access to the entire suite of features available within the Bedrock service. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;⚠️ This doesn't inherently mean access to all foundation models (FMs) by default. A user will still need to &lt;a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-access-modify.html?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;request access to FMs&lt;/a&gt; and accept EULAs to use models within Bedrock.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The practice of having users inherit a managed &lt;code&gt;FullAccess&lt;/code&gt; policy is what we want to prevent for the purposes of this use case (and in general to adhere to AWS best practices for &lt;a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#grant-least-privilege?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;least privilege permissions&lt;/a&gt;).&lt;/p&gt;

&lt;h2&gt;
  
  
  Putting it all together
&lt;/h2&gt;

&lt;p&gt;The behavior I want to demonstrate is a user having restricted access to Bedrock in order to prevent surprise usage spikes from simple mistakes- like using a model that management has deemed "too expensive," using features not approved, or exceeding use of a particular model. &lt;/p&gt;

&lt;p&gt;For this demonstration I have created a user in &lt;a href="https://docs.aws.amazon.com/singlesignon/latest/userguide/what-is.html?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;IAM Identity Center &lt;/a&gt;. To prevent UI errors from the Bedrock console, at the time of creation this user is given the managed &lt;code&gt;AmazonBedrockReadOnly&lt;/code&gt; policy. This will help prevent listing and reading errors in the UI as I click through. You can inspect the full details of that policy &lt;a href="https://docs.aws.amazon.com/aws-managed-policy/latest/reference/AmazonBedrockReadOnly.html?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;here&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwmkku0ikvg8sxygdn2qf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwmkku0ikvg8sxygdn2qf.png" alt="Screenshot of the IAM Identity Center pane with a user "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the console, I can test whether this user is functional by logging into the identity center access portal for my user &lt;code&gt;Bedrock-Test&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;With only this policy attached, upon logging in I cannot use any AWS services.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk1qxy3hhv1v96yd6kn7p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk1qxy3hhv1v96yd6kn7p.png" alt="Screenshot of the AWS management console with a red box showing the user "&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;⚠️ A reminder, if you're not able to access FMs, a user has to first &lt;a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-access-modify.html?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;request access&lt;/a&gt; and accept EULAs before attempting to use any models within Bedrock.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I test this by attempting to chat with a model in the playground. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkvzq7agdo2hyyxcgasnx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkvzq7agdo2hyyxcgasnx.png" alt="Screenshot of the AWS Bedrock playground with access denied. A red box indicating the user 'Bedrock Test'"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As we further scope this policy, I want to allow a user to experiment with Bedrock &lt;strong&gt;only&lt;/strong&gt; on the console playground and &lt;strong&gt;only&lt;/strong&gt; with a certain model. I do this by listing the specific actions I want to allow and on Anthropic's Claude Opus model as the only resource.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;⚠️ Before using any of these sample policies confirm you have permission to test IAM policies in your organization, and are working in a controlled environment (i.e., not prod). These IAM policies have been generated with &lt;a href="https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/what-is.html?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;Q Developer&lt;/a&gt; as a demonstration and should be subject to additional review before utilization. Note that this policy is scoped to a single account and thus requires an account ID.&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"Version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2012-10-17"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"Statement"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Sid"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"BedrockPlaygroundOnlyAccess"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Effect"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Allow"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Action"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"bedrock:InvokeModel"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"bedrock:InvokeModelWithResponseStream"&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Resource"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"arn:aws:bedrock:*:*:foundation-model/anthropic.claude-3-opus-20240229-v1:0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"arn:aws:bedrock:*:&amp;lt;Account ID&amp;gt;:inference-profile/*"&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;

&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;u&gt;Limiting use of features&lt;/u&gt; &lt;/p&gt;

&lt;p&gt;To confirm I &lt;strong&gt;only&lt;/strong&gt; have access to the playground and no other features of Bedrock, I try creating a Bedrock Agent and a Bedrock Guardrail and see that I am denied access to both while under this user.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft087ut2e9fe8s7boay6d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft087ut2e9fe8s7boay6d.png" alt="Screenshot of AWS management console with Bedrock service showing access denied to Agents feature"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fimol9z2y2yctdosw72c8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fimol9z2y2yctdosw72c8.png" alt="Screenshot of AWS management console with Bedrock service showing access denied to Guardrails feature"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;u&gt;Limiting use of models&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;In this example I want to allow a user to have the same access above,  &lt;strong&gt;but&lt;/strong&gt; they should also be allowed to use the DeepSeek-R1 model in the playground. To do this, I add the JSON below to the policy I used previously. I indicate the behavior by allowing the action explicitly and using the ARN of the model in the resource field.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"Version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2012-10-17"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"Statement"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Sid"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"BedrockPlaygroundOnlyAccess"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Effect"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Allow"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Action"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"bedrock:InvokeModel"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"bedrock:InvokeModelWithResponseStream"&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Resource"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"arn:aws:bedrock:*:*:foundation-model/anthropic.claude-3-opus-20240229-v1:0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"arn:aws:bedrock:*:*:foundation-model/deepseek.r1-v1:0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"arn:aws:bedrock:*:&amp;lt;Account ID&amp;gt;:inference-profile/*"&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When I try the same prompt above but with the &lt;code&gt;DeepSeek-R1&lt;/code&gt; model, I can see my access is also allowed, and the query is processed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwss4rsmzrzfjmueggutr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwss4rsmzrzfjmueggutr.png" alt="Screenshot of AWS management console with Bedrock service showing access allowed to Bedrock playground with DeepSeek-R1 model"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;u&gt;Limiting use for a model&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;After some investigating, it seems there isn't currently a way to do this via IAM policies for Bedrock. At the time of writing, there is no direct &lt;a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_condition.html?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;IAM condition&lt;/a&gt; that limits the number of API calls or tokens for this use case. There may be other ways to tackle this via a combination of AWS Service Quotas and/or AWS Budgets, but I'll have to look into that for another day.&lt;/p&gt;

&lt;p&gt;Leave a comment if you've explored this challenge or have some ideas about what a stopgap is for limiting Bedrock use on a per-model call/token basis.&lt;/p&gt;

&lt;h2&gt;
  
  
  Takeaways 💡
&lt;/h2&gt;

&lt;p&gt;1/ To ensure best practices are followed, the AWS recommendation is to use Identity Center to manage authentication via existing IdP when possible. &lt;/p&gt;

&lt;p&gt;2/ You can use &lt;a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/what-is-access-analyzer.html?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;IAM Access Analyzer&lt;/a&gt;  during policy creation to review for various aspects like validating grammar and best practices. (You can locate these findings at the bottom of the JSON creation pane on the console)&lt;/p&gt;

&lt;p&gt;3/ There are still some challenges in limiting API calls directly  for Bedrock. The service team is aware of this limitation and actively working on a solution.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Additional Resources 📚&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://docs.aws.amazon.com/singlesignon/latest/userguide/addusers.html?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;Setup users in Identity Center&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Blog- &lt;a href="https://aws.amazon.com/blogs/aws-cloud-financial-management/optimizing-cost-for-using-foundational-models-with-amazon-bedrock?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;Optimizing costs on Bedrock&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>aws</category>
      <category>ai</category>
      <category>tutorial</category>
      <category>learning</category>
    </item>
    <item>
      <title>Amazon Bedrock Pricing 101 💰</title>
      <dc:creator>Laura Salinas</dc:creator>
      <pubDate>Thu, 17 Apr 2025 21:24:58 +0000</pubDate>
      <link>https://dev.to/aws/amazon-bedrock-pricing-101-k3k</link>
      <guid>https://dev.to/aws/amazon-bedrock-pricing-101-k3k</guid>
      <description>&lt;p&gt;I don't know about you, but I hear &lt;em&gt;a lot&lt;/em&gt; about how difficult it can be to predict &amp;amp; track costs when using Amazon Bedrock 🥵&lt;/p&gt;

&lt;p&gt;I spent the last ~2yrs as a solutions architect helping customers in the the ML startup space understand how they can take advantage of this easy to use, LLM APIs at your fingertips service, and I think the #☝🏼 question was still:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;This is great-- but how can we better predict and forecast our costs as we experiment?&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Today I'm hoping to pull back the curtain and share everything &lt;strong&gt;I&lt;/strong&gt; do to monitor Bedrock costs in my account, and what I have been recommending to customers for years. &lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://calculator.aws/#/createCalculator/bedrock?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;AWS Pricing Calculator&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Tried and true, the first place to start is with the pricing calculator. For all its hiccups, the calculator has come a long way since I first started using it in 2018, and it remains easy to use to forecast costs without needing an AWS account. With a single plug and play input field for token count you can generate an estimate and depending on your use case, add additional context for model customization in the other fields.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The 🐘 in the room? At this time the pricing calculator only supports estimates with first party Amazon Titan or Amazon Nova models.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For 3rd party models like Anthropic, Mistral, Meta, etc (arguably the most used on Bedrock) you'll still have to reference the &lt;a href="https://aws.amazon.com/bedrock/pricing?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;Amazon Bedrock Pricing page&lt;/a&gt; for the specific model version and its per token price. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2th4bpaexscngarbny8g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2th4bpaexscngarbny8g.png" alt="Screenshot of the AWS calculator with arrows pointing to the input fields for token input and ouput"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://aws.amazon.com/aws-cost-management/aws-cost-explorer?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;AWS Cost Explorer&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Ok, let's dive one step deeper (and one that requires your AWS account) into tracking &amp;amp; understanding Bedrock charges. My favorite way to do this is with the built in &lt;a href="https://us-east-1.console.aws.amazon.com/costmanagement/home#/cost-explorer?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;Cost Explorer tool&lt;/a&gt; in the management console. &lt;/p&gt;

&lt;p&gt;First off, why I like this approach?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Interactive graph visuals&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Ability to drill down by service, region, API call and more&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Can review data 3yrs in the past and forecast ahead up to 1yr&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Easily save reports and exports as CSVs&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;u&gt;Tracking&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;The first thing I like to do when diving into my Bedrock costs is set the appropriate filters in the &lt;strong&gt;Report parameters&lt;/strong&gt; pane.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Date Range:&lt;/strong&gt; YTD (unless I'm drilling down on a specific date/time)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Granularity:&lt;/strong&gt; Monthly (again, unless I'm investigating a specific issue)&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Dimension:&lt;/strong&gt; This one varies but here are the main ones I use.&lt;/p&gt;

&lt;p&gt;a. &lt;strong&gt;Usage type&lt;/strong&gt; - I love the granularity here, and it also displays region which is helpful when operating across multiple regions and looking for a quick snapshot.&lt;/p&gt;

&lt;p&gt;b. &lt;strong&gt;API Operation&lt;/strong&gt; - The values here more closely match the verbiage of the bill which makes troubleshooting service charges easier. &lt;/p&gt;

&lt;p&gt;c. &lt;strong&gt;Tag&lt;/strong&gt; - Very helpful if you're in the practice of tagging workloads by team, project, business unit, etc. (Which you should be 😉)&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsiapiuxix1k6kp9q6awe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsiapiuxix1k6kp9q6awe.png" alt="Screenshot of the cost explorer report with usage type filter on the Bedrock service"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq5mp5xv0z0zgzqydimnz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq5mp5xv0z0zgzqydimnz.png" alt="Screenshot of the cost explorer report with api operation filter on the Bedrock service"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;u&gt;Forecasting&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;From the same &lt;strong&gt;Report parameters&lt;/strong&gt; pane you can do forecasting easily by selecting how many months into the future you want the algorithm to run through. &lt;/p&gt;

&lt;p&gt;There's a bit of data analytics science under the hood for this prediction algorithm, you can read more about that &lt;a href="https://docs.aws.amazon.com/cost-management/latest/userguide/ce-forecast.html?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;here&lt;/a&gt; if you're curious. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft3ypij0iemg61q4mkba6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft3ypij0iemg61q4mkba6.png" alt="Screenshot of the cost explorer report with 3 months forecasting filter on the Bedrock service"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgolsgccycugc7d20l38f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgolsgccycugc7d20l38f.png" alt="Screenshot of the cost explorer graph report with 3 months forecasting filter on the Bedrock service"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://aws.amazon.com/aws-cost-management/aws-billing?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;AWS Billing Console&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;While most of my use for service charge troubleshooting happens in cost explorer, sometimes it helps to see the line items in your bill directly.&lt;/p&gt;

&lt;p&gt;For bill access head to the &lt;a href="https://us-east-1.console.aws.amazon.com/billing/home#?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;&lt;strong&gt;Bills console&lt;/strong&gt;&lt;/a&gt;. In the service name search field you'll want to enter &lt;strong&gt;Bedrock Service&lt;/strong&gt; and &lt;strong&gt;Bedrock&lt;/strong&gt;. This will pickup both 3P and 1P model charges alongside any other native Bedrock features (like guardrails).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzq2t0cgl4z4o0r3qbaq3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzq2t0cgl4z4o0r3qbaq3.png" alt="Screenshot of the billing console report with filters for the Bedrock services"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;One other aspect in the billing console I'd like to point out is the &lt;strong&gt;Usage Quantity&lt;/strong&gt; column. For Bedrock specifically this is where you can find token count!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxdu6goh1aaf4nsole5e9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxdu6goh1aaf4nsole5e9.png" alt="Screenshot of the billing console report with token count for Bedrock line items"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a href="https://aws.amazon.com/aws-cost-management/aws-budgets?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;AWS Budgets&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;I won't lie to you I haven't used budgets in my own AWS account, but I recommend it often given how powerful it can be for alerting before a major bill spike. You can also create actions based on budget breaches or approximations on a budget that's been set.&lt;/p&gt;

&lt;p&gt;For more information on configuring budget actions check out the &lt;a href="https://docs.aws.amazon.com/cost-management/latest/userguide/budgets-action-configure.html?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;documentation&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;For those of you who are visual learners, this tutorial on setting budget alerts provides a great walkthrough as well.&lt;/p&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/O0sofGVT7uw"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Takeaways 💡
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;As with all things AWS, use the right tool for the right job. For quick and dirty inspection I prefer cost explorer, for more intricate things there are plenty of third party tools to explore in the &lt;a href="https://aws.amazon.com/marketplace/search/results?prevFilters=%257B%2522ref_%2522%3A%2522awsmp_mpov_srch_lp%2522%2C%2522trk%2522%3A%2522awsmp_mpov_srch_lp%2522%257D&amp;amp;searchTerms=cost+management" rel="noopener noreferrer"&gt;AWS marketplace&lt;/a&gt; (over 5000 hits on 'cost management' alone)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Use multiple dimensions in cost explorer to help triage costs across several services (e.g. S3 + CloudFront spikes) &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Tagging and setting budget alerts will be your best friend to prevent a billing jump scare&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Additional Resources 📚&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/blogs/aws-cloud-financial-management?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;AWS Cloud Financial Management Blogs&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Sound off in the comments if you have other pricing challenges you've observed with Bedrock or anything else you'd like to learn about!&lt;/p&gt;

</description>
      <category>aws</category>
      <category>ai</category>
      <category>beginners</category>
      <category>learning</category>
    </item>
    <item>
      <title>First Impressions with Nova Act SDK 🤔</title>
      <dc:creator>Laura Salinas</dc:creator>
      <pubDate>Thu, 10 Apr 2025 19:16:50 +0000</pubDate>
      <link>https://dev.to/aws/first-impressions-with-nova-act-sdk-3aic</link>
      <guid>https://dev.to/aws/first-impressions-with-nova-act-sdk-3aic</guid>
      <description>&lt;p&gt;It's been a little over a week since the announcement of the &lt;a href="https://labs.amazon.science/blog/nova-act?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;Nova Act SDK&lt;/a&gt; which is currently in research preview (US Only). I carved out my lunch break to see how quickly I could get up and running. Join me below to see how far I get in about an hour 🙈.&lt;/p&gt;

&lt;h2&gt;
  
  
  Setup
&lt;/h2&gt;

&lt;p&gt;You'll need to first &lt;a href="https://nova.amazon.com?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;request access to Nova&lt;/a&gt; via your Amazon login (Amazon the one you shop from 📦, not your AWS account). You may be placed on a waitlist if you don't see access granted immediately, keep an eye on your email if that's the case.  &lt;/p&gt;

&lt;p&gt;With access granted head to the &lt;a href="https://nova.amazon.com/act?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;Nova Act SDK&lt;/a&gt;. You'll see there are three steps outlined. Installing the SDK, setting up an API key and a first workflow sample. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbqidwxb37miw72tk1px5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbqidwxb37miw72tk1px5.png" alt="Screenshot of the Nova Act SDK Setup Screen" width="800" height="715"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I head to the &lt;a href="https://github.com/aws/nova-act?tab=readme-ov-file#initializing-novaact&amp;amp;trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;onboarding guide&lt;/a&gt; for more info on how to interact with the SDK and how to authenticate. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;⚠️ I had some minor trouble here using the API key as an environment variable. Thinking I'd get ahead of the curve I created a .env file with the API key so that my vscode project could pick it up, but that kept throwing errors. &lt;strong&gt;TL;DR-&lt;/strong&gt; just use &lt;code&gt;export NOVA_ACT_API_KEY="your_api_key"&lt;/code&gt; before you start a session in terminal and it'll make the SDK happy. Below the error I kept getting.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flnirrtl40arbljr3qf1q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flnirrtl40arbljr3qf1q.png" alt="An error message on vscode indicating authentication is not working" width="478" height="74"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can use the SDK in a Python script or directly from the terminal with the standard Python shell. &lt;/p&gt;

&lt;h2&gt;
  
  
  Example Usage
&lt;/h2&gt;

&lt;p&gt;I'm currently learning Japanese as a hobby and to feel a little more comfortable on my upcoming trip next month, so I figured let's test Nova Act by asking it to help me with some flashcards for practicing hiragana with diacritical marks (Duolingo just isn't enough 😭)&lt;/p&gt;

&lt;p&gt;My first attempt looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;nova_act&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;NovaAct&lt;/span&gt;

&lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="nc"&gt;NovaAct&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;starting_page&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https://www.google.com&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;nova&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;nova&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;act&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;search google for Japanese hiragana with diacritical &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; \
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;marks flashcards, find ones that can print well.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Which leads the agent to Google, it searches for my query and then opens the first web result which is Quizlet. So far so good. I see the agent describing it's thinking process in my terminal and it starts checking for a print button on the site. &lt;/p&gt;

&lt;p&gt;As it does so a popup captcha appears prompting for a click to confirm humanity which... feels hilarious for this first use of Nova Act. Now, things go a little off the rails here- Nova Act understands there is a popup but gets stuck in a loop where it can't close the popup and can't continue to navigate the page either. I give it a few seconds before exiting the script. &lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/FghBK49uDQ0"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;💡 So, first lesson learned here- some sites are definitely detecting the use of agents and this behavior currently breaks Nova Act (unless you get crafty which...during this quick hack I didn't 🙂)&lt;/p&gt;

&lt;p&gt;I'm curious if I try prompting it to avoid sites and instead go directly to google images if I can get better results. &lt;/p&gt;

&lt;p&gt;Attempt two looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;nova_act&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;NovaAct&lt;/span&gt;

&lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="nc"&gt;NovaAct&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;starting_page&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https://www.google.com&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;nova&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;nova&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;act&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;search google images for flashcards for japanese &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; \
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;hiragana with diacritical marks. Find ones that can print well.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/FNHvxB9bcL4"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;This worked well, except I forgot to give the agent something specific to do so once it finds the images tab so it scrolls endlessly until I stop the script. &lt;/p&gt;

&lt;p&gt;Attempt three looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;nova_act&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;NovaAct&lt;/span&gt;

&lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="nc"&gt;NovaAct&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;starting_page&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https://www.google.com&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;nova&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;nova&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;act&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;

        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Search google images for flashcards for japanese hiragana &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; \
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;with diacritical marks.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Right click or secondary click an image.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;In the context menu click &lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Open image in new tab&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
        &lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I spent a over 30min trying to figure out the correct way to prompt Nova Act so it would perform a right-click otherwise known as a secondary-click for the context menu and couldn't find a way...&lt;/p&gt;

&lt;h2&gt;
  
  
  Learnings
&lt;/h2&gt;

&lt;p&gt;While the functionality of a web capable agent is promising, like most difficulties with agents/AI automation, finding the right &lt;em&gt;way&lt;/em&gt; to tell the model to do what you want is still challenging. I wanted to get more done with this example, but I couldn't justify spending more time to figure out how to get the model to understand a concept as simple to a human as a right click 🖱️&lt;/p&gt;

&lt;p&gt;Stay tuned for more as I continue to tinker with Nova Act (and perhaps come back to finish up this example...)&lt;/p&gt;

&lt;p&gt;&lt;em&gt;(PS- I have already given this missing context menu action feedback to the Nova Act team! PFR in the works 🔨)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Additional Resources&lt;/strong&gt; 📚&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/aws/nova-act/tree/main/src/nova_act/samples?trk=6e6eadd1-6cc9-4873-a34d-5f591ab28643&amp;amp;sc_channel=el" rel="noopener noreferrer"&gt;GitHub Samples&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>aws</category>
      <category>tutorial</category>
      <category>ai</category>
      <category>agents</category>
    </item>
  </channel>
</rss>
