AWS integrations for Twilio Agent Connect (TAC) - adapters and servers for AWS agent runtimes
Project description
Twilio Agent Connect AWS
AWS integrations for Twilio Agent Connect — connect AWS agent services to Twilio's communication channels.
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
- 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
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
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 deploy/README.md for production deployment guides:
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
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT License - see LICENSE file for details.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file twilio_agent_connect_aws-1.1.0.tar.gz.
File metadata
- Download URL: twilio_agent_connect_aws-1.1.0.tar.gz
- Upload date:
- Size: 27.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9086a8b7387f1fa46e5f09e23ff4760a3ebbd7e19600fb209ab21a3e6e112a45
|
|
| MD5 |
ee4796dc74886db1a6259c12769e648a
|
|
| BLAKE2b-256 |
639365c5bbd363f89b14400e0b355fc1c5059733bcfbc6dc3810a3af726d4a85
|
Provenance
The following attestation bundles were made for twilio_agent_connect_aws-1.1.0.tar.gz:
Publisher:
deploy.yml on twilio/twilio-agent-connect-aws
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
twilio_agent_connect_aws-1.1.0.tar.gz -
Subject digest:
9086a8b7387f1fa46e5f09e23ff4760a3ebbd7e19600fb209ab21a3e6e112a45 - Sigstore transparency entry: 2041125786
- Sigstore integration time:
-
Permalink:
twilio/twilio-agent-connect-aws@9947a7f08fe14fff8a49f02c36bf1f749899714a -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/twilio
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
deploy.yml@9947a7f08fe14fff8a49f02c36bf1f749899714a -
Trigger Event:
release
-
Statement type:
File details
Details for the file twilio_agent_connect_aws-1.1.0-py3-none-any.whl.
File metadata
- Download URL: twilio_agent_connect_aws-1.1.0-py3-none-any.whl
- Upload date:
- Size: 32.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
68437f88bc44df53157ce566708cc70af4c64bd91551c8d5ee099727bd4114fa
|
|
| MD5 |
95cef2b0978e5e9cbb0e86b05bcdccfb
|
|
| BLAKE2b-256 |
2864e872210c0c2a4dbd037ae1d9aacbc78596c23350c0ea77f8041fef54ebd9
|
Provenance
The following attestation bundles were made for twilio_agent_connect_aws-1.1.0-py3-none-any.whl:
Publisher:
deploy.yml on twilio/twilio-agent-connect-aws
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
twilio_agent_connect_aws-1.1.0-py3-none-any.whl -
Subject digest:
68437f88bc44df53157ce566708cc70af4c64bd91551c8d5ee099727bd4114fa - Sigstore transparency entry: 2041126093
- Sigstore integration time:
-
Permalink:
twilio/twilio-agent-connect-aws@9947a7f08fe14fff8a49f02c36bf1f749899714a -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/twilio
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
deploy.yml@9947a7f08fe14fff8a49f02c36bf1f749899714a -
Trigger Event:
release
-
Statement type: