A serverless backend for Twilio Conversation Relay using Amazon Bedrock for AI voice assistants.
- REST API (
/twiml
) - Returns TwiML for Twilio - WebSocket API - Handles real-time communication
- DynamoDB - Stores conversation sessions
- Amazon Bedrock - Provides AI responses with streaming
- AWS CLI with appropriate permissions
- SAM CLI
- Python 3.12
- AWS account with Amazon Bedrock access
- Twilio account with a phone number
chmod +x deploy.sh
./deploy.sh
- Log in to Twilio account
- Navigate to Phone Numbers > Active Numbers
- Set webhook URL to your TwiML endpoint (from deployment outputs)
- Set HTTP Method to POST
Call your Twilio number and start speaking with the assistant.
WELCOME_GREETING
in POST functionSYSTEM_PROMPT
in WebSocket functionBedrockModelId
parameter during deployment in template.ymlBUCKET_NAME
indeploy.sh
chmod +x cleanup.sh
./cleanup.sh