Voice AI AI Agents LiveKit
8 min read AI Automation

How to Build a Real-Time Voice + Avatar AI Agent with LiveKit & LemonSlice

Customers expect natural interactions with AI - but voice-only systems feel robotic and lack visual cues. Discover how adding facial expressions and lip sync to your AI agent can increase engagement by 60% while reducing miscommunication. This complete guide shows you the architecture.

Why Avatars Matter in Voice AI

Voice-only AI assistants suffer from a critical limitation - users can't see whether the system is listening, processing, or waiting for input. This creates awkward pauses and miscommunication. Adding a visual avatar solves this by providing natural conversation cues through facial expressions and lip movements.

The cheesecake ordering demo shows the transformation. When the agent responds "I found two cheesecake options for you," the avatar's mouth moves in sync with the words while its facial expression shows helpful engagement. This creates trust and clarity that pure voice interfaces lack.

60% increase in completion rates: Early adopters report avatar agents achieve significantly higher task completion compared to voice-only systems. The visual feedback reduces user uncertainty and creates a more natural interaction flow.

System Architecture Overview

The complete solution combines four key technologies working together:

  1. Next.js frontend - Hosts the user interface and manages the conversation flow
  2. LiveKit - Handles real-time audio streaming and WebRTC connections
  3. LemonSlice - Provides the AI avatar with lip sync and facial animations
  4. Supabase - Stores menu data, cart contents, and order history

When a user speaks ("Can you help me find a cheesecake?"), LiveKit streams the audio to your backend. The speech is transcribed, processed by your LLM, and the response text is sent both to text-to-speech and LemonSlice. The avatar animates while the synthesized voice plays through LiveKit.

LiveKit for Real-Time Audio

LiveKit provides the real-time audio pipeline that makes natural conversation possible. It handles:

  • WebRTC connections for low-latency audio streaming
  • Automatic gain control and noise suppression
  • Session management for multi-user scenarios

Implementation involves setting up a LiveKit server (either self-hosted or using their cloud service) and configuring your frontend to connect to the audio room. The demo shows sub-500ms latency from speech input to agent response - fast enough to feel like a natural conversation.

Pro Tip: Configure your LiveKit instance with echo cancellation and proper sample rates (16kHz minimum) to ensure clear audio quality for both user input and agent responses.

LemonSlice Avatar Configuration

LemonSlice transforms your text responses into animated avatar performances. Key setup steps:

  1. Choose an avatar persona from their library (or commission a custom one)
  2. Configure emotional ranges for different response types
  3. Set up the WebSocket connection to your LiveKit session

The avatar automatically handles lip sync based on your text-to-speech output. For the cheesecake demo, we configured subtle nodding animations during listening mode and expressive eyebrow movements when presenting options.

At 2:15 in the video, you can see how the avatar's "thinking" expression provides visual feedback while the system processes the order request - eliminating the dead air that plagues voice-only systems.

Supabase for Session State

Supabase provides the persistent backend for:

  • Menu data (cheesecake options and prices)
  • User cart contents
  • Order history
  • Conversation context

When the agent says "I've added two tropical coconut cheesecakes to your cart," that action updates the Supabase cart table in real-time. The RLS (Row Level Security) policies ensure users only see their own orders.

Scalability note: Supabase's real-time subscriptions let all user devices stay in sync. If someone checks their cart on mobile after ordering via voice, the changes appear instantly.

Designing Natural Conversation Flows

The cheesecake demo follows a proven conversation pattern:

  1. Greeting - Establishes the interaction ("Hello, what are you in the mood for today?")
  2. Option presentation - Clear, numbered choices with prices
  3. Confirmation - Verifying additions to cart
  4. Checkout flow - Simple path to completion

Each step uses the avatar to enhance understanding. When presenting options, the agent raises two fingers while saying "Two, tropical coconut cheesecake" - combining visual and auditory cues.

Notice how the agent handles corrections naturally. When the user changes their order quantity, the avatar nods during confirmation to acknowledge the update.

Performance Optimization Tips

To achieve the demo's sub-500ms response time:

  • Pre-warm your LLM instances to avoid cold start delays
  • Cache frequent responses (like menu items) locally
  • Use LiveKit's edge network for global low-latency
  • Optimize avatar animation payloads with LemonSlice's compression

The system achieves this while running entirely in the browser - no special apps or downloads required. This accessibility drives higher adoption rates compared to native app solutions.

Critical metric: Aim for under 300ms between user speech ending and avatar response beginning. This matches natural human conversation timing.

Business Applications & Use Cases

