This directory contains a high-performance voice AI agent built with LiveKit Agents and Moss for real-time semantic retrieval.
The agent acts as a customer support assistant, fetching relevant information from a knowledge base indexed in Moss to provide accurate and low-latency responses.
- Python 3.10+
- uv (recommended package manager)
- LiveKit Cloud account (or local LiveKit server)
- Moss account (from portal.usemoss.dev)
- AI Service Keys: OpenAI (LLM), Deepgram (STT), and Cartesia (TTS).
-
Configure Environment Variables: Copy the template and fill in your credentials in a new
.env.localfile:cp .env.template .env.local
Required variables:
LIVEKIT_URL,LIVEKIT_API_KEY,LIVEKIT_API_SECRETMOSS_PROJECT_ID,MOSS_PROJECT_KEY,MOSS_INDEX_NAMEOPENAI_API_KEYDEEPGRAM_API_KEYCARTESIA_API_KEY
-
Install Dependencies:
uv sync
Before running the agent, upload your FAQ documents to Moss:
uv run create_index.pyThis script reads faqs.json and creates a semantic index in your Moss project.
Start the agent in development mode:
uv run agent.py devThe agent will connect to your LiveKit project and wait for users to join a room.
Once the agent is running (uv run agent.py dev), you can interact with it using one of these methods:
- Go to the LiveKit Cloud Console.
- Select your project.
- Click on the Agents tab and then Playground.
- Click Connect to start a session. Your local agent should automatically join and start talking!
We have a pre-built React frontend in the sibling directory:
- Open a new terminal and navigate to
../../agent-react. - Follow its README to set up and run:
pnpm install pnpm dev
- Open
http://localhost:3000and click Connect.
- Retrieval: Uses
MossClientto perform sub-10ms semantic lookups. - Tools: The agent is equipped with a
search_support_faqsfunction tool that the LLM can call whenever it needs context from the knowledge base. - Voice Pipeline:
- STT: Deepgram Nova-2
- LLM: OpenAI GPT-5
- TTS: Cartesia Sonic-2
To deploy this agent to production, you can use the provided Dockerfile or deploy directly to LiveKit Cloud.
For a full stack example including a React frontend, see the root livekit-moss-vercel directory.