CookbooksMYLO Cookbooks
Build an Inbound IVR Menu
Map a phone number to a MYLO agent and route inbound callers with tool-driven menus.
- Bind a phone number to an
agent_idfor inbound calls - Route billing, support, and hours intents with function tools
- Fall back to a human agent when confidence is low Time to complete: ~25 minutes
Prerequisites
SAGEA_API_KEYexported in your shell asBearerauth- Python 3.10+ with
requestsinstalled - A SAGEA phone number you can assign to an agent
- Complete Send your first API request
- Read the MYLO overview import from '@/components/Tabs';
Step 1: Map your phone number to an agent
Point your inbound number at the IVR agent so MYLO answers every call.
In production bind the number to ivr_main so inbound audio uses this session.
Step 2: Add menu routing tools
Give the agent tools for bookings, orders, and human transfer.
Keep tool names short and spoken-friendly for reliable mid-call invocation.
Step 3: Add human fallback and close out
Transfer on request or low confidence, then fetch transcript and delete.
Log every transfer_to_human call with reason so staffing matches demand.
Verify
| Error | Cause | Fix |
|---|---|---|
401 Unauthorized | Missing or invalid API key | Export valid SAGEA_API_KEY and retry |
404 session_not_found | Session expired before transfer | Create fresh session, shorten test loop |
429 rate_limit_exceeded | Too many test sessions | Pace inbound tests, reuse session if possible |
422 voice_not_found | Bad voice on agent config | Use nova or atlas, check settings |
