Skip to content

AIplayer23/strands-workshop

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

AWS Strands AI Agents Workshop

πŸš€ Workshop Overview

Building Production AI Agents with AWS Strands SDK
Duration: 1 hour and 20 minutes (80 minutes)
Format: Hands-on workshop with live coding
Target Audience: Developers, AI Engineers, Solution Architects

🎯 Learning Objectives

By the end of this workshop, you will be able to:

  1. Build AI agents using the model-driven AWS Strands SDK approach
  2. Integrate multiple LLM providers (Bedrock, OpenAI, NVIDIA NIM, OpenRouter)
  3. Create custom tools and extend agent capabilities
  4. Implement multi-agent orchestration patterns using agents-as-tools
  5. Deploy agents to production using AWS Lambda
  6. Understand A2A protocol for agent interoperability
  7. Integrate MCP (Model Context Protocol) for enhanced tool capabilities

πŸš€ Quick Start with GitHub Codespaces (Recommended)

Get started in under 2 minutes with zero local setup!

  1. Fork this repository: Fork strands-workshop
  2. Launch Codespace: Click "Code" β†’ "Create codespace on main"
  3. Wait for setup (2-3 minutes): All dependencies install automatically
  4. Configure AWS: Run aws configure and enable Claude 3.7 Sonnet in Bedrock Console
  5. Verify & Start: python setup/verify_setup.py then begin Module 1

πŸ“– Detailed Codespaces Setup Guide

πŸ“‹ Prerequisites (Local Setup Only)

Skip this section if using Codespaces above

Required Setup

  • Python 3.10+ installed
  • AWS Account with Bedrock access
  • Docker (for MCP server integration)
  • API Keys (optional but recommended):
    • OpenAI API key
    • NVIDIA NIM API key
    • OpenRouter API key

Pre-Workshop Setup

  1. Fork and clone this repository
  2. Create virtual environment: python -m venv .venv && source .venv/bin/activate
  3. Install dependencies: pip install -r requirements.txt
  4. Configure AWS credentials: aws configure
  5. Enable Claude 3.7 Sonnet in AWS Bedrock Console
  6. Verify setup: python setup/verify_setup.py

πŸ—οΈ Workshop Structure: Three-Act Journey

Act I: The Single Agent (20 minutes)

Master individual agent development

  • Module 1: Hello Agent (10 min) - Your first working agent with basic model integration
  • Module 2: Custom Tools (10 min) - Extend agent capabilities with @tool decorator and MCP integration

Act II: Multi-Agent Orchestration (35 minutes)

Build collaborative agent systems

  • Module 3: Research Team (20 min) - Real multi-agent coordination using agents-as-tools pattern with MCP
  • Module 4: Lambda Deployment (20 min) - Production deployment patterns and serverless architecture

Act III: Advanced Patterns & Interoperability (25 minutes)

Production deployment and interoperability

  • Module 5: A2A Preview (20 min) - Agent-to-agent communication with decoupled architecture

πŸ“ Directory Structure

strands-workshop/
β”œβ”€β”€ README.md                          # This file
β”œβ”€β”€ setup/                             # Setup verification scripts
β”‚   β”œβ”€β”€ verify_setup.py               # Complete setup verification
β”‚   β”œβ”€β”€ test_providers.py             # Test provider access
β”‚   └── troubleshooting.md            # Common issue resolution
└── exercises/                         # Progressive workshop modules
    β”œβ”€β”€ module1-basics/
    β”‚   β”œβ”€β”€ README.md                  # Module 1 documentation
    β”‚   β”œβ”€β”€ exercise1-hello-agent.py   # Basic agent creation
    β”‚   └── exercise1-simple-multi-provider.py  # Multi-provider example
    β”œβ”€β”€ module2-tools/
    β”‚   β”œβ”€β”€ README.md                  # Module 2 documentation
    β”‚   β”œβ”€β”€ MCP_INTEGRATION.md         # MCP integration guide
    β”‚   β”œβ”€β”€ exercise2-custom-tools.py  # Custom tool development
    β”‚   └── optional-module2-mcp-integration.py  # Optional MCP exercise
    β”œβ”€β”€ module3-multi-agent/
    β”‚   β”œβ”€β”€ README.md                  # Module 3 documentation
    β”‚   └── exercise3-research-team.py # Multi-agent orchestration
    β”œβ”€β”€ module4-deployment/
    β”‚   └── exercise4-lambda-deployment-tutorial.md  # Deployment guide
    └── module5-advanced/
        β”œβ”€β”€ README.md                  # Module 5 documentation
        β”œβ”€β”€ exercise5-a2a-preview.py   # A2A protocol overview
        β”œβ”€β”€ main.py                    # A2A system entry point
        └── src/                       # Decoupled agent implementation
            β”œβ”€β”€ orchestrator.py        # Main orchestration logic
            β”œβ”€β”€ research_agent.py      # Research specialist
            β”œβ”€β”€ analysis_agent.py      # Analysis specialist
            β”œβ”€β”€ factcheck_agent.py     # Fact-checking specialist
            └── qa_agent.py            # Quality assurance specialist

