Overview
AgentDuet is a Python SDK for AI agents on phone and WhatsApp. It provides connector authentication, call control, bidirectional PCM streaming, and WhatsApp send/receive so applications can attach any realtime speech model without owning carrier infrastructure.
Typical voice flow: answer (or place) a call, stream caller PCM into a model such as Gemini Live, Nova Sonic, OpenAI Realtime, Qwen Omni, or Grok Voice, play model audio back on the call, and clear the outbound buffer on barge-in. WhatsApp send/receive is on the same connector; see WhatsApp Messaging.
Package: agentduet 1.0.0.
Requires Python 3.12+.
Who this is for
Teams building realtime voice (and messaging) agents that need:
- Bidirectional PCM for any speech-to-speech model
- Call control (
answer,dial,connect,whisper,barge,spy) - Interrupt handling via
clear_send_audio_buffer() - WhatsApp inbound (
on_incoming_message) and outbound (send_message)
Mental model
SessionManager- one control connection for the processSession- short-lived handle for a subscriber (calls and messages)Call- media and call commands
Inbound call and WhatsApp notifications arrive at the connector. AgentDuet owns connectivity, PCM transport, and message send; models and business tools remain in application code. See Integrations for voice bridges and WhatsApp Messaging for chat.
Capabilities
- Phone voice and WhatsApp messaging in one SDK
- Real-time PCM with pull-based flow control and buffer clearing
- Model-agnostic integrations (see Integrations)
- Inbound and outbound voice
- Inbound and outbound WhatsApp (
on_incoming_message/send_message) - Ambient assist on live human calls (
spy/whisper/barge) - API key or mTLS authentication; automatic reconnect
- Cross-node handoff via
to_json/from_jsonwhile the call isNEW - Runtime trigger conditions for calls and messages
Ready to Build?
Install the Python SDK and configure your credentials.
Build your first voice and WhatsApp agent in minutes.
Learn the core architecture, session lifecycle, and audio streaming.
Explore integrations with Voice AI models, agent orchestrators, custom voice cloning, MCP, etc.
Explore production recipes for receptionists, booking, and outbound calls.
Browse the complete API surface, call commands, and error codes.
