A real-time voice AI agent template demonstrating two LiveKit-powered voice applications:
- Compliment Battle - Positive competitions where you out-compliment your opponent
- Word Game - Vocabulary practice through voice translation
A voice agent that engages in positive compliment battles with two modes:
- Attack Mode: The agent delivers uplifting compliments immediately with genuine enthusiasm
- Protect Mode: The agent listens to your compliments first, then responds with heartfelt appreciation
The agent uses natural voice interaction, maintaining a warm, encouraging style while keeping verses concise.
A vocabulary practice game where the agent speaks English words and you respond with translations in your target language:
- Multiple Languages: Portuguese, Spanish, French, Italian, German
- Real-time Feedback: Instant confirmation of correct/incorrect answers
- Score Tracking: Track your progress as you practice
- Voice Interaction: Completely hands-free gameplay
Access the word game at /word-game when the application is running.
The application consists of three main services:
- Web Service (
services/web/): Next.js frontend with LiveKit integration for real-time voice communication - Agent Service (
services/agent/): Python-based voice AI agent using LiveKit Agents framework - Nginx: Reverse proxy for routing requests only used in production for SSL certificates
Frontend:
- Next.js with TypeScript
- React Components for UI
- LiveKit Client SDK
Agent:
- Python 3.13+
- LiveKit Agents SDK
- Supabase (for word game database)
- Docker and Docker Compose
- LiveKit account and credentials (Get started)
- Supabase account (optional, for word game - fallback words available)
git clone <repository-url>
cd voice-agent-templateCopy the example environment file:
cp .env.example .envEdit .env and add your credentials:
# LiveKit (required for both modes)
LIVEKIT_API_KEY=your_api_key_here
LIVEKIT_API_SECRET=your_api_secret_here
LIVEKIT_URL=wss://your-project.livekit.cloud
# Supabase (optional for word game)
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_KEY=your_supabase_service_role_key_hereIf using Supabase for the word game:
- Create a project at supabase.com
- Run the schema from
services/agent/supabase/schema.sqlin the SQL Editor - Copy your credentials to
.env
See services/agent/supabase/README.md for detailed instructions.
Development Mode:
docker-compose -f docker-compose.yml -f docker-compose.dev.yml upThe web interface will be available at http://localhost:3000
- Navigate to
http://localhost:3000(home page) - Join a Room: Connect to the voice session
- Choose Your Mode:
- Attack: Click to have the agent deliver compliments to you
- Protect: Click, then share your compliments - the agent will listen and respond
- Add Custom Instructions: Optionally provide specific themes for the agent's compliments
- Navigate to
http://localhost:3000/word-game - Click "START PRACTICING" to connect
- Select your target language
- Click "START GAME"
- Listen to the English word and speak the translation
- Get instant feedback and continue practicing!
See WORD-GAME-TESTING.md for comprehensive testing instructions.
This project uses GitHub Actions for automated deployment to a production server.
Before deploying, configure the following secrets in your GitHub repository (Settings → Secrets and variables → Actions):
SERVER_IP: Your server's IP addressSERVER_PASSWORD: Your server's root password
CR_PAT: GitHub Personal Access Token withread:packagesandwrite:packagespermissions
LIVEKIT_URL: Your LiveKit server URLLIVEKIT_API_KEY: Your LiveKit API keyLIVEKIT_API_SECRET: Your LiveKit API secret
SUPABASE_URL: Your Supabase project URLSUPABASE_KEY: Your Supabase service role key
Important: Use separate LiveKit projects for development and production.
Run the "Setup Server" workflow manually from the Actions tab.
git push origin mainDeployment happens automatically on push to main.
CLAUDE.md- Detailed architecture and development guideWORD-GAME-TESTING.md- Word game testing checklistservices/agent/supabase/README.md- Supabase setup guide
This project is licensed under the MIT License - see the LICENSE file for details.