How livekit-examples/outbound-caller-python works
This is a compact LiveKit Python example for placing an AI-driven outbound appointment call. A dispatch supplies the phone and transfer numbers; the worker connects a room, starts the voice session, and dials through SIP. The agent handles appointment conversation, availability and confirmation tools, voicemail, call ending, and confirmed human transfer. The source is concentrated in agent.py; the README documents model alternatives and capabilities, while the sampled implementation uses placeholder appointment and availability data rather than a scheduling store.
Main entry points: agent.py Outbound caller
Components 16
Outbound call flow
- LiveKit worker
agent.py - Call entrypoint
agent.py - LiveKit room
Voice agent
- Agent session
agent.py - Outbound caller
agent.py
Call actions
- Availability lookup
agent.py - Appointment confirmation
agent.py - Voicemail detection
agent.py - End call
agent.py - Human transfer
agent.py
External services
- SIP dialer
- Speech and language models
- Noise cancellation
Other components
- Dispatch requester
- Patient
- Human operator
Connections 22
- Dispatch requester → LiveKit worker: dispatches job
- LiveKit worker → Call entrypoint: runs
- Call entrypoint → LiveKit room: connects
- Call entrypoint → Outbound caller: creates
- Call entrypoint → Agent session: starts
- Call entrypoint → SIP dialer: requests outbound call
- SIP dialer → Patient: calls
- Agent session → LiveKit room: joins
- Agent session → Outbound caller: runs agent
- Agent session → Speech and language models: uses STT, LLM, TTS
- Agent session → Noise cancellation: uses
- Patient → Agent session: provides voice
- Outbound caller → Availability lookup: invokes
- Outbound caller → Appointment confirmation: invokes
- Outbound caller → Voicemail detection: invokes
- Outbound caller → End call: invokes
- Outbound caller → Human transfer: invokes
- Human transfer → SIP dialer: requests SIP transfer
- SIP dialer → Human operator: transfers call
- Voicemail detection → LiveKit room: deletes room
- End call → LiveKit room: deletes room
- Human transfer → LiveKit room: deletes on failure