Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.vobiz.ai/llms.txt

Use this file to discover all available pages before exploring further.

Transfer an active call from one LiveKit AI agent to another specialized agent mid-conversation - without dropping the call.

View on GitHub

Clone and run the full working example

Getting started

git clone https://github.com/vobiz-ai/Vobiz-Livekit-Agent-to-Agent-Handoff-Example.git
cd Vobiz-Livekit-Agent-to-Agent-Handoff-Example
pip install -r requirements.txt
python agent.py dev

Overview

A front-line agent handles the initial greeting and intent detection. When the caller needs specialized help (billing, support, etc.), the front-line agent passes control to a specialist agent. The handoff is seamless - the caller stays in the same room and hears no interruption.

How it works

  1. The reception agent greets the caller and determines their intent.
  2. Based on intent, the agent calls pass_control_to_billing or a similar tool.
  3. The reception agent leaves the room.
  4. The specialist agent joins the same room and takes over the conversation.
  5. The specialist receives context from the handoff payload.

Agent function tools

ToolDescription
pass_control_to_billingHand off to the Billing department specialist
pass_control_to_supportHand off to the Technical Support specialist
pass_control_to_salesHand off to the Sales specialist

Environment variables

.env
LIVEKIT_URL=wss://your-project.livekit.cloud
LIVEKIT_API_KEY=APIxxxxxxxxxxxxx
LIVEKIT_API_SECRET=secretxxxxxxxxxx
OPENAI_API_KEY=sk-...