Skip to main content

LiveKit Integration Quick Start

Get up and running with NextEVI and LiveKit Agents to create a real-time voice AI that works seamlessly with LiveKit’s playground and ecosystem.

Overview

This guide shows you how to create a NextEVI agent that:
  • Integrates with LiveKit’s AgentSession for proper transcription display
  • Handles real-time audio streaming
  • Works with LiveKit playground for easy testing
  • Bridges NextEVI’s transcriptions to the LiveKit interface

Complete Example

Create a file called main.py:

Environment Setup

Make sure your environment variables are configured:
Replace the placeholder values with your actual credentials from NextEVI Dashboard and LiveKit Console.

Running the Agent

Start your NextEVI agent:
You should see output like:

Testing with LiveKit Playground

  1. Open LiveKit Playground
  2. Connect to your LiveKit instance
  3. Join a room where your agent is running
  4. Start speaking - you’ll see:
    • Real-time transcriptions in the chat interface
    • NextEVI’s empathetic voice responses
    • Emotion detection and natural conversation flow

How It Works

AgentSession Integration

  • Custom STT Component: Bridges NextEVI’s transcriptions to LiveKit’s interface
  • Transcription Display: Shows real-time speech recognition in the playground chat
  • Seamless Integration: Works with existing LiveKit tools and workflows

Audio Flow

  1. Input: User speaks → LiveKit captures audio → Sent to NextEVI
  2. Processing: NextEVI handles STT, emotion detection, LLM, and TTS
  3. Output: NextEVI audio → Streamed back to LiveKit → User hears response
  4. Transcription: NextEVI transcriptions → Custom STT → Playground interface

Key Features

Real-time Transcription

See live transcriptions in LiveKit playground interface

Emotion Recognition

NextEVI’s built-in emotion detection and empathetic responses

Full-duplex Audio

Natural conversation with interruption handling

Easy Testing

Works seamlessly with LiveKit playground for development

Next Steps

Troubleshooting

Ensure the on_transcription callback is properly set and the NextEVISTT component is receiving transcriptions. Check the agent logs for STT bridge messages.
Verify that the audio source is properly configured and the LiveKit room has audio permissions. Check that the sample rate matches (48kHz).
Double-check all environment variables are set: