Skip to main content
Pipecat is an open-source framework for building conversational AI agents. It orchestrates speech-to-text (STT), language models (LLM), and text-to-speech (TTS) services into a unified pipeline. Connect Plivo Audio Streaming to Pipecat to build AI voice agents that handle inbound and outbound phone calls.

How It Works

  1. Plivo handles phone call routing and streams real-time audio over WebSocket
  2. Pipecat receives audio and orchestrates the AI pipeline
  3. STT service converts speech to text
  4. LLM processes the text and generates a response
  5. TTS service converts the response back to speech
  6. Plivo plays the audio to the caller

Choose Your Stack

Pipecat supports multiple AI service combinations. Choose based on your requirements:

Standard Pipelines (STT → LLM → TTS)

Speech-to-Speech (Direct Audio Processing)

Speech-to-speech models process audio directly without intermediate text conversion, resulting in lower latency and more natural conversations.

Prerequisites


Quick Start

1. Clone the Examples

2. Choose Inbound or Outbound

  • Inbound calls: cd inbound - Receive calls on your Plivo number
  • Outbound calls: cd outbound - Initiate calls programmatically

3. Configure Environment

Edit .env with your credentials (varies by provider stack).

4. Start the Server

5. Expose for Development (Inbound Only)

Configure your Plivo number’s Answer URL to https://your-ngrok-url.ngrok.io/

Inbound vs Outbound Calls

Inbound Calls

Your Plivo number receives calls and connects them to your Pipecat bot. Setup:
  1. Configure Answer URL on your Plivo number
  2. Plivo sends call to your server
  3. Server returns XML with <Stream> element
  4. WebSocket connection established with Pipecat

Outbound Calls

Your application initiates calls to phone numbers. Setup:
  1. Start your Pipecat server
  2. Call the /start endpoint with target phone number
  3. Plivo places the call and connects to your bot
Pass custom data to your bot:
Access this data in your bot via runner_args.body.

Troubleshooting

Debug logs:
  • Server logs: Terminal running server.py
  • Bot logs: bot_<room_name>.log files
  • Plivo logs: Console > Logs > Calls