A multi-agent system using Google's Agent Development Kit (ADK) that demonstrates agent-to-agent delegation. The main agent uses Claude API for reasoning, while a specialized Playwright agent handles web automation tasks. This system runs both locally and in AWS Bedrock AgentCore.
Multi-Agent Workflow:
- Main Agent (Claude API) β receives user requests and orchestrates the workflow
- Playwright Agent (Browser Automation) β handles web interactions like Google searches
- Response Integration β Main agent analyzes browser results and provides intelligent responses
Deployment Options:
- Local Development: Multi-agent system runs locally using your API key
- AWS Deployment: Same system runs in Bedrock AgentCore using secure outbound identity
- LLM Model: Claude 3.5 Sonnet via Anthropic API (not AWS Bedrock models)
- Browser Automation: Playwright with Chromium for headless web interactions
- Python 3.10+
- AWS CLI configured with appropriate permissions
- Anthropic Claude API key
- AWS Bedrock AgentCore access
- Playwright browsers (automatically installed via
make setup)
git clone <your-repo>
cd aws_agentcore_poc
make setup # Sets up everything: deps, virtual env, IAM role, etc.The agent uses secure credential management with multiple fallback options:
Option A: AWS Secrets Manager (Recommended for Production)
- API key is securely stored in AWS Secrets Manager
- No configuration needed - works automatically if you have the secret ARN configured
Option B: Environment Variable (Local Development Only)
- Set
ANTHROPIC_API_KEYin your.envfile:
# Claude API Configuration (LOCAL DEVELOPMENT ONLY)
# ANTHROPIC_API_KEY=sk-ant-your-api-key-here
# AWS Secrets Manager (Production - already configured)
SECRETS_MANAGER_SECRET_ARN=arn:aws:secretsmanager:region:account:secret:your-secret
# AWS Configuration (optional - uses AWS CLI if not set)
AWS_REGION=us-east-1
AWS_PROFILE=defaultπ Security Priority Order:
- AgentCore Outbound Identity (when running in AgentCore)
- AWS Secrets Manager (production-ready)
- Environment Variable (local development fallback)
make run # Test your agent locallymake configure # Configure AgentCore (auto-detects IAM role)
make launch # Deploy to AWS Bedrock AgentCore
make invoke # Test your deployed agentExpected output:
π Starting Claude Hello World ADK Agent...
π Agent Response:
{
"agent_response": "Hello! It's nice to meet you. I'm Claude, an AI assistant created by Anthropic. How are you doing today?",
"prompt_used": "please say hello",
"model": "claude-3-5-sonnet-20241022",
"status": "success"
}
aws_agentcore_poc/
βββ main.py # Main ADK agent implementation
βββ agent_example.py # AgentCore entry point handler
βββ config.py # Configuration management
βββ requirements.txt # Python dependencies
βββ Makefile # Development automation
βββ .env.template # Environment template
βββ .env # Your environment variables (created by make setup)
βββ .gitignore # Git ignore rules
βββ README.md # This file
| Command | Description |
|---|---|
make setup |
Set up development environment |
make run PROMPT="Summarise the headlines on https://www.abc.net.au/news" |
Run the agent locally |
make test |
Test the agent |
make package |
Package for AWS deployment |
make clean |
Clean build artifacts |
make help |
Show all available commands |
- AWS CLI configured with appropriate permissions
- Docker or Finch installed for local testing
- IAM Role for AgentCore execution with necessary permissions
- Outbound Identity: "Anthropic-Key-Diego" (you mentioned having this set up)
make setup # Installs deps + creates IAM role automaticallymake configure # Auto-detects the IAM role created in Step 1make launch # Deploy to AgentCore
make invoke # Test your deployed agent- β Creates Python virtual environment
- β Installs all dependencies (ADK, AgentCore, Claude API)
- β
Creates
.envfile template - β Auto-detects your AWS account
- β
Creates
AgentCoreExecutionRolewith proper permissions - β Shows you the IAM role ARN for reference
make launch-local # Test with AgentCore locally
make status # Check deployment statusIf you prefer to use the AgentCore CLI directly:
# Configure
agentcore configure --entrypoint agent_example.py --execution-role YOUR_IAM_ROLE_ARN
# Test locally
agentcore launch -l
# Deploy to AWS
agentcore launch
# Test
agentcore invoke '{"prompt": "Hello from AgentCore!"}'
# Check status
agentcore status- Agent tries AgentCore outbound identity (if available)
- Falls back to AWS Secrets Manager for API key
- Final fallback to
.envfile for local development - Creates Anthropic client with retrieved API key
- ADK agent calls Claude API directly
- Returns formatted JSON response
- AgentCore loads the packaged agent
- Primary: Uses outbound identity for secure API key management
- Fallback: Uses AWS Secrets Manager if outbound identity unavailable
- Agent processes requests through proper entry point
- Same agent code calls Claude API with secure credentials
- Returns response through AgentCore runtime
-
β No hardcoded credentials anywhere in the codebase
-
β AWS Secrets Manager for production API key storage
-
β Environment variables only for local development fallback
-
β Multi-tier credential resolution with secure priorities
-
β JSON secret parsing supporting multiple key formats
-
β IAM permissions properly configured for Secrets Manager
-
β
.envfile excluded from git
make testpython main.pyDeploy to AgentCore and test through AWS console or API calls.
-
Missing API Key
- Error:
ANTHROPIC_API_KEY is required - Solution: Add your API key to
.envfile
- Error:
-
Import Errors
- Error:
ModuleNotFoundError: No module named 'google.adk' - Solution: Run
make setupto install dependencies
- Error:
-
AWS Permissions
- Error: Permission denied for AgentCore operations
- Solution: Ensure your AWS CLI is configured with proper IAM permissions
-
Claude API Errors
- Error: Authentication failed
- Solution: Verify your ANTHROPIC_API_KEY is valid and active
β What's Not Working:
AgentCore has an issue detectin' Docker on yer system, even though Docker is clearly runnin'. This might be a bug in the AgentCore SDK or a path issue.
Deployment Issue:
- Our prompt forwarding fixes are only in local files (uncommitted)
- Current deployed version still has hardcoded "hello world"
- AgentCore isn't detecting Docker (even though Docker is running)
- Can't use --local-build or --local deployment modes
Current State: When you run agentcore invoke '{"prompt": "Search Melbourne Weather"}', it still searches for "hello world" because the deployed version doesn't have our fixes.