Build an Inbound IVR with AI Routing
Create a professional phone system where callers are greeted, routed to the right department using AI intent detection (no "press 1" needed), and handled by specialized AI agents.
What you'll build
Step 1: Create Specialized Agents
First, create an agent for each department. Go to Agents → New Agent for each:
Sales Agent
System Prompt
You are a sales agent for Acme Corp. Help callers understand our products, answer pricing questions, and book demo meetings. You have access to the knowledge base with our product catalog. Keep responses under 2 sentences. If someone asks about an existing order or a technical issue, tell them you'll transfer them to the right team and use the transfer_call tool.
Support Agent
System Prompt
You are a customer support agent for Acme Corp. Help callers with order tracking, product issues, and general questions. Look up information in the knowledge base before answering. If you cannot resolve the issue, schedule a callback with a human specialist. Be empathetic and patient.
Billing Agent
System Prompt
You are a billing agent for Acme Corp. Help callers with invoice questions, payment methods, subscription changes, and refund requests. For refunds over $100, tell the caller a supervisor will call them back and use schedule_callback. Never share full credit card numbers.
For each agent: enable relevant tools (Knowledge Search, Transfer Call, Schedule Callback, Send SMS), assign your product docs as knowledge base, pick a professional voice, and save.
Step 2: Create the Flow
Go to Flows → New Flow. Name it "Main IVR". Build this structure:
Add Nodes
Call Entry
Language: English (India). Max duration: 15 minutes.
Speak
"Hello, thank you for calling Acme Corp. How can I help you today?"
Listen
Store transcript in variable {{caller_intent}}. Timeout: 5 seconds.
AI Classify
Prompt: "Classify this into: sales, support, billing, or other. Input: {{caller_intent}}". Store result in {{department}}.
Condition
Branch on {{department}}: sales → Sales Agent, support → Support Agent, billing → Billing Agent, default → Support Agent.
Agent (Sales)
Select your Sales Agent. Exit: done → Send SMS node.
Agent (Support)
Select your Support Agent. Exit: done → Send SMS node.
Agent (Billing)
Select your Billing Agent. Exit: done → End Call.
Send SMS
"Thanks for calling Acme! If you need anything else, call us anytime or visit acme.com/help"
End Call
"Thank you for calling. Goodbye!"
Connect the nodes
Draw edges: Call Entry → Speak → Listen → AI Classify → Condition → (branch to each Agent) → Send SMS → End Call.
Step 3: Connect a Phone Number
Go to Channels → Add Channel:
- Select your telephony provider (Plivo, Twilio, or bring your own SIP trunk).
- Enter API credentials and click Verify.
- Select a phone number from the list.
- Important: Under "Assign to", select Flow: Main IVR (not a direct agent).
- Save.
Step 4: Test It
Before going live with real callers:
- Go to Playground → Flow tab → select "Main IVR".
- Click the microphone and say: "I have a question about my invoice".
- Watch the flow execute: Speak → Listen → Classify (should detect "billing") → Route to Billing Agent.
- Test each path: try "I want to buy your product" (sales), "my order hasn't arrived" (support).
Step 5: Go Live
Call the number from your phone. The full pipeline runs:
Caller dials in → "Hello, how can I help?"
Caller: "I need to change my payment method"
AI classifies → billing → routes to Billing Agent
Billing Agent handles the full conversation
Call ends → follow-up SMS sent → CRM updated
Step 6: Monitor in Live Space
Once calls are flowing, open Live Space:
- See every active call with the agent handling it
- Click a call to see the live transcript
- Use Whisper to send the AI a correction mid-call
- Check analytics: which department gets the most calls? Average duration? Sentiment?
