๐ Click here to follow our complete step-by-step tutorial and learn how to build this from scratch with detailed code walkthroughs, explanations, and best practices.
Sign in to save downloads to your library and vote.
Preview
๐๏ธ Voice RAG with OpenAI SDK
๐ FREE Step-by-Step Tutorial
๐ Click here to follow our complete step-by-step tutorial and learn how to build this from scratch with detailed code walkthroughs, explanations, and best practices.
This script demonstrates how to build a voice-enabled Retrieval-Augmented Generation (RAG) system using OpenAI's SDK and Streamlit. The application allows users to upload PDF documents, ask questions, and receive both text and voice responses using OpenAI's text-to-speech capabilities.
Features
- Creates a voice-enabled RAG system using OpenAI's SDK
- Supports PDF document processing and chunking
- Uses Qdrant as the vector database for efficient similarity search
- Implements real-time text-to-speech with multiple voice options
- Provides a user-friendly Streamlit interface
- Allows downloading of generated audio responses
- Supports multiple document uploads and tracking
How to get Started?
- Clone the GitHub repository
git clone https://github.com/Shubhamsaboo/awesome-llm-apps.git
cd awesome-llm-apps/voice_ai_agents/voice_rag_openaisdk
- Install the required dependencies:
pip install -r requirements.txt
- Set up your API keys:
- Get your OpenAI API key
- Set up a Qdrant Cloud account and get your API key and URL
- Create a
.envfile with your credentials:
OPENAI_API_KEY='your-openai-api-key'
QDRANT_URL='your-qdrant-url'
QDRANT_API_KEY='your-qdrant-api-key'
- Run the Voice RAG application:
streamlit run rag_voice.py
- Open your web browser and navigate to the URL provided in the console output to interact with the Voice RAG system.
How it works?
-
Document Processing:
- Upload PDF documents through the Streamlit interface
- Documents are split into chunks using LangChain's RecursiveCharacterTextSplitter
- Each chunk is embedded using FastEmbed and stored in Qdrant
-
Query Processing:
- User questions are converted to embeddings
- Similar documents are retrieved from Qdrant
- A processing agent generates a clear, spoken-word friendly response
- A TTS agent optimizes the response for speech synthesis
-
Voice Generation:
- Text responses are converted to speech using OpenAI's TTS
- Users can choose from multiple voice options
- Audio can be played directly or downloaded as MP3
-
Features:
- Real-time audio streaming
- Multiple voice personality options
- Document source tracking
- Download capability for audio responses
- Progress tracking for document processing
Ingestion metadata
- Source catalog
- awesome-llm-apps
- Repository
- Shubhamsaboo/awesome-llm-apps ยท main
- File path
- voice_ai_agents/voice_rag_openaisdk/README.md
- Last refreshed
- 7/23/2026, 8:42:18 PM (6h ago)
- Refresh schedule
- Daily ยท 03:00 UTC
- Dedupe status
- Unique ยท deduped by (source, url)