Deploy Voice AI Agent
When to Use
- Deploy an autonomous voice agent with stateful conversations
- Configure dialog state machine for multi-turn interactions
- Set up intent detection with entity extraction
- Enable proactive actions (agent initiates rather than just responds)
- Configure voice personality with SSML prosody
How Play 33 Differs from Play 04 (Call Center)
| Aspect |
Play 04 (Call Center) |
Play 33 (Voice Agent) |
| Mode |
Inbound phone calls only |
Any voice interface (phone, web, IoT) |
| Conversation |
Single-intent resolution |
Multi-turn stateful dialog |
| State |
Stateless per call |
Persistent dialog state machine |
| Actions |
Respond + escalate |
Proactive (initiate tasks, schedule) |
| Context |
Current call only |
Remembers previous interactions |
| Personality |
Professional customer service |
Configurable persona |
Prerequisites
- Azure Speech Service (STT + TTS, Custom Neural Voice optional)
- Azure OpenAI (gpt-4o for dialog, gpt-4o-mini for intent classification)
- Cosmos DB (dialog state persistence)
- Container Apps (voice agent runtime)
Step 1: Deploy Infrastructure
az bicep lint -f infra/main.bicep
az deployment group create -g $RG -f infra/main.bicep -p infra/parameters.json
Step 2: Configure Dialog State Machine
{
"states": {
"idle": { "transitions": ["greeting"] },
"greeting": { "transitions": ["intent_detect", "farewell"] },
"intent_detect": { "transitions": ["task_execute", "clarify", "escalate"] },
"clarify": { "transitions": ["intent_detect"], "max_turns": 3 },
"task_execute": { "transitions": ["confirm", "error_handle"] },
"confirm": { "transitions": ["idle", "task_execute"] },
"escalate": { "transitions": ["idle"] },
"error_handle": { "transitions": ["clarify", "escalate"] },
"farewell": { "transitions": ["idle"] }
}
}
Step 3: Configure Intent Detection
| Intent |
Example Utterances |
Action |
| schedule_meeting |
"Book a meeting", "Set up a call" |
Calendar API |
| check_status |
"What's my order status?", "Any updates?" |
Status lookup |
| make_change |
"Update my address", "Change my plan" |
Account update |
| get_info |
"What are your hours?", "Tell me about..." |
KB retrieval |
| escalate |
"Talk to a human", "I need help" |
Agent handoff |
Step 4: Configure Voice Personality
<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis">
<voice name="{configured_voice}">
<prosody rate="{rate}" pitch="{pitch}">
<mstts:express-as style="{style}">
{response_text}
</mstts:express-as>
</prosody>
</voice>
</speak>
Step 5: Configure Proactive Actions
- Agent can initiate: appointment reminders, status updates, follow-ups
- Triggered by: schedule, event, condition (e.g., order shipped)
- Channel: outbound call, push notification, or waiting for next interaction
Step 6: Post-Deployment Verification
Troubleshooting
| Issue |
Cause |
Fix |
| Dialog stuck in one state |
Missing transition |
Add transition in state config |
| Intent misclassified |
Overlapping intents |
Add more diverse training utterances |
| Context lost between turns |
State not persisted |
Check Cosmos DB write + read |
| Voice sounds robotic |
Standard voice not neural |
Switch to Custom Neural Voice |
| Agent doesn't initiate |
Proactive trigger not configured |
Add schedule/event trigger |
| Too many clarifications |
Intent threshold too high |
Lower confidence threshold from 0.9 to 0.8 |
Voice Interaction Loop
1. Listen (STT continuous recognition)
2. Detect intent + extract entities
3. Update dialog state machine
4. Generate response with context
5. Speak response (TTS with SSML)
6. Repeat until farewell or escalation
Source: frootai/frootai — distributed by TomeVault.
1---2name: frootai-frootai-deploy-voice-ai-agent3description: Deploy Voice AI Agent4---56# Deploy Voice AI Agent78## When to Use9- Deploy an autonomous voice agent with stateful conversations10- Configure dialog state machine for multi-turn interactions11- Set up intent detection with entity extraction12- Enable proactive actions (agent initiates rather than just responds)13- Configure voice personality with SSML prosody1415## How Play 33 Differs from Play 04 (Call Center)16| Aspect | Play 04 (Call Center) | Play 33 (Voice Agent) |17|--------|----------------------|----------------------|18| Mode | Inbound phone calls only | Any voice interface (phone, web, IoT) |19| Conversation | Single-intent resolution | Multi-turn stateful dialog |20| State | Stateless per call | Persistent dialog state machine |21| Actions | Respond + escalate | Proactive (initiate tasks, schedule) |22| Context | Current call only | Remembers previous interactions |23| Personality | Professional customer service | Configurable persona |2425## Prerequisites261. Azure Speech Service (STT + TTS, Custom Neural Voice optional)272. Azure OpenAI (gpt-4o for dialog, gpt-4o-mini for intent classification)283. Cosmos DB (dialog state persistence)294. Container Apps (voice agent runtime)3031## Step 1: Deploy Infrastructure32```bash33az bicep lint -f infra/main.bicep34az deployment group create -g $RG -f infra/main.bicep -p infra/parameters.json35```3637## Step 2: Configure Dialog State Machine38```json39{40 "states": {41 "idle": { "transitions": ["greeting"] },42 "greeting": { "transitions": ["intent_detect", "farewell"] },43 "intent_detect": { "transitions": ["task_execute", "clarify", "escalate"] },44 "clarify": { "transitions": ["intent_detect"], "max_turns": 3 },45 "task_execute": { "transitions": ["confirm", "error_handle"] },46 "confirm": { "transitions": ["idle", "task_execute"] },47 "escalate": { "transitions": ["idle"] },48 "error_handle": { "transitions": ["clarify", "escalate"] },49 "farewell": { "transitions": ["idle"] }50 }51}52```5354## Step 3: Configure Intent Detection55| Intent | Example Utterances | Action |56|--------|-------------------|--------|57| schedule_meeting | "Book a meeting", "Set up a call" | Calendar API |58| check_status | "What's my order status?", "Any updates?" | Status lookup |59| make_change | "Update my address", "Change my plan" | Account update |60| get_info | "What are your hours?", "Tell me about..." | KB retrieval |61| escalate | "Talk to a human", "I need help" | Agent handoff |6263## Step 4: Configure Voice Personality64```xml65<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis">66 <voice name="{configured_voice}">67 <prosody rate="{rate}" pitch="{pitch}">68 <mstts:express-as style="{style}">69 {response_text}70 </mstts:express-as>71 </prosody>72 </voice>73</speak>74```7576## Step 5: Configure Proactive Actions77- Agent can initiate: appointment reminders, status updates, follow-ups78- Triggered by: schedule, event, condition (e.g., order shipped)79- Channel: outbound call, push notification, or waiting for next interaction8081## Step 6: Post-Deployment Verification82- [ ] Voice interaction loop STT → LLM → TTS working83- [ ] Dialog state transitions correct for each intent84- [ ] Multi-turn conversations maintaining context85- [ ] Intent detection accuracy ≥ 90% on test utterances86- [ ] Proactive actions triggering on schedule87- [ ] Escalation to human working88- [ ] Voice personality natural and consistent8990## Troubleshooting9192| Issue | Cause | Fix |93|-------|-------|-----|94| Dialog stuck in one state | Missing transition | Add transition in state config |95| Intent misclassified | Overlapping intents | Add more diverse training utterances |96| Context lost between turns | State not persisted | Check Cosmos DB write + read |97| Voice sounds robotic | Standard voice not neural | Switch to Custom Neural Voice |98| Agent doesn't initiate | Proactive trigger not configured | Add schedule/event trigger |99| Too many clarifications | Intent threshold too high | Lower confidence threshold from 0.9 to 0.8 |100101## Voice Interaction Loop102```1031. Listen (STT continuous recognition)1042. Detect intent + extract entities1053. Update dialog state machine1064. Generate response with context1075. Speak response (TTS with SSML)1086. Repeat until farewell or escalation109```110111---112> Source: [frootai/frootai](https://github.com/frootai/frootai) — distributed by [TomeVault](https://tomevault.io).113<!-- tomevault:4.0:skill_md:2026-06-16 -->