This project implements a complete RAG (Retrieval-Augmented Generation) pipeline designed to "chat" with audio content. It processes audio data, transcribes it using AI, and creates a searchable vector database to answer user queries with high precision.
Based on the development workflow:
- Audio Transcription: Using OpenAI Whisper to translate and transcribe
.mp3files. - Data Chunking: Breaking down long video/audio files into smaller segments with preserved metadata.
- Vector Embeddings: Generating 1024-dimensional embeddings using the BGE-M3 model via Ollama.
- Database Management: Using Pandas for bulk loading and Joblib for efficient dataframe serialization.
- Semantic Search: Implementing Cosine Similarity to retrieve the most relevant video chunks for any user question.
- LLM Integration: Feeding retrieved context into a Large Language Model to generate human-like responses.
- LLM/Embeddings: Ollama (BGE-M3 & Llama 3)
- Transcription: OpenAI Whisper
- Data Handling: Pandas, NumPy, Joblib
- Vector Math: Scikit-Learn (Cosine Similarity)
- Environment: Anaconda Python 3.x
Ensure you have Ollama installed and the embedding model pulled: ollama pull bge-m3
- Transcription: Convert video/audio to text chunks.
- Embedding: Run the script to generate vectors for each chunk.
- Saving: The dataframe is saved as embeddings.joblib for persistent storage.
- Querying: Run process_incoming.py to ask questions.
- User Query: The user asks a question via the terminal.
- Embedding: Run the script to generate vectors for each chunk.
- Retrieval: The system compares the query vector against the stored database (5,916 vectors).
- Augmentation: Top matching chunks are pulled and formatted into a prompt.
- Generation: The LLM reads the chunks and provides a factual answer based on the video content.