how to use a live model + rag
# ask-ai
p
how to use a live model + rag
t
Thanks for reaching out, Minas. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'm excited to help you get started with using a live model alongside Retrieval-Augmented Generation (RAG) in LiveKit! Here’s a friendly step-by-step guide to walk you through the process: 1. Set Up the Real-Time Model: Begin by choosing a real-time LLM like OpenAI’s GPT or Google’s Gemini Live API. These models are fantastic because they can process audio input and output instantly, making your voice interactions feel natural and dynamic. 2. Implement the RAG Pipeline: Next, create a vector database using embeddings to organize your documents. When a conversation happens, this setup helps retrieve the most relevant info from your database and seamlessly adds it to the LLM’s context before crafting a response. 3. Integrate Real-Time Model with RAG: Then, connect everything by using a VoicePipelineAgent configured with your real-time LLM. You’ll want to set up a function that triggers RAG lookups right when they’re needed, and also manage how the user experiences this—like playing audio clips or generating dynamic messages to keep things engaging. 4. Explore Examples: To make things even easier, feel free to explore some helpful examples like llamaindex-rag and LiveKit Docs RAG. They provide wonderful, detailed implementations to inspire your setup. Following these steps will empower you to build intelligent, responsive voice agents that can answer questions using fresh and domain-specific knowledge. If you have any questions along the way, I’m here to help! Sources: agent_extensions/agent_extensions/rag/builder.py | External data and RAG | LiveKit Docs | Using the Testing Framework with Realtime Models