Twilio Agent Connect Google
Google Cloud integrations for Twilio Agent Connect — connect Google Cloud agent services to Twilio's communication channels.
Google Cloud-specific connectors for Twilio Agent Connect (TAC) — Twilio's framework for connecting AI agents to voice and messaging channels (Python SDK) — enabling seamless integration with Google Cloud agent services like Agent Platform Runtime (Reasoning Engine), CX Agent Studio (Customer Engagement Suite), Conversational Agents (Dialogflow CX), and the Agent Development Kit (ADK).
Features
Agent Runtime Integration
- GCP Agent Platform Runtime (Reasoning Engine) — two connectors, one per deployment type:
ADKAgentEngineConnector— Google ADK agents, session-based, streamingasync_stream_query()StudioAgentEngineConnector— Agent Studio apps, invoked over thestreamQueryREST endpoint
- CX Agent Studio (Customer Engagement Suite) via
CXAgentStudioConnector— connect an agent built in the CX Agent Studio console; SMS/RCS/WhatsApp/Chat + ConversationRelay voice invoke the textrunSessionAPI, or switch voice to native speech-to-speech overBidiRunSession - Conversational Agents (Dialogflow CX) via
ConversationalAgentsConnector— connect an agent built in the Conversational Agents console; invoked over the Dialogflow CXdetectIntentAPI (works for Playbook and Flow agents)
Multi-Channel Communication
- Voice, SMS, RCS, WhatsApp, and Chat support - Single codebase handles phone calls and every messaging channel; SMS/Voice/Chat are always available, RCS/WhatsApp activate automatically once their Twilio resource (
TWILIO_RCS_SENDER_ID/TWILIO_WHATSAPP_NUMBER) is configured - 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
- Cloud Run server ⭐ Recommended - Containerized TAC server with a public HTTPS URL and WebSocket support (required for Twilio ConversationRelay voice)
- Local (ngrok) - Run the FastAPI server locally against a deployed agent for testing
Production Ready
- Twilio webhook validation - Automatic signature verification for secure integrations
- Secret Manager - Twilio credentials stored in Google Secret Manager, injected at runtime
- Session & memory - Server-side sessions (ADK and Agent Studio), with Conversation Memory injection
Installation
With Agent Platform Runtime
pip install twilio-agent-connect-google[vertex-ai,server]
With CX Agent Studio
pip install twilio-agent-connect-google[cx-agent-studio,server]
With Conversational Agents
pip install twilio-agent-connect-google[conversational-agents,server]
Development
# Install with development tools (includes all connectors)
pip install twilio-agent-connect-google[dev]
Note: Requires Python 3.10 or 3.11. Python 3.12+ is not supported because GCP Agent Platform Runtime (Reasoning Engine) only supports Python 3.8–3.11. We recommend Python 3.11.
Configuration
twilio-agent-connect-google requires TAC environment variables. See TAC Configuration for details.
Required Environment Variables
# GCP Configuration
GOOGLE_CLOUD_PROJECT=your-project-id
GOOGLE_CLOUD_LOCATION=your-region
GCP_REASONING_ENGINE_ID=your-reasoning-engine-id
# 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
# Optional: enables RCS / WhatsApp
# TWILIO_RCS_SENDER_ID=rcs_sender_xxxxxxxxxxxxxxxxxx
# TWILIO_WHATSAPP_NUMBER=whatsapp:+1234567890
# Server Configuration (for Voice)
TWILIO_VOICE_PUBLIC_DOMAIN=your-domain.ngrok.io
Examples
Full examples available in getting_started/examples/:
agent_platform/adk_agent_engine.py- Connect Twilio to an ADK agent deployed on GCP Agent Platform Runtimeagent_platform/studio_agent_engine.py- Connect Twilio to an Agent Studio app deployed on GCP Agent Platform Runtimecx_agent_studio/cascaded.py- Connect Twilio to an agent built in CX Agent Studio (Customer Engagement Suite), text/SMS + ConversationRelay voicecx_agent_studio/s2s.py- Same CX Agent Studio agent, but native speech-to-speech voice (Twilio Media Streams +BidiRunSession, no ConversationRelay)conversational_agents.py- Connect Twilio to an agent built in Conversational Agents (Dialogflow CX)features/whatsapp.py,features/rcs.py- Enable a single messaging channel (WhatsApp or RCS) on its ownfeatures/chat/- Browser-based web chat (Twilio Conversations JS SDK), runnable entirely on localhost
Deployment
See deploy/ for production deployment guides:
Cloud Run (Agent Platform Runtime) ⭐ Recommended
- Deploy your agent (ADK, or a source-code app built in Agent Studio) to Agent Platform Runtime and the TAC server to Cloud Run
- Public HTTPS URL + WebSocket for Twilio ConversationRelay (voice)
- Twilio credentials stored in Secret Manager
- Two fully independent setups (
adk/andstudio/), each with its own.envandmakeworkflow (create-sa,deploy-secret,deploy-server,deploy-all) - See
deploy/agent_platform/for the setup guide
Cloud Run (CX Agent Studio)
- Build the agent in the CX Agent Studio console; deploy the TAC server to Cloud Run
- Same Cloud Run + Secret Manager +
makeworkflow; voice defaults to ConversationRelay (runSession) but can switch to native speech-to-speech (BidiRunSession) - See
deploy/cx_agent_studio/for the setup guide
Cloud Run (Conversational Agents)
- Build the agent in the Conversational Agents (Dialogflow CX) console; deploy the TAC server to Cloud Run
- Same Cloud Run + Secret Manager +
makeworkflow, invoking the Dialogflow CXdetectIntentAPI - See
deploy/conversational_agents/for the setup guide
Development
Setup
# Clone repository
git clone https://github.com/twilio/twilio-agent-connect-google.git
cd twilio-agent-connect-google
# 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-google depends on:
- twilio-agent-connect - Core Twilio Agent Connect framework
- Requires the
[server]extra for TAC Server support
- Requires the
- google-cloud-aiplatform - Vertex AI / Agent Platform Runtime (Reasoning Engine)
- google-adk (optional) - Google Agent Development Kit, for ADK agents
- google-auth, requests, websockets - used by the CX Agent Studio connector to call the CX Agent Studio API (via the
cx-agent-studioextra)
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-google 1.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 | Provenance | Actions |
|---|---|---|---|---|
| twilio_agent_connect_google-1.0.0.tar.gz | 32.2 kB | With provenance | Details for twilio_agent_connect_google-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| twilio_agent_connect_google-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for twilio_agent_connect_google-1.0.0-py3-none-any.whl |
Total release size: 64.5 kB
Release files / twilio_agent_connect_google-1.0.0.tar.gz
| Download URL | twilio_agent_connect_google-1.0.0.tar.gz |
|---|---|
| Size | 32.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2c7cdb13223e85fa52ae60678858a199db395a5ea921143d058e67d0bedcc87c
|
|
BLAKE2b-256 checksum How to use checksums |
331f060d8aaa40753357d25228142ab70a983d3ef05e47c68e7c6440899c96ec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
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 11, 2026.
Transparency logRelease files / twilio_agent_connect_google-1.0.0-py3-none-any.whl
| Download URL | twilio_agent_connect_google-1.0.0-py3-none-any.whl |
|---|---|
| Size | 32.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
25878ba9a66c1c61ae520ecdf556b3bac85a121ccfa0579f408939cd23891516
|
|
BLAKE2b-256 checksum How to use checksums |
0ecb985939a3dac9c9e7357373d74a93ae62d8218a06392f07a5e19b22d3e95d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
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 11, 2026.
Transparency logSecurity for twilio-agent-connect-google 1.0.0
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
All 2 files in this release have been uploaded with provenance metadata.
Attestation for twilio_agent_connect_google-1.0.0.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 Sep 11, 2026.
Transparency logA 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.