Why Use Moss with LiveKit?
Moss delivers sub-10ms semantic retrieval, ensuring your voice agents respond naturally without noticeable delays. A session gives each call its own local index, so the agent can recall what was said earlier in the conversation with no cloud round trip.Required Tools
Integration Guide
1
Installation
Install the Moss SDK.
2
Environment Setup
Create a
.env file in your project root directory with your API keys.File: .env3
Creating the Knowledge Base with Moss
Before the agent can answer questions, build the long-term knowledge base. Run this script once to upload your documents to Moss as a cloud index.File: Run the builder:
build_index.py4
Building the Agent
This agent exposes Moss search as function tools. The LLM decides when to call them during a turn, reads the results, and uses them to answer, so it can search, refine, or skip retrieval on turns that don’t need it.Two tools are registered:
search_knowledge_basequeries the persistent knowledge base you built above (long-term context).search_conversationqueries this call’s session (short-term context) to recall something said earlier.
agent.pyThe session indexes each turn locally during the call and pushes to the cloud
at the end, so a later session opened with the same name resumes the
conversation, which is the basis for cross-agent handoff. See
Sessions for the full API.
5
Running the Agent
First, start the LiveKit server in development mode:Then, in a separate terminal, start your worker. The necessary VAD models will handle themselves or be downloaded automatically if needed by the plugin.