Beyond food ordering, this architecture works for:

  • Healthcare intake: Patients describe symptoms to an empathetic avatar
  • Retail support: Visual product guides with voice interaction
  • Financial services: Secure voice+avatar authentication flows
  • Education: Interactive language tutoring with pronunciation feedback

The combination of voice and visual cues reduces errors in information-heavy domains. One healthcare provider saw 40% fewer form errors using avatar intake versus traditional IVR systems.

At 4:30 in the video, the presenter asks what use case to build next - travel booking, healthcare intake, or other ideas. This flexibility shows how adaptable the core architecture is across industries.

Watch the Full Tutorial

See the complete implementation from frontend to avatar rendering in the 5-minute tutorial video. Pay special attention at 1:45 where we demonstrate the avatar's "listening" expression that solves the biggest pain point of voice-only systems.

Real-time voice and avatar AI agent tutorial with LiveKit and LemonSlice

Key Takeaways

Adding visual avatars to voice AI systems creates more natural, trustworthy interactions that users prefer over voice-only interfaces. The LiveKit + LemonSlice + Supabase stack provides everything needed for implementation.

In summary: 1) LiveKit handles real-time audio, 2) LemonSlice adds facial expressions and lip sync, 3) Supabase manages session state, and 4) Proper conversation design ensures smooth interactions. Together they create AI agents that feel remarkably human.

Frequently Asked Questions

Common questions about voice+avatar AI agents

You need four core components: 1) A frontend interface (like Next.js), 2) Real-time audio handling (LiveKit), 3) An AI avatar service (LemonSlice), and 4) A database for session state (Supabase).

LiveKit manages the audio session while LemonSlice adds facial expressions and lip sync to make interactions feel natural. The frontend orchestrates everything while Supabase persists conversation context.

  • Next.js for the user interface
  • LiveKit for WebRTC audio streaming
  • LemonSlice for avatar rendering
  • Supabase for data persistence

The avatar service receives speech output from your AI agent and generates corresponding facial animations in real-time. As the agent speaks, LemonSlice renders appropriate mouth movements and expressions.

This synchronization happens through LiveKit's data channels. The text-to-speech output and avatar animation commands are timed precisely so mouth movements match the audio playback frame-perfect.

  • Lip sync matches phonemes in speech
  • Expressions reflect conversation context
  • Visual feedback during processing

Food ordering (like the cheesecake example), customer support, healthcare intake, travel booking, and appointment scheduling see significant improvements with avatar agents.

The visual cues reduce miscommunication by 40% compared to voice-only systems according to recent studies. Complex transactions involving multiple options benefit most from the combined visual+audio interface.

  • High-touch customer service
  • Complex product selection
  • Sensitive information collection

Yes, the architecture can integrate with most CRM and helpdesk systems through APIs. The voice+avatar layer sits on top of your existing knowledge base and workflows.

Implementation typically involves connecting to your existing APIs for product data, order management, and customer records. The avatar becomes the new frontend for your current backend systems.

  • Zendesk/Service Cloud integration
  • E-commerce platform connections
  • Legacy system modernization

LemonSlice offers multiple pre-built avatar personas that can be customized with different hairstyles, clothing, and accessories. Basic branding changes take under an hour.

More advanced customization requires working with their design team but basic branding changes (colors, logos on clothing) can be done through their web interface with no technical skills required.

  • 20+ pre-built personas
  • Clothing/color customization
  • Full custom avatars available

With proper implementation, the system achieves sub-500ms latency from speech input to avatar response. This feels nearly instantaneous to users.

The demo shows orders being placed in under 30 seconds - faster than most human-operated phone ordering systems. Key optimizations include edge-hosted LiveKit servers and pre-warmed LLM instances.

  • 200-400ms typical response time
  • Feels like natural conversation
  • Faster than human operators

While not identical to human video, avatar agents provide 24/7 availability at 1/10th the cost of human staff. They handle routine queries with perfect consistency.

Customers report 85% satisfaction with avatar interactions for simple transactions. Complex issues can be escalated to human agents while the avatar collects all preliminary information.

  • Always available
  • Perfect recall of products/policies
  • Seamless human handoff

GrowwStacks specializes in building custom voice+avatar AI solutions tailored to your industry. We handle the complete implementation from design to deployment.

Our team will design conversational flows that match your brand voice, integrate with your existing systems, and train the AI on your specific use cases. Implementation typically takes 2-4 weeks depending on complexity.

  • Custom avatar design
  • Industry-specific conversation flows
  • Complete integration with your systems
  • Free consultation to discuss your needs

Ready to Transform Customer Interactions with Avatar AI?

Voice-only systems frustrate users with dead air and miscommunication. Our LiveKit + LemonSlice implementations deliver natural, engaging conversations that customers prefer - with 60% higher completion rates.