How it works
Theunpod SDK connects your AgentRunner to Unpod’s voice platform over WebSocket. Unpod handles STT, TTS, telephony, numbers, and recording - your code handles dialog logic using a SuperDialog DialogMachine or LLMAgent.
Step 1 - Build your dialog machine
Step 2 - Plug the machine into your session
Assigndialog_machine to ctx.session.dialog_machine inside your AgentRunner entrypoint. The SDK auto-wraps it - no adapter import needed.
Step 3 - Register a Speech Pipe (once)
A Speech Pipe is the voice front-end calls arrive on. Create one, attach a number, and give it the sameagent_id your AgentRunner uses - a mismatch
is the most common first-run failure.
Complete example
The long-lived runner process. Pipe and number are provisioned once beforehandUsing pre-call data in the flow
Data passed when triggering an outbound call (or injected by the platform) is available onctx.data:
Mid-call context injection
Inject system instructions at any point during an active call from your own business logic:Switching flows mid-call (graph engine)
switch_flow is a graph-engine feature - construct the machine with a
FlowSet and engine="flow":
On the Playbook engine (the default), model the same behaviour with multiple
journeys and interrupts inside a single playbook instead of swapping flows.
See Playbooks.vs. LiveKit / PipeCat adapters
Next Steps
AgentRunner & Sessions
Constructor, credentials, lifecycle, and live-call controls -
say(), transfer(), recording.
Playbooks
Author the simple and full playbook formats.
SuperDialog Tools
Add HTTP, Python, and MCP tools to your agent.