Lý thuyết
40 phút
Bài 6/15

Voice Assistants

Xây dựng voice assistants cho phone và voice interfaces

📞 Voice Assistants

Xây dựng voice assistants cho phone bots và voice interfaces.

Voice Assistant Use Cases

Phone-Based

Text
1- Customer support hotlines
2- Appointment scheduling
3- Order status inquiries
4- Surveys and feedback
5- Outbound calling
6- IVR replacement

Voice Interface

Text
1- Smart speakers
2- In-app voice
3- Hands-free devices
4- Accessibility features
5- Voice search

Phone Bot Platforms

Platform Comparison

Text
1┌─────────────┬────────────┬────────────┬───────────┐
2│ Platform │ Complexity │ Cost │ Best For │
3├─────────────┼────────────┼────────────┼───────────┤
4│ Bland.ai │ Low │ Per minute │ Quick MVP │
5│ Retell.ai │ Medium │ Per minute │ Custom │
6│ Vapi │ Medium │ Per minute │ Flexible │
7│ Twilio + AI │ High │ Components │ Full ctrl │
8└─────────────┴────────────┴────────────┴───────────┘

Bland.ai

Text
1All-in-one phone AI:
2✅ No coding required
3✅ Handles STT/TTS/Agent
4✅ Outbound & inbound
5✅ Easy setup
6
7Workflow:
81. Sign up
92. Define agent personality
103. Set up phone number
114. Configure conversation
125. Go live

Retell.ai

Text
1Customizable phone agents:
2✅ Custom voices
3✅ LLM integration
4✅ Real-time responses
5✅ Analytics
6
7Best for:
8- Custom experiences
9- Brand voice requirements
10- Complex conversations

Vapi

Text
1Developer-friendly:
2✅ API-first design
3✅ Flexible configuration
4✅ Multiple LLM options
5✅ Webhook integrations
6
7Best for:
8- Developers
9- Custom integrations
10- Complex logic

Building Phone Bot with Bland.ai

Step 1: Setup

Text
11. Create Bland.ai account
22. Get API key
33. Claim phone number
44. Configure in dashboard

Step 2: Define Agent

Text
1Agent configuration:
2{
3 "name": "Support Assistant",
4 "task": "Handle customer inquiries about orders",
5 "voice": "natural_female",
6 "model": "gpt-4o-mini",
7 "first_sentence": "Hi, thanks for calling! How can I help?",
8 "wait_for_greeting": false
9}

Step 3: Conversation Prompts

Text
1System prompt:
2"You are a customer support agent for ABC Store.
3
4Handle:
5- Order status inquiries
6- Return requests
7- General questions
8
9Rules:
10- Be friendly and concise
11- Ask for order number to check status
12- Transfer to human for complaints
13- Never give refunds directly"

Step 4: Tools/Actions

Text
1Define what agent can do:
2
3{
4 "tools": [
5 {
6 "name": "check_order",
7 "description": "Check order status",
8 "parameters": {
9 "order_number": "string"
10 },
11 "webhook": "https://api.store.com/orders"
12 },
13 {
14 "name": "transfer_to_human",
15 "description": "Transfer to human agent"
16 }
17 ]
18}

Step 5: Test & Deploy

Text
1Testing:
21. Use test call feature
32. Check conversation flow
43. Verify tool calls
54. Test edge cases
6
7Deploy:
8- Assign phone number
9- Configure business hours
10- Set up voicemail
11- Enable call recording

Building with Retell.ai

Setup Flow

Text
11. Create account
22. Create agent
33. Configure:
4 - Voice selection
5 - LLM settings
6 - Prompts
7 - Functions
84. Get phone number
95. Test and deploy

Agent Configuration

Text
1{
2 "llm_websocket_url": "wss://api.retellai.com/llm",
3 "voice_id": "11labs-Rachel",
4 "agent_name": "Support Agent",
5 "response_engine": {
6 "type": "retell-llm",
7 "llm_id": "your_llm_id"
8 },
9 "boosted_keywords": ["order", "refund", "tracking"],
10 "ambient_sound": "coffee-shop"
11}

Custom Functions