πŸ”§ Quick Start

  1. Verify Setup:

    python setup/verify_setup.py
  2. Test Provider Access:

    python setup/test_providers.py
  3. Start with Module 1:

    cd exercises/module1-basics
    python exercise1-hello-agent.py

πŸ› οΈ Installation Commands

Core Dependencies

# Virtual environment setup
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

# Install all dependencies
pip install -r requirements.txt

Individual Component Installation

# Core Strands SDK
pip install strands-agents

# Provider-specific dependencies
pip install 'strands-agents[openai]'      # OpenAI integration
pip install 'strands-agents[litellm]'     # NVIDIA NIM and OpenRouter
pip install 'strands-agents-tools'        # Built-in tools

# AWS integration
pip install boto3                                 # AWS SDK for Bedrock

πŸ”‘ Environment Variables

Create a .env file in the workshop root:

# AWS (configured via aws configure)
AWS_REGION=us-east-1

# Optional API Keys
OPENAI_API_KEY=sk-...
NVIDIA_API_KEY=nvapi-...
OPENROUTER_API_KEY=sk-or-...

πŸ“š Key Technologies

  • AWS Strands SDK: Model-driven agent framework with intelligent routing
  • Amazon Bedrock: Enterprise LLM service (Claude 3.7 Sonnet)
  • OpenAI: GPT-4 models for comparison and fallback
  • NVIDIA NIM: GPU-accelerated inference
  • OpenRouter: Cost-effective model gateway
  • MCP (Model Context Protocol): Tool integration and external service access
  • AWS Lambda: Serverless deployment and production scaling
  • A2A Protocol: Agent-to-agent communication standard

πŸŽ“ Workshop Learning Path

Each module builds progressive complexity:

  1. Module 1: Hello Agent β†’ Master core SDK concepts and basic agent creation
  2. Module 2: Custom Tools β†’ Extend capabilities with @tool decorator and MCP integration
  3. Module 3: Multi-Agent β†’ Real orchestration using agents-as-tools pattern
  4. Module 4: Lambda Deployment β†’ Production deployment patterns and serverless architecture
  5. Module 5: A2A Preview β†’ Advanced interoperability and decoupled agent systems

πŸ—οΈ Architecture Patterns

Module 1: Basic Agent Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚    User     │───▢│    Agent    │───▢│   Bedrock   β”‚
β”‚   Input     β”‚    β”‚   (Strands) β”‚    β”‚   Claude    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Module 2: Agent + Custom Tools

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚    User     │───▢│    Agent    │───▢│   Bedrock   β”‚
β”‚   Input     β”‚    β”‚   +Tools    β”‚    β”‚   Claude    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                           β”‚
                           β–Ό
                   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                   β”‚ Custom Toolsβ”‚
                   β”‚ MCP Server  β”‚
                   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Module 3: Multi-Agent Orchestration

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚    User     │───▢│Orchestrator │───▢│   Bedrock   β”‚
β”‚   Input     β”‚    β”‚   Agent     β”‚    β”‚   Claude    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                           β”‚
                           β–Ό
                   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                   β”‚ Specialist  β”‚
                   β”‚   Agents    β”‚
                   β”‚ (@tool)     β”‚
                   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Module 4: Lambda Deployment

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Client    │───▢│   Lambda    │───▢│   Bedrock   β”‚
β”‚  Request    β”‚    β”‚   Handler   β”‚    β”‚   Claude    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                           β”‚
                           β–Ό
                   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                   β”‚ Agent Logic β”‚
                   β”‚   +Tools    β”‚
                   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Module 5: A2A Decoupled Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚    User     │───▢│Orchestrator │───▢│ Research    β”‚
β”‚   Input     β”‚    β”‚   Process   β”‚    β”‚   Agent     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                           β”‚
                           β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β–Ά β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                           β”‚           β”‚ Analysis    β”‚
                           β”‚           β”‚   Agent     β”‚
                           β”‚           β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                           β”‚
                           └─────────▢ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                                       β”‚ Fact-Check  β”‚
                                       β”‚   Agent     β”‚
                                       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ†˜ Troubleshooting

Common Issues

  • ModuleNotFoundError: Run pip install -r requirements.txt
  • AWS Credentials: Run aws configure and ensure Bedrock access
  • Bedrock Access: Enable Claude 3.7 Sonnet in AWS Bedrock Console
  • API Keys: Check environment variables in .env file
  • Docker Issues: Required for MCP server integration (DuckDuckGo, Sequential Thinking)
  • MCP Connection: Ensure Docker is running for MCP server-based tools

Getting Help

  • Check setup/troubleshooting.md for detailed issue resolution
  • Use setup verification scripts: python setup/verify_setup.py
  • Review individual module READMEs for specific guidance

πŸ“– Additional Resources


Ready to build production AI agents? Let's get started! πŸš€

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 52.4%
  • Python 22.3%
  • JavaScript 15.1%
  • CSS 10.2%