
Subscribe
Tags
Voice AI
AI Agents
PGI Realtime (model ID pgi-realtime-1) is a real-time speech-to-speech model built for natural conversation. It listens, knows when to respond, and handles interruptions mid-sentence. It also follows a developer's program and mounts the speech and language models that fit the job. It comes connected to phone numbers, SIP, browsers, mobile apps and messaging, and the same agent chats by text under the same program. No separate communications provider is required.
Natural conversation. Total control. Built-in communications.
One call on Northwind's billing line
Dana calls Northwind Energy, a made-up regional utility, about a $200 charge on the bill. Northwind's billing line runs on PGI Realtime. Rosa, the company's one AI engineer, described the line to a coding agent, and the coding agent wrote it in one file.
The call sounds like a conversation. Dana starts reading the account number, stops to check the bill, and finishes it; the agent waits instead of jumping in. Dana interrupts with a question halfway through the agent's answer, and the agent stops and answers it.
Then comes the part a voice model alone cannot handle. The model asks to file the dispute, and Rosa's code decides. Northwind reverses charges up to $50 on the spot. This one is $200, so the code sends it to a specialist, and the model tells Dana in its own words. The model never saw the $50 limit, and no tool it could reach would reverse a $200 charge.
The same agent answers Northwind's phone number, the call button on its website and its mobile app, with no separate phone provider behind it. Customers who would rather type reach the same agent, with the same rules, in the website's chat window, by text message or on WhatsApp. SignalWire's short form of the idea: "The model talks. Your code decides."
What PGI Realtime brings to every call
PGI Realtime is sold on four things, in this order:
Natural, responsive conversation. Barge-in, end-of-turn detection and turn-taking happen at the audio, and the developer can tune them for the job.
Programmatic control. A program decides what the model sees, which actions exist, and what happens when the model asks for one.
Model freedom. The best speech and language models mount by configuration, and the program stays the same when they change.
Built-in communications. Phone numbers, SIP, WebRTC, browsers, mobile apps and messaging are part of the model, and one agent answers by voice or by text.
How PGI Realtime divides the work
Researchers use the term cognitive architecture for the structure around a language model: its memory, its possible actions, and the process that chooses between them. The term comes from a 2023 paper by Princeton researchers, "Cognitive Architectures for Language Agents". PGI Realtime uses it in that technical sense. It describes how the parts divide the work, and makes no claim that the system thinks.
PGI Realtime has three layers.
Reflexes, in the audio. Interruptions, the end of a caller's turn and turn-taking are detected in the media path, before any model is involved. The arrangement mirrors a spinal reflex, which pulls a hand off a hot stove before the brain registers the heat. Because PGI Realtime lives inside the call, the decision to stop talking never waits on a network round trip.
Intuition, from the models it mounts. Understanding and speaking come from the best speech and language models available. PGI Realtime mounts them and swaps them by configuration as better ones arrive. The layers around them stay the same, so PGI Realtime improves every time the models it can mount improve.
Rules, from the program. The developer's program decides what the model sees at each step and which tools exist for it. It keeps some data out of the model's view entirely, and it decides what happens when the model asks for an action. SignalWire calls this discipline System-Directed AI. Its engineering name, Programmatically Governed Inference, is where the PGI in PGI Realtime comes from.
Some of today's best-known AI systems put a router in front of several models, and the router chooses which model answers. PGI Realtime's rules govern what any answer is allowed to do. The model can say anything. It can only do what the program allows.
What a program looks like
A voice model is usually prompted with a paragraph. The paragraph describes the role, lists the rules, and hopes the model reads them the same way every turn. PGI Realtime is prompted with a program. The program is SignalWire Markup Language (SWML), SignalWire's call document in JSON or YAML. Developers write it directly, or generate it from code with SignalWire's SDKs, which share the same concepts and names across ten languages.
The Python below is the start of Northwind's billing line, taken from a working agent. Each step lists the one tool the model may use there. An empty valid_steps list means the model has no way to move on by itself.
The dispute tool is an ordinary Python function. The model asks for it, and the handler reads the account record and decides.
Read as a prompt, those lines say far more than a paragraph could:
Steps decide what the model sees. During
verify_identity, the model has one tool and no way to leave. Only theverify_accounthandler moves the call toreview_charges, after the account checks out.Scoped tools decide what the model can ask for.
file_disputedoes not exist for the model until the caller is verified. The tool is absent, which is stronger than forbidden.Hidden data stays hidden. The account record rides in
global_data, which every handler receives and the model never sees unless the program surfaces it.Handlers decide what happens. A handler's result reaches the model as new context: the facts it asked for, plus instructions. The model composes its own reply from that context. The same result can also act on the call, by changing the step, transferring the call or taking a payment.
One test sums up the design. Replace the language model with a keypad menu, and every verification, reversal and transfer comes out the same, because code made each of those decisions. The call gets less pleasant. The outcomes do not change.
The program arrives with every call
PGI Realtime is not configured once and left running. Its program is fetched when each call starts, from the developer's own server or from a script stored on the platform. The SDK renders the program fresh for every request, so each caller, customer or moment can get a program written for it.
One deployment can serve many businesses this way. In the example below, one agent answers for both of Northwind's brands, and each call gets its own company name and its own refund limit.
The callback configures a copy of the agent made for that one request, so one call's changes never reach another. The program arrives the same way on every channel, for calls coming in and calls going out.
Natural conversation
Callers get talked over, or cut off mid-thought
A voice agent that keeps talking after a caller interrupts sounds broken. One that jumps in at every pause sounds rude. Both come from turn-taking decided too far from the audio.
On PGI Realtime, barge-in, end-of-turn detection and turn-taking are reflexes in the media path. The call, the session and the live audio stay on one platform, so there is no network hop between the AI and the audio. Fusion turn detection combines the transcript so far with an acoustic read of the caller's voice. It waits longer where a caller is likely to keep going. When a caller reads out digits, it hears them and waits for the rest. Cutting someone off is worse than a slightly longer pause.
The platform also knows what the caller actually heard. When a caller cuts the agent off, the model keeps only the words that played, so it never builds on a sentence the caller missed. A bare "mm-hm" or "okay" said over the agent's speech does not interrupt it. Long pauses inside the agent's own speech are capped, so a caller does not take one for the end of its turn. On a loud line where no words come through, the agent tells the caller the line sounds noisy and asks them to make it quieter.
The program can also tell PGI Realtime what to expect. A gather step asks one question at a time, and the platform can say each question word for word. It tells the speech recognizer how many digits an account number has, so the recognizer stops waiting once the caller has said them. It can also mark an amount as a number. Answers marked for confirmation are read back before they are stored.
The model never sees the form as a whole, only the current question, so it cannot skip ahead or reorder it. The developer can still tune barge-in and timing per agent where a line needs a different posture; a collections line and a trivia game want different settings.
Latency is measured the way a caller feels it: from the moment the caller stops talking to the moment the agent starts, on stereo recordings. SignalWire publishes the tool it uses, signalwire/latency_checker, as open source, so anyone can run the same measurement on any stack.
Silence while the agent looks something up
Dead air makes callers think the line dropped. Each PGI Realtime tool can carry filler phrases or a hold sound that play while it runs. Step changes get their own filler phrases, so moving from verification to billing never leaves a gap.
Some lookups need no server of the developer's at all. A DataMap tool describes one REST call and how to read its answer, and SignalWire's servers make the call directly. The request skips the hop through the developer's server, and there is one less service to deploy.
The agent mishears names, or says the brand wrong
Speech recognition stumbles on the words that matter most to a business: product names, street names and account numbers. A PGI Realtime program tells the recognizer which words to expect with hints, and corrects common mishearings with pattern rules. Hints can change mid-call, so a step that collects addresses can prime the recognizer for street names. A handler can also read the recognizer's own words with a confidence score for each, and ask again about the one it was unsure of.
Callers can press keys or speak, and the media stack accepts both at once. For anything that must be exact, a gather question tells the model what kind of answer to expect and can require confirmation. The model then reads the answer back and records the caller's yes before the answer is stored.
The voice is the business's choice. PGI Realtime speaks with a voice from the providers it mounts, a different one per language if needed. Pronunciation rules make it say a brand name the way the business says it. Each voice can name backups. If a voice fails during a call, the next one in its list takes over instead of leaving the caller in silence.
Callers switch languages mid-call
A caller who starts in English and switches to Spanish should not have to start over. In multilingual mode, PGI Realtime answers in whatever language the caller actually spoke, without the model having to choose. Each language carries its own voice, and different parts of a call can use different personas.
Programmatic control
The agent promises things the business cannot deliver
One of the costliest voice AI failures is a confident promise: a refund nobody approved, or a fee waived because a caller pushed. A prompt can only ask the model not to make one. A Hacker News commenter described that limit in September 2026:
All instructions to LLMs are merely suggestions to nudge it in the right behaviour.
On PGI Realtime, every consequential action belongs to a handler. The model asks, the handler checks the real records and decides, and the model reports what the code already did. Business limits such as Northwind's $50 auto-reversal live in hidden data the model never sees. The model can still phrase something badly. It cannot turn a wrong sentence into a refund.
Handlers also keep the model honest about outcomes. When a handler fails before it finishes, the model is told the outcome is unknown, so it never tells the caller a refund went through. A handler that turns a request down on purpose tells the model what is true now and what to offer instead.
The agent calls the wrong tool
Tool selection is where many agents break. One builder on Hacker News described a support agent that kept calling a refund tool when customers only wanted their order status:
the tool worked perfectly, the LLM just kept picking the wrong one.
PGI Realtime shows the model only the tools the current step allows. At the greeting, a refund tool does not exist, so the model cannot pick it by mistake. Fewer choices also mean better choices. Selection accuracy drops once more than about seven or eight tools are active at once, and scoped steps keep each turn well below that.
If the model asks for a tool the step does not offer, nothing runs. The result tells the model which steps offer that tool and which tools it has now, so it can correct course. A tool can also require the model to vouch that the caller supplied its details; without that, the handler does not run.
Callers try to talk the agent into things
Some callers push, plead or try to slip in new instructions. A guardrail tries to catch each attempt; PGI Realtime removes the target instead. Tools outside the current step do not exist for the model. A step with no exits gives it no way to move, and hidden data never entered its context. The platform checks each step change the model requests, so the model cannot reach a step the current one does not offer.
A caller cannot talk the model into a tool it cannot see, or out of a step it has no way to leave. The model does not even know it is governed. From inside, its world is the size the program made it.
The caller asked about cancelling, and the agent cancelled
Some mistakes are about meaning. A caller asks what it would cost to cancel. The model hears "cancel" and calls the cancel tool. The step allowed the tool, and the handler can confirm the account exists, but neither can tell whether the caller actually asked to cancel.
A semantic gate closes that gap. It is a yes or no question attached to a tool. Right before the platform runs the tool, a separate decision model answers the question. It reads the recent conversation, the application's own record of the call, and the exact arguments. If the answer clears the threshold, the tool runs. If not, nothing is dispatched, and the model receives the developer's fallback as an ordinary tool result.
On Northwind's line, a gate confirms the caller agreed to the amount before any dispute is filed:
The model never sees the gate or its score. A check that cannot finish blocks the tool, and every check lands in the call record with its outcome and score. On a video call, a gate can also look at the caller's newest frames. It can check, for example, that a photo ID is held up to the camera.
A gate can also answer "unclear" when the conversation does not settle the question, such as a "yes" that might answer something else. The tool does not run, and the agent asks again plainly. Gates read what the caller actually heard, so a "yes" that interrupts a read-back is judged against the part that played.
For confirmations, the SDK's Proposal pattern packages the whole exchange. It records the change and has the agent say the read-back word for word. The confirming tool then runs only after three checks: the caller answered, the answer was a yes, and the agent read this change back first.
Card numbers and private data end up in the transcript
A voice agent that reads a card number back "for confirmation" has put it in the transcript, the logs and possibly the recording. On PGI Realtime, card collection runs through SWML's pay method, which is PCI compliant. The caller enters the card on the keypad, the digits go to the payment connector, and the model never hears them.
The handler stops the recording before collection starts, and the model learns only the outcome. Other sensitive values, such as account records and risk flags, ride in hidden data that handlers read and the model never sees.
Required disclosures get skipped
Some calls must open with a disclosure or a consent question, every time. A prompt can only ask the model to remember. On PGI Realtime, the disclosure lives in a step whose only exit is a handler that records the caller's answer. The next step does not open until that handler moves the call, and the same handler can start the recording. Handlers write every consequential fact, so what was disclosed and what the caller agreed to can go into the business's own records after the call.
The platform can speak the consent question word for word, as a gather question, so the model cannot shorten or reword it. A reply can also be set to play in full, with the caller's words held until it ends.
Model freedom
A better model ships next month
Voice AI models improve every few months, and an agent built around one model has to be rebuilt to move. On PGI Realtime, the speech, language and voice models are mounted by configuration, local or remote. The program, the tools, the hidden data and the call stay exactly as they were when a model changes. Choose the intelligence; keep control of the application.
Mounting is also a safety net. When the mounted model returns unusable output on a turn, that turn goes once to a rescue model, and the next turn returns to the original. A request that hits a rate limit or stalls moves to another provider of the same model during the call.
The team already runs its own AI
Some teams have already built their own voice AI and want the network without rebuilding. They can connect that AI to SignalWire over a WebSocket and keep SignalWire's phone numbers, SIP and call control, while SignalWire handles the protocol translation. Later, the same numbers can point to a PGI Realtime agent instead.
Built-in communications
Handoffs make callers repeat everything
Being transferred to a person and asked to start over is one of the most familiar complaints about phone support. On PGI Realtime, the call is one object that keeps its state, so what the agent learned travels with the call.
A handler can hold the caller, dial a specialist, and run a short briefing program on the specialist's line before the two are connected:
Transfers can also be temporary. When a transfer is not final, the caller returns to the agent if the transfer fails or the specialist hangs up, and the conversation continues. Transfers, conferences, queues, recording and keypad payments work the same on every number.
A person needs to join the call, or work beside the agent
Some calls need a person in the conversation as well as the agent. A handler can bring the caller and a specialist into a conference. PGI Realtime also runs as a live copilot. It listens to both sides of a call between a customer and a human agent, and sends advice to the agent's screen through the business's app. It can call tools as the call goes. Conventional agent-assist only suggests; a copilot can act, inside the same rules as an autonomous agent.
One live call can also reach into another. A handler on one call can send guidance into the AI conversation on another live call.
The business needs to steer a call already in progress
Plans change during calls. A fraud flag trips, an order ships, or a supervisor wants in. Any system the business runs can act on a live call by its ID. Over RELAY, SignalWire's real-time WebSocket for call control, code can add instructions to the agent's conversation, transfer on an outside event, hold, record or bridge. The REST API can act on a call in progress too, one request at a time.
Voice alone is not enough
Some answers are better on a screen. A handler can push an event to the app attached to the call while the model keeps talking. When a call comes from Northwind's website, the page the caller is looking at can update as the charge is reversed:
The same agent can take video calls. SignalWire's address widget goes on a page with one script tag. It lets a website visitor move between voice, video and chat mid-conversation without losing context.
Customers arrive on every channel
Customers call a phone number, dial in over SIP from a business phone system, or click a website button. Others open a mobile app or call a WhatsApp business line. PGI Realtime answers all of them with the same program, because the platform turns every protocol into one model of the call. Developers can build mobile apps on it with SignalWire's SDK, and customers who write instead of call reach the same agent by text.
Some customers would rather type
Not every customer wants to talk. The agent built for voice also holds text conversations, so there is no second agent to build or keep in sync. One program runs both. The steps, the scoped tools, the hidden data and the semantic gates apply to a chat exactly as they do to a call. Tool calls reach the same handlers, and a summary of each chat arrives at the developer's endpoint, as it does for calls.
AI chat, the text side of the agent, works over plain HTTP: each message is one request, and the agent's reply comes back in the response. That makes it protocol-agnostic. The same agent can sit behind a website chat widget, SMS, RCS, WhatsApp, email or a command-line tool. On a website, a small gateway on the business's own server keeps the API token out of the page. A conversation that starts in text can move onto a phone call and back without the customer repeating anything. The call's agent starts with the chat so far.
Some calls go out
Reminders, follow-ups and callbacks start with the business dialing. The developer places a call through the API, and when it connects, it fetches the agent's program like any inbound call. Before the agent speaks, the media stack can tell a person from an answering machine or a fax. The program then leaves a message or starts the conversation.
Running it like software
A paragraph prompt cannot be tested
Every change to a prompt-governed agent is a gamble, because nobody can unit test a paragraph. A PGI Realtime agent is code, so it gets code's tools. The SDK's call simulator runs a whole call through the agent with no platform, no model and no phone. It follows the steps, answers the gates and runs the handlers, as a live call would. Before Northwind's line took a single call, Rosa's coding agent ran Dana's call through it:
The dispute asked for too early never runs, because the step does not offer it. The simulator returns the result the model would get on a live call:
The simulator can also show exactly what the model and each gate would see at any point in the call. When the SDK renders the program, it warns about design mistakes, such as a tool that no step offers. swaig-test runs any single tool with any arguments and prints the full SWML the agent would serve, including every step's tool list. The programs two customers would receive can be compared before either goes live, and all of it runs in continuous integration like any other test.
Nobody can say what happened on a bad call
Fixing a bad call starts with knowing what happened on it, turn by turn. PGI Realtime runs the whole call in one session, so one record covers it, from the phone network to the last tool call. After every call, SignalWire posts an end-of-call report to a URL the developer controls. SignalWire's documentation describes it as "the full record of the call: the conversation, the tool calls, the timings, and the token counts."
The report lands in the developer's own systems, to keep and query. A post-call prompt can also turn each conversation into structured fields, such as the outcome and the reason for the call. While a call runs, a live debug feed can stream step changes, tool calls and interruptions. Each semantic gate's decision and score is on the record too.
The record also shows what the caller actually heard of each reply they cut off. Every tool request names the step, the turn, the language and the model it came from, so the developer's own logs line up with the call.
The agent forgets what the caller already said
An agent that asks for an account number twice loses the caller's trust. On PGI Realtime, facts the code establishes live in the call's hidden data, which travels across every step and every handler. A step's instructions can surface one fact by name, such as ${global_data.account.first_name}, so the model confirms instead of asking again. Transfers carry the call's state with them, so nothing has to be rebuilt from event logs. A step can also choose how much earlier conversation the model keeps. A confirmation step can see only its own exchange, and a later step can keep everything said while dropping finished tool results.
The agent needs to know the business
An agent is only as useful as what it can look up. PGI Realtime agents add capabilities in one line with skills: search over the company's own documents, web search, maps, date and time, pattern-matched transfers and more. Document search can ship as a single index file next to the agent, so it works on serverless hosting too. An agent can also connect to MCP servers, and their tools become tools the model can call.
For common shapes, ready-made agents cover a front desk, a personal assistant, an intake form and a survey. The front desk puts callers through to departments, and the personal assistant screens calls for one person. A knowledge add-on answers from the business's own search. Each one is an ordinary agent class, so steps, scoped tools and hidden data still apply on top.
Agents can also be written as the changes they make for a caller. Each operation declares its fields and returns a change for the caller to confirm. The SDK generates the tools, the steps, the confirmation gate and the call's record. Ready-made packs cover appointments, messages and card payments, where the model never hears the card.
The demo works, and production breaks
Voice AI demos in a day. Production is where the edge cases live: real accents, real noise and real load. PGI Realtime keeps the code the same from the first test call to full production. Agents are stateless web services, so any copy can serve any call, behind a load balancer or on serverless hosting, with no changes. Each tool request carries a per-call security token, and production deployments can require signed requests from the platform. Each request also carries the model's own call ID. When the platform resends a request after a network failure, the SDK answers with the first result instead of running the tool twice.
Under the agent is carrier-grade infrastructure built by the team that created FreeSWITCH. One platform carries the phone network, the audio, the AI and every transfer. That means one set of logs, and one place to look when something goes wrong.
Costs climb with every turn
A long prompt is sent to the model on every turn, so each of its sentences is paid for again and again. PGI Realtime's steps carry only the current task, and earlier steps' instructions drop away by default, so each turn sends far less. Agents whose steps are simple can run on smaller, faster language models. Arithmetic, lookups and policy checks run in the developer's code, where they cost no tokens at all. Speech, language, voice and the call itself come together on one platform and one bill.
Built for coding agents
Programs are what coding agents write best, and a program can be tested in ways a paragraph cannot. PGI Realtime is built for the way voice software now gets made. A coding agent writes the whole voice agent in one file, tests it before anyone dials, and reads the record of every call.
The tooling meets coding agents where they work. Every page of SignalWire's documentation is available as clean Markdown, indexed at signalwire.com/docs/llms.txt. The SignalWire plugin for Claude Code, and the SignalWire MCP server for any MCP-capable coding agent, connect the agent to the platform. The sw command line answers in JSON and can place a test call.
What sets PGI Realtime apart is what the coding agent writes: the model's own program, tested and read like any other code. The engineer keeps the rules and the judgment about what changes next. SignalWire's line for it: "Your coding agent writes it. You engineer it. You own it."
Where the guarantees stop
PGI Realtime makes specific guarantees, and they hold because the platform enforces them:
The model cannot request a tool outside the current step.
The model cannot move to a step the current step does not offer.
Handlers decide every consequential action.
Hidden data never enters the model's context unless the program surfaces it.
A semantic gate that cannot finish its check blocks the tool.
It does not guarantee every sentence. The model can still say something wrong; it cannot turn that sentence into an action the program did not allow. A step's completion criteria steer when the model moves on, but they are guidance, so anything that must be true belongs in a handler. The navigation limits bind the model and leave the developer free: a handler can move the call to any step, by design. Semantic gates need a platform release that supports them.
Getting started
The Python SDK (Python 3.10 or later) installs with pip install signalwire-sdk, and the TypeScript SDK with npm install @signalwire/sdk. Coding agents can start from signalwire.com/docs/llms.txt.
In Claude Code, the SignalWire plugin installs with /plugin marketplace add signalwire/signalwire-claude, then /plugin install signalwire@signalwire. An agent like Northwind's billing line fits in one file, and the call simulator and swaig-test check it before the first call.
PGI Realtime. The Voice Model That Comes Connected. Develop. Deploy. Disrupt!
Related Resources






