Getting Started
1. Connect Your LiveKit Agent
In the UserTrace dashboard, navigate to Agent Setup and select LiveKit Integration. Required Information:- LiveKit Server URL (WSS endpoint)
- API Key and Secret
- Room name or agent identifier
2. Set Evaluation Context
Define your pass and fail criteria for voice interactions: Example Pass/Fail Criteria:Testing Process
Real-Time Voice Testing
LiveKit testing follows a WebRTC-based approach:- UserTrace connects to your LiveKit room
- WebRTC connection is established with your agent
- Real-time audio streams are initiated
- Simulated user interacts based on scenario
- Conversation quality and agent responses are monitored
- Results are analyzed including technical metrics
- Room Join: UserTrace joins specified LiveKit room
- Agent Discovery: Identifies your voice agent participant
- Audio Setup: Establishes bidirectional audio streams
- Conversation Start: Begins scenario-based interaction
- Quality Monitoring: Tracks audio quality and latency
- Natural Completion: Ends when scenario objectives are met
LiveKit-Specific Features
Real-Time Infrastructure
WebRTC Quality:- Ultra-low latency voice communication
- Adaptive bitrate for varying network conditions
- Echo cancellation and noise suppression
- Network resilience and recovery
- Multi-participant support
- Dynamic participant joining/leaving
- Room metadata and configuration
- Custom room layouts and settings
Agent Architecture
Server-Side Agents:- Python/Node.js agent implementations
- Real-time audio processing
- AI model integration
- Custom business logic
- Web browser compatibility
- Mobile app support
- Desktop application integration
- Custom client implementations
Best Practices
Performance
Real-Time Optimization• Target < 200ms end-to-end latency
• Use LiveKit’s adaptive streaming
• Optimize AI model inference time
• Monitor connection quality metrics
Reliability
Connection Stability• Implement reconnection logic
• Handle network interruptions
• Use LiveKit’s connection events
• Monitor participant status
Implementation Examples
Server Agent Setup
Python Agent Example:Authentication
Token Generation:Common Scenarios
Interactive Voice Assistants:- Personal assistant interactions
- Smart home control
- Task management
- Information retrieval
- Real-time help desk
- Technical troubleshooting
- Product information
- Issue resolution
- Team meetings with AI participants
- Educational tutoring sessions
- Brainstorming facilitation
- Multi-user voice experiences
Advanced Features
AI Integration
Speech-to-Text:- Real-time transcription
- Multiple language support
- Custom vocabulary
- Confidence scoring
- Natural voice synthesis
- Voice cloning capabilities
- Emotion and tone control
- Multi-speaker support
- Streaming AI responses
- Context preservation
- Function calling
- Multi-modal processing
Quality Monitoring
Audio Metrics:Troubleshooting
Common Issues: Connection Problems:- WebRTC connection fails: Check firewall settings and TURN servers
- Audio not flowing: Verify microphone permissions and audio tracks
- High latency: Optimize server location and network routing
- Frequent disconnections: Monitor network stability and implement reconnection
- Agent not responding: Check LiveKit agent deployment and logs
- Poor audio quality: Verify audio processing pipeline and network bandwidth
- Delayed responses: Optimize AI model inference and processing time
- Memory leaks: Monitor resource usage in long-running sessions
Development Setup
Local Testing
Docker Setup:Need help with LiveKit integration? Check the LiveKit documentation or contact [email protected].