Skip to main content
This quickstart walks you through building a multi-agent voice bot where two LLM agents transfer control between each other. A greeter agent welcomes the user, and a support agent answers product questions. The LLM decides when to hand off.

Prerequisites

Environment
  • Python 3.11 or later
  • uv package manager installed
AI Service API Keys

Deepgram (STT)

Speech recognition API key.

OpenAI (LLM)

Language model API key.

Cartesia (TTS)

Voice synthesis API key.

Setup

  1. Create a new project and install dependencies
  1. Configure your API keys
.env
  1. Create bot.py with the following code
bot.py

Run your bot

Open http://localhost:7860/client in your browser and click Connect. Try saying “I’d like to know about the Rocket Boots.” The greeter agent will transfer you to support, which knows the product details. Say “I want to browse other products” and you’ll be transferred back to the greeter.

How it works

This bot has three agents coordinating through a shared message bus:
  1. AcmeAgent owns the transport (audio I/O) and places a BusBridgeProcessor in its pipeline where an LLM would normally go. The bridge routes audio frames to whichever LLM agent is currently active.
  2. GreeterAgent and SupportAgent are LLMAgent subclasses with bridged=(), meaning they receive frames from the bus. Each runs its own LLM and defines tools via the @tool decorator.
  3. When an LLM agent calls transfer_to_agent, it uses handoff_to() which deactivates itself and activates the target agent. The transition is seamless to the user.

Key concepts

Next steps

Learn the Fundamentals

Walk through each concept step by step

Browse Examples

Task coordination, Flows agents, distributed setups, and more