Skip to main content
Twilio Agent Connect AWS Logo

Twilio Agent Connect AWS

AWS integrations for Twilio Agent Connect — connect AWS agent services to Twilio's communication channels.

PyPI Python SDK License CI Status Getting Started

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 BedrockAgentCoreConnector and 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 management
  • bedrock_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 BedrockAgentCoreConnector and 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 AgentCoreLambdaProxy and TACAgentCoreApp utilities
    • 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
  • 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.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for twilio-agent-connect-aws 2.0.1
File Size Uploaded Provenance Actions
twilio_agent_connect_aws-2.0.1.tar.gz 35.8 kB With provenance Details for twilio_agent_connect_aws-2.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for twilio-agent-connect-aws 2.0.1
File Interpreter ABI Platform Actions
twilio_agent_connect_aws-2.0.1-py3-none-any.whl Python 3 none any Details for twilio_agent_connect_aws-2.0.1-py3-none-any.whl

Total release size: 74.7 kB

Release files / twilio_agent_connect_aws-2.0.1.tar.gz

Download URL twilio_agent_connect_aws-2.0.1.tar.gz
Size 35.8 kB
Tags Source
SHA-256 checksum
How to use checksums
96505d5f88dbef3353000a05512673e8036c2e0e9575eb70d8bcf5012bbc8435
BLAKE2b-256 checksum
How to use checksums
f4252ad00867b442b2428c4bbb12f8e43a6ad19852ad562e492e74ad3d03479f
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 Nov 10, 2026.

Transparency log

Release files / twilio_agent_connect_aws-2.0.1-py3-none-any.whl

Download URL twilio_agent_connect_aws-2.0.1-py3-none-any.whl
Size 39.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d87d14ffa2e10056bc20fc462db112567bea60d6c4b762ae066fb70390f1aed1
BLAKE2b-256 checksum
How to use checksums
df396071f6f344661060deac0c3fd713abaae8e9425aa2356ab77b981a69ad9b
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 Nov 10, 2026.

Transparency log

Security for twilio-agent-connect-aws 2.0.1

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for twilio_agent_connect_aws-2.0.1.tar.gz

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 Nov 10, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page