Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RAG: Retrieval-Augmented Generation System

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.


Project Milestones

Based on the development workflow:

  • Audio Transcription: Using OpenAI Whisper to translate and transcribe .mp3 files.
  • 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.

🛠️ Tech Stack

  • 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

Getting Started

1. Prerequisites

Ensure you have Ollama installed and the embedding model pulled: ollama pull bge-m3

2. Project Pipeline

  • 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.

3. System Architecture

  • 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.

About

this repository is created to pursue AI project - RAG based teaching assistant

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages