Strands Agents Samples

repository·main·Indexed 21 days ago

https://github.com/strands-agents/samples

A collection of samples and tutorials for building AI agents using Strands Agents. Includes Python and TypeScript examples covering deployment patterns, model providers (Amazon Bedrock, Ollama, LiteLLM, OpenAI), custom tools, Model Context Protocol (MCP) integration, memory persistence with OpenSearch Serverless and FAISS, and bidirectional streaming voice agents using BidiAgent.

Tokens
254.2K
Snippets
677
Records
1K
Agent score
73%

What's inside strands-agents-samples

  1. Overview of the Amazon Data Processing Agent

    main

    The Amazon Data Processing Agent is a conversational AI assistant designed for AWS data engineering tasks. It uses the Model Context Protocol (MCP) to interface with the aws-dataprocessing-mcp-server, allowing users to manage AWS services via natural language.

    Key Capabilities

    • AWS Glue: Manage Data Catalogs (databases, tables, partitions), develop ETL jobs (PySpark/Glue Version 5), and orchestrate workflows.
    • Amazon Athena: Convert natural language to SQL, optimize queries, and perform schema discovery.
    • Amazon EMR-EC2: Manage clusters, handle big data workloads, and implement cost optimization (e.g., spot instances).
    • S3 Operations: Manage data storage and namespaces.

    Technical Stack

    • Model Provider: Amazon Bedrock (Claude Sonnet 4.6, Claude 4.0 Sonnet).
    • MCP Server: aws-dataprocessing-mcp-server.
    • UI Framework: Streamlit with real-time streaming.
    • Custom Tools: send_email, manage_s3_table_buckets, manage_s3_namespaces, manage_s3_tables.
  2. Overview of the WhatsApp Fintech Multi-Agent Demo

    main

    This demo showcases an integration between Strands-Agents, Amazon Bedrock, and Meta's WhatsApp for Business. It implements a multi-agent architecture for a fictitious fintech company where specialized agents handle different tasks:

    • Promotions Agent: Responsible for loading daily promotions based on the day of the week.
    • Credit Card Agent: Handles credit card operations, including retrieving recent transactions and scheduling payments.

    Architecture Flow

    1. User sends a message via WhatsApp.
    2. AWS End User Messaging Social receives the message and publishes it to an SNS Topic.
    3. A Lambda function (triggered by the SNS topic) processes the message.
    4. The Strands-Agents multi-agent system processes the message and routes it to the appropriate agent.

    Technical Details

    • Agent Structure: Multi-agent architecture.
    • Custom Tools/Agents: get_transactions, put_payment, get_promotions, get_day_of_week.
    • Model Provider: Amazon Bedrock.
  3. Overview of Built-In Evaluators in Strands Evals

    main

    Strands Evals provides a toolkit of built-in evaluators to measure different aspects of agent performance using standardized metrics.

    Key evaluators include:

    • OutputEvaluator: Assesses response quality.
    • HelpfulnessEvaluator: Measures user satisfaction.
    • GoalSuccessRateEvaluator: Tracks task completion.
    • ToolSelectionAccuracyEvaluator: Validates if the agent selects the correct tools.
    • ToolParameterAccuracyEvaluator: Validates if the agent uses the correct parameters for tools.
    • TrajectoryEvaluator: Provides capabilities for analyzing agent reasoning and decision paths.
  4. Overview of Finance-Assistant Swarm Agent Collaboration

    main

    The Finance-Assistant Swarm Agent Collaboration is a modular, multi-agent system built with the Strands SDK and Amazon Bedrock. It is designed to autonomously generate comprehensive equity research reports from a single stock query.

    The system uses an orchestration_agent to coordinate a swarm of specialized agents that perform distinct tasks:

    • ticker_search_agent: Resolves plain-language queries into normalized tickers.
    • company_info_agent: Retrieves company name, sector, and description via Yahoo Finance.
    • stock_price_agent: Analyzes OHLC, volume, and trends via Yahoo Finance.
    • financial_metrics_agent: Assesses ratios and growth metrics via Yahoo Finance.
    • news_agent: Performs sentiment and news analysis via web search (DuckDuckGo/Bing).

    The orchestrator integrates these findings into a structured Markdown or HTML report using Claude Opus 4.6 on Amazon Bedrock.

  5. Overview of AWS Audit Assistant

    main

    AWS Audit Assistant is an AI-powered multi-agent system designed to ensure AWS resource compliance with security and efficiency best practices. It uses a natural language interface to allow users to audit resources like S3, EC2, IAM, and RDS.

    Core Components

    • Multi-Agent System: Coordinated agents for comprehensive auditing.
    • Documentation Retriever: Fetches and analyzes AWS best practices documentation.
    • Boto3 Code Assistant: Generates and executes AWS API calls safely.
    • Resource Auditor: Evaluates resources against compliance standards.

    Technical Stack

    • Model Provider: Amazon Bedrock (Claude Sonnet 4.6)
    • Native Tools: boto3, file_read, shell, python_repl
    • Custom Agents: Documentation Retriever, Boto3 Code Assistant, Resource Auditor
  6. Overview of the Unstructured-Structured RAG Agent

    main

    The Unstructured-Structured RAG Agent is a system designed to route user queries between two distinct types of knowledge bases using Strands Agents. This allows for a hybrid retrieval approach where the agent intelligently decides whether a query requires narrative/conceptual information or quantitative/metric-based data.

    Core Components

    • Intelligent Routing Agent: A Strands Agent that analyzes queries to determine the appropriate retrieval path.
    • Unstructured Knowledge Base: Handles document-based, narrative, and conceptual queries. It uses Amazon Bedrock Knowledge Base with OpenSearch Serverless.
    • Structured Knowledge Base: Manages data analysis, metrics, and quantitative queries. It uses Amazon Bedrock Knowledge Base connected to Amazon Redshift.

    Technical Stack

    FeatureDescription
    Agent StructureSingle intelligent routing agent
    Unstructured KBAmazon Bedrock Knowledge Base with OpenSearch Serverless
    Structured KBAmazon Bedrock Knowledge Base connected to Amazon Redshift
    Custom Toolsstructured_data_assistant, unstructured_data_assistant
    Model ProviderAmazon Bedrock
  7. Overview of the AWS Assistant multi-agent system

    main

    AWS Assistant is a multi-agent system built using the Model Context Protocol (MCP) and Amazon Bedrock. It uses a specialized architecture to handle AWS-related queries through three distinct agents and a set of native tools.

    Agent Structure

    • aws_documentation_researcher: Searches and analyzes AWS documentation to provide source-cited technical explanations.
    • aws_cost_assistant: Analyzes AWS account spending, providing breakdowns of service expenditures, regional costs, and usage patterns.
    • graph_creater: Visualizes AWS cost and usage data by generating interactive graphs using Plotly.

    Tools and Servers

    • Native Tools: think, file_write, python_repl, and shell.
    • MCP Servers: Uses AWS Cost Explorer and AWS Documentation MCP servers.
    CAUTION

    The python_repl and shell tools can execute commands in your local environment. It is highly recommended to run this assistant in a sandboxed environment.

  8. Overview of the SRE Incident Response Agent

    main

    The SRE Incident Response Agent is an advanced, multi-agent system designed for DevOps and Site Reliability Engineering. It automates the lifecycle of incident response by detecting Amazon CloudWatch alarms, performing AI-powered root cause analysis (RCA), applying Kubernetes/Helm remediations, and reporting findings to Slack.

    Agent Architecture

    The system uses the agents-as-tools pattern. A supervisor_agent acts as the Incident Commander, orchestrating specialized sub-agents by calling them as @tool functions via the tools= parameter.

    Workflow

    1. supervisor_agent: Receives the trigger.
    2. cloudwatch_agent: Fetches active alarms, metric statistics, and error logs.
    3. rca_agent: Analyzes data to return root cause, severity (P1/P2/P3), and ranked fixes.
    4. remediation_agent: Inspects workloads and applies the safest remediation action.
    5. post_incident_report: Sends a structured report to Slack or stdout.
  9. Overview of the Scrum Master Assistant

    main

    The Scrum Master Assistant is an agile development assistant designed for JIRA. It specializes in processing meeting notes to break down high-level plan items from planning meetings into well-structured, detailed Jira tickets.

    Key Technical Details:

    • Agent Structure: Single-agent architecture.
    • Native Tools: file_read.
    • Custom Agents: create_jira_ticket.
    • Model Provider: Amazon Bedrock.
  10. Overview of the Corrective RAG Agent

    main

    The Corrective Retrieval-Augmented Generation (RAG) Agent is a modular multi-tool system built with the Strands SDK. It is designed to identify low-relevance responses to user questions and automatically refine them using a feedback-based correction loop.

    Key components include:

    • Retrieval and Correction Agent: Uses Amazon Bedrock Knowledge Bases for retrieval and integrates a correction loop based on RAGAS metrics to re-query when context precision errors are detected.
    • Evaluation Module: Uses ragas, Langchain, and Strand Agent tooling to apply LLM-based precision scoring and reroute failed responses for augmentation.
    • External Web Search: Integrates the Tavily API to provide real-time, factual augmentation when the relevance of retrieved knowledge base chunks is low.
  11. Overview of Strands Agents Deployment Patterns (Python)

    main

    This repository provides reference patterns for deploying Strands Agents to various production environments using Python. Depending on your infrastructure requirements, you can choose from several deployment models:

    • AWS Lambda: Deploy agents as serverless functions for event-driven execution.
    • AWS Fargate: Run agents in serverless containers for more persistent or resource-intensive workloads.
    • Amazon Bedrock AgentCore: Host agents on a purpose-built runtime designed specifically for agentic workflows.
    • Amazon Bedrock AgentCore (Multi-Agent): Deploy multi-agent A2A (Agent-to-Agent) orchestration patterns using AgentCore.