System-Directed AI | SignalWire

AI voice agents that answer to your code

Your code holds the authority. The platform owns the state. The model runs inside the call and never knows the rules exist.

redirect.py — live call, owned by the platform
@AgentBase.tool(name="refund")
def refund(self, amount: float, raw_data=None):
    """Issue a refund the caller asked for."""
    limit = raw_data["global_data"]["refund_limit"]  # the model never sees this
    if amount <= limit:
        return FunctionResult(f"Approved, ${amount:.2f} refunded.")
    return FunctionResult("Let me get a manager to approve that.")

Where AI runs decides what breaks

When the AI runs inside of the call instead of across five vendors, you get clean logs, real control, and low latency.

You build agent behavior. The platform handles the rest.

The platform handles state, timing, coordination, and infrastructure. You build AI agents and call flows without ever touching infrastructure complexity.

  1. Stateful Call Context
    The call's context, history, and transfer state live on one UUID and persist for the whole call, through every step and transfer.

  2. Tool Governance
    When the model requests a tool, your handler applies your rules and returns the result. The model can't act on anything your code didn't clear.

  3. Sub-second Latency
    Speech, model, and voice run in the media engine, not across separate vendors. Full turns land near 1.2s, 600ms with speech-to-speech.

  4. One Platform
    The call and the AI kernel run as one system. State, transfers, and tool calls happen in one place instead of syncing across vendors.

Voice AI performance is fundamentally an infrastructure problem

Architectural design decisions materially affect conversational responsiveness. No model quality advantage can fully compensate for a poorly orchestrated pipeline. This report benchmarks three leading Voice AI platforms by implementing the same Smart Appointment Assistant across each system, measuring conversational latency, tool call latency, and development complexity under identical conditions.

Conversational turn latency

Platform Average Latency
SignalWire 1.24s (avg of 5 configs)
Vapi 1.85s
LiveKit (baseline) 1.87s
Livekit (tuned) 1.75s

Everything you need to build smarter voice systems.

Inbound & outbound agents

Answer incoming calls or place them at scale. The same agent code handles both directions, so you write the behavior once.

AI-to-human handoff

Escalate to a live rep with the full call context intact. The agent transfers the transcript, state, and caller details, so no one starts over.

Real-time translation

Translate both sides of a live call as it happens. Each party hears their own language with sub-second turns, on one connection.

Call recording

This call is recorded. Audio and transcripts are used to improve our AI and customer support experience, and aren't shared or sold to third parties.

AI_Message - Python relay SDK

# pip install signalwire-sdk → python sigmond.py
# Sigmond: a voice AI that answers questions about SignalWire.
# His persona is a prompt. His knowledge is a tool he calls. Your code owns both.
from signalwire import AgentBase, FunctionResult
DOCS = {
    "swaig": "SWAIG is SignalWire's AI Gateway, the tool-calling system that lets the AI in.",
    "latency": "Conversational turns land around 1.2 seconds because the AI kernel runs inside the media engine.",
    "puc": "Programmable Unified Communications: the platform owns the call and your code programs it.",
}

class Sigmond(AgentBase):
    def __init__(self):
        super().__init__(name="sigmond", route="/sigmond")
        self.add_language(name="English", code="en-US", voice="inworld.Mark")
        self.prompt_add_section("Personality", body="You are Sigmond, a warm, concise voice guide to SignalWire.")
        self.prompt_add_section("Goal", body="Answer the caller's SignalWire questions accurately.")
        self.prompt_add_section("Rules", bullets=[
            "Call search_docs before you state a fact.",
            "If the docs do not cover it, say so. Never invent product details.",
        ])

@AgentBase.tool(name="search_docs")
def search_docs(self, query: str, raw_data=None):
    """Search SignalWire documentation to answer a caller's question."""
    for key, fact in DOCS.items():
        if key in query.lower():
            return FunctionResult(fact)

Frequently asked questions

What's the difference between SignalWire's voice AI and Vapi or Retell?

Vapi and Retell are orchestration layers on top of four other vendors — Twilio for telephony, Deepgram for STT, OpenAI for the LLM, ElevenLabs for TTS. Their per-minute fee is on top of the underlying vendor costs. SignalWire owns the media stack, the AI kernel, and the carrier relationships in one platform. One bill, one operator, one place to call when something breaks.

Why is SignalWire's latency lower?

The AI kernel runs inside the same media stack the call lives in. STT, LLM inference, and TTS execute in the substrate, not over external HTTP round trips.

What does System-directed AI actually prevent?

Hallucinated actions the backend cannot honor. Unauthorized state transitions. Tool calls outside the current step's scope. Model access to data it was never meant to see. The governance is structural — the model doesn't know other tools exist, doesn't see the data layer, and can't override decisions enforced in code.

Can I use my own LLM?

Yes. The AI kernel is model-agnostic. OpenAI, Claude, open-source models on dedicated infrastructure, and native speech-to-speech models all run through the same interfaces.

How does pricing work?

$0.16/min for the AI runtime, which includes speech-to-text, language model inference, text-to-speech, orchestration, state management, and governance. Transport (PSTN, SIP, WebRTC) is billed separately at carrier rates.

Build your first governed AI Voice Agent

The quickstart takes about 15 minutes. You will have a working agent on a real phone number before you close the tab.