Voice Assistant with RAG, LiveKit, and OpenAI Chat or talk with your own documents using Retrieval-Augmented Generation (RAG), Pinecone, OpenAI, and LiveKit. Includes a Streamlit chat UI and a real-time voice agent for LiveKit rooms.
LiveKit chat interaction
System-flow
RAG+LiveKit+openAI/
├── KMS/ # (Custom folder, not used by core code)
├── pdfs/ # Place your PDF files here for ingestion
├── venv/ # Python virtual environment (auto-generated)
├── .env # Environment variables (not committed)
├── app.py # Streamlit chat UI for RAG
├── livekit_agent.py # LiveKit voice agent backend
├── main_load.py # Loads and indexes PDFs into Pinecone
├── requirements.txt # Python dependencies
├── test1.py # (Your test scripts)
├── test2.py
├── test3.py
└── Images ... # (Your images, not used by code)
├── THIS_IS_FOR_MAKE_IT_RUN_LOCAL # (Check this file to run the project locally -- token and room id generation)
git clone https://github.com/yourusername/your-repo.git
cd RAG+LiveKit+openAIpython -m venv venv
venv\Scripts\activate # On Windows
# or
source venv/bin/activate # On Mac/Linux
pip install -r requirements.txtCreate a .env file in the root directory with your keys:
PINECONE_API_KEY=your-pinecone-key
OPENAI_API_KEY=your-openai-key
LIVEKIT_URL=your-livekit-url
LIVEKIT_API_KEY=your-livekit-api-key
LIVEKIT_API_SECRECT=your-live-api-secrect
Place your PDF files inside the pdfs/ folder.
Run the loader to split and index your PDFs into Pinecone:
python main_load.pystreamlit run app.pyOpen the local URL shown in your browser.
Ask questions about your documents!
python livekit_agent.py devThis will start the backend agent that listens and responds in a LiveKit room.
You can use the LiveKit Playground to easily test your voice agent:
- Open LiveKit Playground in your browser.
- Create a new room (choose any room name, e.g.,
my-room). - Join the room with your browser client.
- Start your agent with the same room name (see above).
- You can now interact with your agent in real time using your browser and microphone.
This is a quick way to test your LiveKit agent without building a custom frontend.
Just make sure the room name in the Playground matches the one your agent joins.
-
app.py
Streamlit web UI for chatting with your document knowledge base. -
main_load.py
Loads PDFs frompdfs/, splits them, and indexes them into Pinecone. -
livekit_agent.py
Backend agent that joins a LiveKit room and answers questions using RAG and OpenAI. -
requirements.txt
All Python dependencies. -
test1.py, test2.py, test3.py
Your test scripts (not required for main workflow).
-
No results from Pinecone:
- Ensure your namespace, index name, and embedding model match in all scripts.
- Check
main_load.pyoutput for successful indexing.
-
Streamlit errors:
- Make sure your
.envfile is set up and dependencies are installed.
- Make sure your
-
LiveKit errors:
- Ensure your LiveKit server is running and accessible.

