Ships Microsoft Agent Framework and Azure AI Voice Live connectors for Twilio Agent Connect (TAC), plus production Azure deployments for each.
- AgentFrameworkConnector - connects Microsoft Agent Framework agents to TAC
- Agent lifecycle management (Voice + SMS + Chat)
- Supports Foundry Hosted Agents, Foundry Prompt Agents, Azure OpenAI (Responses API, Chat Completions), and other backends
- Pluggable session persistence via
AgentSessionStoreprotocol - Memory context injection and
on_message/on_errorhooks
- VoiceLiveConnector - connects the Voice Live API to TAC
- Text-in / text-streaming-out over WebSocket (STT and TTS handled by Twilio Conversation Relay)
- Server-side conversation state (no local session management)
- Native interrupt handling via Voice Live
response.cancel(server-side truncation of in-flight responses) - Tool execution with async handlers
- Multi-channel support (Voice + SMS + Chat)
- Built-in TAC tools (memory recall, knowledge search, Studio Flow handoff)
- Production reference deployments (Bicep + azd) for running your TAC agent on Azure:
- Agent Framework on Azure Container Apps
- Agent Framework on Hosted Agents in Foundry Agent Service (
TACHostedAgentsApp, APIM-fronted) - Voice Live on Azure Container Apps
AgentSessionStoreimplementations for in-memory, file, and Cosmos DB
pip install twilio-agent-connect-microsoft[agent-framework,server]pip install twilio-agent-connect-microsoft[voice-live,server]pip install twilio-agent-connect-microsoft[hosted-agents]The hosted-agents extra provides the Hosted Agents runtime (TACHostedAgentsApp) and includes tac[server], so a separate server extra isn't needed. TACHostedAgentsApp hosts any TAC connector, so add the extra for the connector you want — e.g. [hosted-agents,agent-framework] (as the deployment example does) or [hosted-agents,voice-live]. Or pair it with TAC core to host an agent built on any other SDK.
git clone https://github.com/twilio/twilio-agent-connect-microsoft.git
cd twilio-agent-connect-microsoft
uv sync --all-extrasBefore running any examples, you need to create and configure the required Twilio services (Conversation Configuration, phone number, etc.). Follow the TAC Quickstart guide to set these up.
TAC Microsoft requires TAC environment variables. See TAC Configuration for details.
# Twilio Agent Connect (required for all examples)
TWILIO_CONVERSATION_CONFIGURATION_ID=conv_configuration_xxxxxxxxxxxxxxxxxx
TWILIO_ACCOUNT_SID=ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
TWILIO_AUTH_TOKEN=your_auth_token
TWILIO_API_KEY=SKxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
TWILIO_API_SECRET=your_api_key_secret
TWILIO_PHONE_NUMBER=+1234567890
# Server (required for voice)
TWILIO_VOICE_PUBLIC_DOMAIN=your-domain.ngrok.io
# Azure OpenAI — Agent Framework basic example (API key auth)
# Endpoint is the resource base URL only — no /openai/v1 suffix.
AZURE_OPENAI_ENDPOINT=https://your-resource.openai.azure.com/
AZURE_AI_API_KEY=your_azure_openai_api_key
AZURE_AI_DEPLOYMENT_NAME=gpt-4o
# Agent Framework advanced example uses the same AZURE_OPENAI_ENDPOINT as basic,
# but authenticates via `DefaultAzureCredential` (run `az login` first) instead of an API key.
# Voice Live API — voice_live example (hostname only, no https:// prefix)
# AZURE_VOICE_LIVE_ENDPOINT=your-resource.services.ai.azure.com
# AZURE_VOICE_LIVE_API_KEY=your_voice_live_api_key
# AZURE_VOICE_LIVE_MODEL=gpt-realtimeSee getting_started/examples/.env.example for the full list including optional features (Cosmos DB, knowledge base, conversation intelligence). Copy it to getting_started/examples/.env and fill in your values — all examples load from that shared file.
Everything imports from tac_microsoft — no need to import from the underlying tac package:
from tac_microsoft import (
TAC, TACConfig, TACFastAPIServer,
AgentFrameworkConnector, ConversationSession,
FileAgentSessionStore,
)
from tac_microsoft.agent_framework_tools import create_memory_toolFull examples available in getting_started/examples/:
agent_framework/basic.py- Minimal Agent Framework setup (~30 lines)agent_framework/advanced.py- Full feature set (channel-aware prompts, tools, hooks, session persistence)voice_live/basic.py- Voice Live API with tool calling
The AgentSessionStore protocol defines how Agent Framework sessions are persisted between requests, enabling conversation continuity across SMS messages and horizontal scaling for voice.
Three implementations are included:
InMemoryAgentSessionStore— default, suitable for single-instance deploymentsFileAgentSessionStore— persists sessions as JSON files on disk (single-instance, local dev). Also the recommended store for Hosted Agents in Foundry Agent Service, where APIM pins each conversation to one sandbox viaagent_session_idaffinity and$HOMEsurvives idle eviction — giving durable continuity without Cosmos DBCosmosDBAgentSessionStore— persists sessions in Azure Cosmos DB for NoSQL (horizontally scaled production). Requires thecosmosextra:pip install twilio-agent-connect-microsoft[cosmos]
Implement the protocol to use any other backing store (Redis, DynamoDB, Postgres, etc.).
# Clone repository
git clone https://github.com/twilio/twilio-agent-connect-microsoft.git
cd twilio-agent-connect-microsoft
# Install dependencies
uv sync --all-extrasSee getting_started/README.md for the full setup and deployment guide.
TAC Microsoft depends on:
- twilio-agent-connect - Core Twilio Agent Connect framework (installed from PyPI)
- Requires
twilio-agent-connect[server]extra for TACFastAPIServer support
- Requires
- agent-framework (optional) - Microsoft Agent Framework
- websockets (optional) - For Voice Live connector
- azure-cosmos (optional) - For CosmosDB session store
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License - see LICENSE file for details.