We recommend using Tavus’s Full Pipeline in its entirety for the lowest latency and most optimized multimodal experience. Integrations like LiveKit Agent or Pipecat only provide rendering, while our Full Pipeline includes perception, turn-taking, and rendering for complete conversational intelligence.

Tavus offers integration with Pipecat, an open-source framework for building multimodal conversational agents by Daily. You can integrate Tavus into your Pipecat application in two ways:

  • Additional Tavus Participant (TavusTransport)
    • The Tavus agent joins as a third participant alongside the Pipecat bot and human user. It receives audio from the Pipecat pipeline’s TTS layer and renders synchronized video and audio.
  • Video Layer for Pipecat Bot (TavusVideoService)
    • Only the Pipecat bot is present in the room. TavusVideoService acts as a pipeline layer, sending TTS audio to Tavus in the background. Tavus returns video and audio streams for the bot to display. No additional participant is added.

Prerequisites

Before integrating Tavus with Pipecat, ensure you have the following:

TavusTransport

TavusTransport connects your Pipecat app to a Tavus conversation, allowing the bot to join the same virtual room as the Tavus avatar and participants. To get started, you can follow the following steps or learn more from this sample code.

Integration Guide for TavusTransport

1

Step 1: Setup and Authentication

  1. Install the Tavus plugin for Pipecat.
pip install pipecat-ai[tavus]
  1. In the .env file of your pipecat application (at /path/to/pipecat/.env) add:
TAVUS_API_KEY=<your_api_key>
TAVUS_REPLICA_ID=<your_replica_id>

Replace <api_key> and <your_replica_id> with your actual Tavus API key and Replica ID you want to use.

2

Step 2: Create the Tavus transport layer

Create an instance of TavusTransport by providing your bot name, Tavus API key, Replica ID, session, and additional parameters.

import os
import aiohttp
from dotenv import load_dotenv
from loguru import logger
from pipecat.audio.vad.silero import SileroVADAnalyzer
from pipecat.transports.services.tavus import TavusParams, TavusTransport
# Other imports...

load_dotenv(override=True)

logger.remove(0)
logger.add(sys.stderr, level="DEBUG")

async def main():
    async with aiohttp.ClientSession() as session:
        transport = TavusTransport(
            bot_name="Pipecat bot",
            api_key=os.getenv("TAVUS_API_KEY"),
            replica_id=os.getenv("TAVUS_REPLICA_ID"),
            session=session,
            params=TavusParams(
                audio_in_enabled=True,
                audio_out_enabled=True,
                microphone_out_enabled=False,
                vad_analyzer=SileroVADAnalyzer(),
            ),
        )

        # stt, tts, llm...

See Pipecat API Reference for the configuration details.

3

Step 3: Insert the Tavus transport layer into the pipeline

Add the Tavus transport layer to your processing pipeline.

        # stt, tts, llm...

        pipeline = Pipeline(
            [
                transport.input(),  # Transport user input
                stt,  # STT
                context_aggregator.user(),  # User responses
                llm,  # LLM
                tts,  # TTS
                transport.output(),  # Transport bot output
                context_aggregator.assistant(),  # Assistant spoken responses
            ]
        )
4

Step 4: Run the program

  1. Run the following command to execute the program:
python <file-name>.py
  1. Use the Tavus Daily URL provided in the console to interact with the agent.

TavusVideoService

You can use TavusVideoService to enable real-time AI-driven video interactions in your Pipecat app. To get started, you can follow the following steps or refer from this sample code.

Integration Guide for TavusVideoService

1

Step 1: Setup and Authentication

  1. Install the Tavus plugin for Pipecat.
pip install pipecat-ai[tavus]
  1. In the .env file of your pipecat application (at /path/to/pipecat/.env) add:
TAVUS_API_KEY=<your_api_key>
TAVUS_REPLICA_ID=<your_replica_id>

Replace <api_key> and <your_replica_id> with your actual Tavus API key and Replica ID you want to use.

2

Step 2: Create the Tavus Video Service

Create an instance of TavusVideoService by providing your Tavus API key and Tavus Replica ID.

import argparse
import os
import aiohttp
from dotenv import load_dotenv
from loguru import logger
from pipecat.services.tavus.video import TavusVideoService
from pipecat.transports.base_transport import BaseTransport
# Other imports...

load_dotenv(override=True)

async def run_example(transport: BaseTransport, _: argparse.Namespace, handle_sigint: bool):
    logger.info(f"Starting bot")
    async with aiohttp.ClientSession() as session:
        tavus = TavusVideoService(
            api_key=os.getenv("TAVUS_API_KEY"),
            replica_id=os.getenv("TAVUS_REPLICA_ID"),
            session=session,
        )

        # stt, tts, llm...

See Pipecat Tavus Service for the configuration details.

3

Insert the Tavus Video Service into the timeline

Insert the TavusVideoService into the pipeline by adding the tavus service after the TTS processor in the pipeline.

        # stt, tts, llm...

        pipeline = Pipeline(
            [
                transport.input(),  # Transport user input
                stt,  # STT
                context_aggregator.user(),  # User responses
                llm,  # LLM
                tts,  # TTS
                tavus,  # Tavus output layer
                transport.output(),  # Transport bot output
                context_aggregator.assistant(),  # Assistant spoken responses
            ]
        )
4

Step 4: Run the program

  1. Run the following command to execute the program:
python <file-name>.py
  1. Use the localhost URL provided in the console to interact with the agent.