Twilio Agent Connect AWS
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.
Features
Agent Runtime Integration
- 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
Multi-Channel Communication
- Every TAC channel - One codebase handles Voice, SMS, RCS, WhatsApp, and Chat
- Automatic conversation routing - Messages route to the correct agent instance per conversation, and replies go back out on the channel they arrived on
- Memory injection - Customer history and preferences automatically included in agent context
- Voice TwiML control - Greeting, voice, language, and interruption behavior via
TwiMLOptions, set statically or per call
Deployment Options
- 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
Production Ready
- 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
Installation
With Strands SDK
pip install twilio-agent-connect-aws[strands,server]
With Bedrock Agents
pip install twilio-agent-connect-aws[bedrock,server]
With Bedrock AgentCore
pip install twilio-agent-connect-aws[agentcore,server]
Development
# Install with development tools (includes all connectors)
pip install twilio-agent-connect-aws[dev]
Configuration
twilio-agent-connect-aws requires TAC environment variables. See TAC Configuration for details.
Required Environment Variables
# 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.io
Optional Environment Variables
Voice, SMS, and Chat need nothing beyond the above. Setting a sender here is all it takes to add that channel — the connector builds it for you.
TWILIO_RCS_SENDER_ID=your_rcs_sender_id
TWILIO_WHATSAPP_NUMBER=whatsapp:+1234567890
Examples
Full 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)
Deployment
See the deployment guides for production deployment options:
Container-based (Fargate)
- 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
Serverless (Lambda) ⭐ Recommended for AgentCore
- 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
Development
Setup
# 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
Code Quality
# Format code
make format
# Type check
make type-check
# Lint
make lint
# Run tests
make test
# Run all checks
make check
Dependencies
twilio-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
Documentation
- 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
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT License - see LICENSE file for details.
Metadata
Release files for twilio-agent-connect-aws 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| twilio_agent_connect_aws-2.0.0.tar.gz | 35.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| twilio_agent_connect_aws-2.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 74.7 kB
Release files / twilio_agent_connect_aws-2.0.0.tar.gz
| Download URL | twilio_agent_connect_aws-2.0.0.tar.gz |
|---|---|
| Size | 35.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a478b8cc79fff027d2da3fbd6a29b08c62453692c057428ac0e5e7e34138f82a
|
|
BLAKE2b-256 checksum How to use checksums |
5642aaf39e6b17e1f0e408621b5c9d8c1475660c11cb3ec6132b1d8ee03555f5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.
Transparency logRelease files / twilio_agent_connect_aws-2.0.0-py3-none-any.whl
| Download URL | twilio_agent_connect_aws-2.0.0-py3-none-any.whl |
|---|---|
| Size | 39.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9d2b5817c6ea3b29d91d80c0af7b0332aa8412647c43edcf58adc015d9da1744
|
|
BLAKE2b-256 checksum How to use checksums |
309f5ab827ee18de78dcf3a789dab4a92be2045ffce5fc20896ab42424434d4c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 17, 2026.
Transparency log