Text
1When agent needs to take action:
2
3{
4 "name": "schedule_appointment",
5 "description": "Schedule appointment for customer",
6 "parameters": {
7 "date": {"type": "string"},
8 "time": {"type": "string"},
9 "service": {"type": "string"}
10 }
11}
12
13Agent says:
14"Let me schedule that for you..."
15Triggers webhook → Book in calendar
16"Done! You're booked for Tuesday at 2pm."

Conversation Design

Opening

Text
1Good opening:
2"Thanks for calling ABC Company!
3I'm your AI assistant.
4How can I help you today?"
5
6Elements:
7- Company name
8- Set expectations (AI)
9- Open-ended question

Main Flow

Text
1Structure:
21. Understand request
32. Gather needed info
43. Take action or provide info
54. Confirm completion
65. Ask if anything else
7
8Example:
9User: "I want to check my order"
10Agent: "I'd be happy to help!
11 What's your order number?"
12User: "12345"
13Agent: [checks API]
14 "Your order #12345 shipped yesterday.
15 Tracking number is ABC123.
16 Is there anything else?"

Closing

Text
1Good closing:
2"Thanks for calling ABC Company!
3Have a great day!"
4
5Include:
6- Thank user
7- Summarize if needed
8- Friendly goodbye

Voice-Specific Considerations

Pacing

Voice Pacing
Text
1Optimize for listening:
2- Short sentences
3- Natural pauses
4- Clear pronunciation
5- Moderate speed
6
7Avoid:
8- Long paragraphs
9- Complex sentences
10- Too much info at once

Confirmation

Text
1Always confirm critical info:
2
3"Just to make sure I have this right,
4your order number is 1-2-3-4-5?"
5
6"You want to reschedule to Tuesday at 2pm,
7is that correct?"

Barge-In

Text
1Allow users to interrupt:
2- User speaks over agent
3- Agent stops and listens
4- More natural conversation
5
6Configure in platform settings

Handling Difficult Calls

Caller Frustration

Text
1Detect frustration:
2- Raised voice
3- Negative words
4- Repeated requests
5
6Response:
7"I understand this is frustrating.
8Let me transfer you to someone
9who can help immediately."

No Response

Text
1Handle silence:
2After 5 seconds:
3"Are you still there?"
4
5After 10 seconds:
6"I haven't heard from you.
7Please say something or
8I'll need to end the call."

Background Noise

Text
1Can't understand:
2"I'm having trouble hearing you.
3Could you move somewhere quieter?
4Or I can send information via text."

Integration with Workflows

Make/Zapier Integration

Text
1Webhook when call ends:
2
3{
4 "call_id": "123",
5 "duration": 180,
6 "status": "completed",
7 "transcript": "...",
8 "call_summary": "Customer checked order status",
9 "actions_taken": ["check_order"],
10 "sentiment": "positive"
11}
12
13Workflows:
14- Log to CRM
15- Send follow-up email
16- Create ticket if needed
17- Update database

Real-Time Actions

Text
1During call, agent can:
2- Query databases
3- Update records
4- Send SMS
5- Create tickets
6- Book appointments
7
8Via webhook integrations

Analytics

Track Metrics

Text
1Key metrics:
2- Call volume
3- Average duration
4- Resolution rate
5- Transfer rate
6- Sentiment score
7- Top intents

Improvement Cycle

Text
11. Review call transcripts
22. Identify failures
33. Update prompts/flows
44. Monitor improvement
55. Repeat

Cost Optimization

Manage Costs
Text
1Voice AI costs:
2- Per minute charges
3- Phone number fees
4- API calls
5
6Optimize:
7- Keep calls concise
8- Route appropriately
9- Use IVR for simple tasks
10- Set call limits

Testing Checklist

Test Your Phone Bot
Text
1☐ Clear greeting
2☐ Correct understanding
3☐ Tool/action calls work
4☐ Handles "I don't know"
5☐ Transfer works
6☐ Graceful silence handling
7☐ Natural conversation flow
8☐ Correct closing
9☐ Webhook integrations
10☐ Analytics tracking

Bài Tập

Practice

Build Phone Support Bot:

  1. Sign up for Bland.ai or similar
  2. Create customer support agent
  3. Configure prompts & personality
  4. Add order lookup tool
  5. Set up human handoff
  6. Test with real calls
  7. Review transcripts

Tiếp theo: Bài 7 - Multi-Channel Agents