A boilerplate for deploying multi-agent systems on AWS Lambda using the Strands Agents SDK.
The project implements an orchestrator pattern: a top-level agent receives user queries and delegates work to specialist agents, each equipped with their own tools. The whole stack runs as a single Lambda function behind API Gateway.
flowchart TD
GW[API Gateway] --> LH[Lambda Handler]
LH --> O[Orchestrator Agent]
O --> TA[Time Agent]
O --> WA[Weather Agent]
TA --> T[get_current_time]
WA --> W[get_weather]
- Orchestrator — routes incoming queries to the right specialist(s) and combines their responses.
- Time Agent — answers date/time questions using the
get_current_timetool. - Weather Agent — answers weather questions using the
get_weathertool (mock data).
.
├── lambda_handler.py # Lambda entry point
├── agents/
│ ├── __init__.py # Exports create_orchestrator
│ ├── config.py # Model provider config (Bedrock / Anthropic)
│ ├── orchestrator.py # Orchestrator agent
│ ├── specialists/
│ │ ├── __init__.py
│ │ ├── time_agent.py # Time specialist agent
│ │ └── weather_agent.py # Weather specialist agent
│ └── tools/
│ ├── __init__.py
│ ├── time.py # get_current_time tool
│ └── weather.py # get_weather tool
├── Dockerfile # Lambda container image
├── requirements.txt # Python dependencies
└── .env.example # Environment variable template
- Python 3.13+
- An AWS account with Bedrock model access enabled (default), or an Anthropic API key
- Docker (for building the Lambda container image)
Copy the env template and edit as needed:
cp .env.example .envThe project defaults to Amazon Bedrock — no API key required, authentication is handled by the Lambda execution role's IAM permissions.
To switch to Anthropic direct, uncomment Option B in agents/config.py and set ANTHROPIC_API_KEY in your environment.
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtYou can test the orchestrator directly in Python:
from agents import create_orchestrator
agent = create_orchestrator()
result = agent("What time is it?")
print(result)Build and push the container image, then create a Lambda function pointing at it:
docker build -t aws-agentic-boilerplate .The Lambda handler is lambda_handler.handler.
The function expects an API Gateway proxy event with a JSON body:
{ "query": "What's the weather in Tokyo?" }Response:
{ "answer": "Weather in Tokyo: sunny, 28°C, humidity 65%" }- Create a new tool in
agents/tools/using the@tooldecorator. - Create a new specialist in
agents/specialists/that wraps anAgentwith your tool. - Register the specialist in
agents/orchestrator.pyby adding it to thetoolslist. - Update the orchestrator's system prompt to describe when to use the new specialist.
See AGENTS.md for a deeper explanation of the agent architecture.
MIT