AWS integrations for Twilio Agent Connect — connect AWS agent services to Twilio's communication channels.
Documentation ◆ API Reference ◆ Python SDK ◆ Examples ◆ Deployment
AWS-specific connectors for Twilio Agent Connect (TAC), enabling seamless integration with AWS agent services like Strands, Bedrock Agents, and Bedrock AgentCore.
- AWS Strands SDK - Build conversational agents with persistent session management and context-aware configuration
- AWS Bedrock Agents - Connect console-created agents with managed action groups and knowledge bases
- AWS Bedrock AgentCore - Deploy custom agent code (any framework: Strands, LangGraph, OpenAI SDK) with managed runtime
- Lambda Deployment ⭐ Recommended - Serverless deployment with Lambda Function URL webhook proxy (no container infrastructure)
- Fargate Deployment - Container-based deployment with
BedrockAgentCoreConnectorand FastAPI server on AWS Fargate
- Voice and SMS support - Single codebase handles both phone calls and text messages
- Automatic conversation routing - Messages route to the correct agent instance per conversation
- Memory injection - Customer history and preferences automatically included in agent context
- FastAPI server - Production-ready server with AWS ALB optimization and ngrok support for local testing (Fargate deployments)
- Lambda Function URL proxy - Serverless webhook handler with Twilio signature validation for AgentCore deployments
- AgentCore runtime integration - Server adapter for Bedrock AgentCore with HTTP (SMS) and WebSocket (voice) support
- Twilio webhook validation - Automatic signature verification for secure integrations
- Session persistence - Continue conversations across interactions with built-in session management
- Error handling - Robust error handling and fallbacks for production reliability
pip install twilio-agent-connect-aws[strands,server]pip install twilio-agent-connect-aws[bedrock,server]pip install twilio-agent-connect-aws[agentcore,server]# Install with development tools (includes all connectors)
pip install twilio-agent-connect-aws[dev]twilio-agent-connect-aws requires TAC environment variables. See TAC Configuration for details.
# Twilio Configuration
TWILIO_ACCOUNT_SID=your_account_sid
TWILIO_AUTH_TOKEN=your_auth_token
TWILIO_API_KEY=your_api_key # Starts with SK
TWILIO_API_SECRET=your_api_secret # Secret for API key
TWILIO_PHONE_NUMBER=+1234567890
TWILIO_CONVERSATION_CONFIGURATION_ID=conv_configuration_xxx
# Server Configuration (for Voice)
TWILIO_VOICE_PUBLIC_DOMAIN=your-domain.ngrok.ioFull examples available in getting_started/examples/:
strands_agents.py- Strands SDK with per-conversation agent managementbedrock_agents.py- AWS Bedrock Agents (console-created agents)bedrock_agentcore_agents.py- AWS Bedrock AgentCore (custom agent code deployment)
See the deployment guides for production deployment options:
- Strands on Fargate - Deploy Strands SDK agents with FastAPI server
- Bedrock Agents on Fargate - Deploy console-created Bedrock agents
- AgentCore Connector on Fargate - Deploy custom agent code with
BedrockAgentCoreConnectorand FastAPI server- Full control over server configuration
- Use TAC connectors for multi-channel management
- AgentCore with Lambda - Deploy AgentCore runtime with Lambda Function URL webhook proxy
- No container infrastructure required
- Automatic scaling with Lambda and AgentCore
- Simpler deployment and lower operational overhead
- Uses
AgentCoreLambdaProxyandTACAgentCoreApputilities - See
deploy/agentcore_aws_lambda/for setup guide
# Clone repository
git clone https://github.com/twilio/twilio-agent-connect-aws.git
cd twilio-agent-connect-aws
# Install dependencies
make sync
# Setup dev environment
make dev-setup# Format code
make format
# Type check
make type-check
# Lint
make lint
# Run tests
make test
# Run all checks
make checktwilio-agent-connect-aws depends on:
- tac - Core Twilio Agent Connect framework (installed from GitHub)
- Requires
tac[server]extra for TAC Server support
- Requires
- strands-agents (optional) - AWS Strands SDK
- API Reference - Full API documentation generated from the source
- CLAUDE.md - Architecture, development guide, and API reference
- Getting Started Guide - Setup instructions, environment variables, and troubleshooting
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License - see LICENSE file for details.