bestmultiagent

Published 2026-11-19

Multi-agent frameworks with voice and realtime agent support

SHORT ANSWER

The OpenAI Agents SDK, Pydantic AI and Mastra all document voice support. The OpenAI SDK offers realtime voice agents with gpt-realtime-2.1 and voice pipelines that combine speech-to-text, an agent workflow and text-to-speech. Pydantic AI runs one agent definition as realtime speech on OpenAI Realtime, Gemini Live, Azure and xAI Grok Voice. Mastra's Voice system provides text-to-speech, speech-to-text and speech-to-speech for agents.

What voice support does the OpenAI Agents SDK document?

The Python SDK documents two paths for speech. Realtime agents let you build voice agents with gpt-realtime-2.1 and automatic interruption detection. Voice pipelines combine speech-to-text, an agent workflow and text-to-speech.

Python realtime agents are server-side and run on the OpenAI Realtime API over WebSocket transport. The quickstart states that the Python SDK does not provide a browser WebRTC transport. The TypeScript SDK lists browser-first WebRTC setup with ephemeral client tokens, plus server-side WebSocket and SIP options.

For new realtime code, the quickstart says to prefer the nested audio settings and start with gpt-realtime-2.1. Its example config sets gpt-4o-mini-transcribe for transcription and semantic_vad turn detection with interrupt_response on.

The pipeline path needs the optional voice dependencies, installed with pip install 'openai-agents[voice]'. A VoicePipeline takes care of transcribing input audio, detecting when the audio ends, calling your workflow and turning its output back into audio. Pass AudioInput for complete audio, or use StreamedAudioInput to push audio chunks when the pipeline must detect that a user is done speaking. You configure the default OpenAI speech models by passing STTModelSettings and TTSModelSettings through VoicePipelineConfig.

How do handoffs work in an OpenAI voice session?

Handoffs are represented as tools to the model, so a handoff to an agent named Refund Agent appears as a tool called transfer_to_refund_agent. Once a handoff runs, the receiving agent sees the entire previous conversation unless you set an input_filter.

Its main agent is told to hand off to the Spanish agent when the user speaks Spanish, and the example uses SingleAgentVoiceWorkflow as the workflow around that agent.

In realtime sessions, realtime handoffs let one agent transfer the live conversation. On a RealtimeAgent, handoffs, hooks and output guardrails still work alongside instructions and function tools, but model choice is configured at the session level, not per agent. The guide adds that voice can be configured, but it cannot change after the session has already produced spoken audio. The TypeScript docs list multi-agent orchestration through realtime handoffs as well.

How does the OpenAI SDK handle voice interruptions?

Realtime sessions handle interruptions for you, while the pipeline path leaves them to your code. When the user interrupts, a realtime session emits audio_interrupted and updates history so the server-side conversation matches what the user heard. For telephony and other delayed playback, the guide says to use RealtimePlaybackTracker so the cut lands at the actual playback position.

For StreamedAudioInput, the pipeline does not provide built-in interruption handling, and every detected turn triggers a separate run of your workflow. The docs suggest using the turn_started and turn_ended lifecycle events to mute the speaker's microphone while a turn plays.

What does Pydantic AI support for realtime voice?

Pydantic AI is the Python AI SDK from the Pydantic team, and its docs call voice "just another frontend" for an agent. That frontend runs on OpenAI Realtime, Gemini Live, Azure and xAI Grok Voice, and the model calls your tools mid-conversation while it keeps talking.

The example opens a session with agent.realtime('openai:gpt-realtime-2.1').session(), sends microphone audio with send_audio, and prints each speaker's text from session.stream_transcripts().

On OpenAI models, the provider page says that for voice agents you should use a GPT-Live or gpt-realtime model with a realtime session. The docs' example list next to Realtime Voice Assistant includes Agent Handoff and Browser WebRTC entries. Read the Agent Handoff example before you plan handoffs in a voice build.

What does Mastra offer for voice agents?

Mastra is a TypeScript framework for AI-powered applications. You pass a voice provider to an agent through its voice property, and the same property supports text-to-speech, speech-to-text or speech-to-speech depending on the provider. Speech-to-speech maintains an open connection that processes speech in both directions, unlike separate TTS and STT operations.

The configuration list includes OpenAI Realtime, xAI Realtime, Google Gemini Live, AWS Nova Sonic and Inworld Realtime. The OpenAI realtime provider takes a model ID for real-time voice, with gpt-5.1-realtime as the docs' example. Realtime voice providers can use tools configured on the agent. For live calls, Mastra hands the audio loop to LiveKit for voice activity, semantic turn detection and barge-in, while your agent generates each reply with its own model, tools and memory.

Watch the voice instance when one agent serves many callers. A static voice instance is shared across every request, and with several live sessions on one agent, one session can overwrite another's state. The docs say to provide voice as a resolver when each live session needs its own instance.

Which framework should I pick for a voice build?

Pick by language first, then by the realtime provider you plan to run. Python teams can compare the OpenAI Agents SDK with Pydantic AI. TypeScript teams can look at Mastra or the OpenAI Agents SDK for TypeScript, which is the one to check for browser WebRTC; the TypeScript team guide covers that stack more broadly.

If the whole project lives in one framework, that framework is the right pick. Settle early whether you want a speech-to-speech session or a transcribe, run and synthesize pipeline. Teams with text agents already in production can keep that code in the middle of a pipeline, and teams chasing the lowest spoken latency should prototype a realtime session first.

What do readers ask about multi-agent frameworks with voice and realtime agent support?

Can a realtime tool call wait for human approval?

In the OpenAI Python SDK, function tools can require human approval. The session emits tool_approval_required and pauses the tool until you call approve_tool_call() or reject_tool_call().

Can these voice agents take phone calls?

The TypeScript OpenAI docs cover how to run a phone or telephony experience on Twilio, and the Python call_id option attaches to an existing realtime call, with SIP as the documented attach flow. Mastra's realtime voice runs live calls a user can talk over in a browser or by phone.

Which OpenAI SDK should I use for a browser voice client?

Use the TypeScript SDK, which documents browser-first WebRTC setup with ephemeral client tokens. The Python realtime quickstart covers only Python-managed realtime sessions over server-side WebSockets.

Which sources does this page cite?