Skip to main content

Overview

The Voice Agent provides a complete voice conversation pipeline that orchestrates VAD → STT → LLM → TTS in a seamless flow. Use it to build voice assistants, hands-free interfaces, and conversational AI applications.

Basic Usage

Setup

1. Download Required Models

2. Initialize Voice Agent

API Reference

initializeVoiceAgent

Initialize the voice agent pipeline.

VoiceAgentConfig

processVoiceTurn

Process a complete voice turn (STT → LLM → TTS).

VoiceTurnResult

startVoiceSession

Start an interactive voice session with automatic VAD.

VoiceSessionConfig

VoiceSessionEvent

Examples

Complete Voice Assistant

VoiceAssistant.tsx

Single Turn Processing

Custom Voice Pipeline

Build a custom pipeline for more control:

Performance Optimization

Latency Breakdown

Tips for Lower Latency

Use smaller models for faster response times. A 360M LLM with Whisper Tiny can achieve sub-second voice turns.

Error Handling

VAD

Voice Activity Detection

STT

Speech-to-Text

TTS

Text-to-Speech

LLM

Text Generation