Overview

View as Markdown

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+.

pip install agentduet==1.0.0

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

on_incoming_call on_incoming_message send_message SessionManager Session Call WhatsApp outbound Your AI model
  1. SessionManager - one control connection for the process
  2. Session - short-lived handle for a subscriber (calls and messages)
  3. 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_json while the call is NEW
  • Runtime trigger conditions for calls and messages

Ready to Build?