Skip to main content

How it works

The unpod 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.
Animated SuperDialog and Unpod voice integration diagram showing caller speech through STT, user-turn hooks, DialogMachine.turn, agent-turn hooks, TTS, and caller playback.
Your dialog machine runs inside your process, in the same call as the rest of your agent logic. No separate WebSocket server needed.

Step 1 - Build your dialog machine

See SuperDialog Quickstart to generate and save a playbook.

Step 2 - Plug the machine into your session

Assign dialog_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 same agent_id your AgentRunner uses - a mismatch is the most common first-run failure.
Full script, env vars, and voice-profile lookup: Provisioning checklist.

Complete example

The long-lived runner process. Pipe and number are provisioned once beforehand

Using pre-call data in the flow

Data passed when triggering an outbound call (or injected by the platform) is available on ctx.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.