Skip to main content

The same pattern everywhere

In every host, three things stay the same:
  1. Construct an entry point - DialogMachine(source, llm=...). It runs the Playbook engine by default; source accepts full playbooks, simple-format playbooks, and legacy flow JSON (auto-compiled), so you don’t pick a format, you just point it at your artifact.
  2. Route inbound text to agent.turn(text).
  3. Send the reply text back to the host’s output channel.
Both engines implement the same superdialog.agent.Agent protocol (turn / assist / chat_ctx / load_chat_ctx), so every adapter accepts either one. The host varies; the SuperDialog code is identical.
# This object works in every host below
from superdialog import DialogMachine

agent = DialogMachine("booking.yaml", llm="anthropic/claude-haiku-4-5")  # any format
Advanced: drop to PlaybookAgent when you need to supply the two LLM seams directly - a StreamsLLM Talker and a CompletesLLM Director - or a custom HTTP executor. Any superdialog.llm.LLMProvider (the litellm-backed one behind model URIs) adapts in a few lines:
from superdialog.llm import resolve_llm

class TextLLM:
    def __init__(self, provider): self._p = provider
    async def complete(self, messages, **kw):
        return (await self._p.complete(messages, **kw)).text
    async def stream(self, messages, **kw):
        async for chunk in self._p.stream(messages, **kw):
            if chunk.text:
                yield chunk.text

talker = TextLLM(resolve_llm("anthropic/claude-haiku-4-5"))   # fast: speaks
director = TextLLM(resolve_llm("anthropic/claude-opus-4-7"))  # strong: judges

Choose your host

CLI chatbot

Zero infrastructure. Best for testing and prompt tuning.

LiveKit

Voice agent via Agent(llm=DialogMachineLLM(...)) plugin.

PipeCat

Drop-in FrameProcessor for PipeCat pipelines.

FastAPI

REST endpoint for text chatbots and web widgets.

Unpod Voice

Plug your DialogMachine into an Unpod AgentRunner session - no extra server needed.

Unit testing

Because SuperDialog is text-only, every dialog is unit-testable.

Lines of code comparison

HostAdapterExtra LoC
CLINone - direct input()/print() or superdialog chat~5
LiveKitDialogMachineLLM~8
PipeCatmake_processor~12
FastAPIFastAPIRouter or direct route~6
Unpod Voice (SDK)unpod.AgentRunner + session.dialog_machine~6
Unit testNone - direct calls~3
Custom (Slack, Discord, etc.)None - direct callback~3