Problem
Voice agents need real-time retrieval to answer with fresh, contextual knowledge.Architecture
- LiveKit voice pipeline
- Moss index for fast retrieval (sub-10 ms)
- Fetch top-k -> rerank -> respond via LiveKit
LiveKit provides the real-time audio pipeline (STT/LLM/TTS); Moss supplies fast retrieval.
See LiveKit voice AI quickstart.
Prerequisites
- Python 3.8+
- LiveKit credentials (
LIVEKIT_API_KEY,LIVEKIT_API_SECRET,LIVEKIT_URL) - Moss credentials (
MOSS_PROJECT_ID,MOSS_PROJECT_KEY) and an existing index (MOSS_INDEX_NAME, e.g., FAQs) - OpenAI API key (
OPENAI_API_KEY) - Deepgram API key (
DEEPGRAM_API_KEY) - Cartesia API key (
CARTESIA_API_KEY)
Run the sample (Python)
Using the LiveKit voice agent sample inmoss-samples:
- Install deps:
- Create
.env.localwith your keys:
-
Ensure the Moss index exists (e.g., create
faqsusing the Quickstart sample data). - Run the agent:
- Connects to LiveKit Agents
- Loads the Moss index on start
- Uses
search_support_faqsto ground answers from Moss - Streams responses via LiveKit TTS