Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎬 YouTube Video RAG – Ask Your Videos Anything

A Retrieval-Augmented Generation (RAG) application that enables users to interact with YouTube videos through natural language conversations.

The application extracts video transcripts, converts them into vector embeddings, stores them in a vector database, and uses a local Large Language Model (LLM) to answer user questions contextually.

Built using Streamlit, LangChain, ChromaDB, HuggingFace embeddings, and Ollama.


🚀 Features

  • 🔗 Accepts YouTube video URLs
  • 📝 Automatically fetches video transcripts
  • ✂️ Splits transcripts into semantic chunks
  • 🧠 Generates embeddings using HuggingFace models
  • 📦 Stores embeddings in Chroma Vector Database
  • 🔍 Performs semantic similarity search
  • 🤖 Uses Ollama-powered local LLMs for question answering
  • 💬 Supports conversational Retrieval-Augmented Generation (RAG)
  • 📎 Displays retrieved source chunks for transparency
  • 🎨 Interactive Streamlit-based interface

🛠️ Tech Stack

Frontend

  • Streamlit

LLM & RAG

  • LangChain
  • Ollama
  • ConversationalRetrievalChain

Embeddings

  • HuggingFace Sentence Transformers
  • all-MiniLM-L6-v2

Vector Database

  • ChromaDB

Data Processing

  • YouTube Transcript API
  • Pytube

📂 Project Structure

youtube_rag/
│
├── app.py
├── config.py
├── requirements.txt
│
├── data/
│
├── chroma_db/
│
├── src/
│   ├── embeddings.py
│   ├── qa_chain.py
│   ├── retriever.py
│   ├── text_splitter.py
│   ├── transcript_loader.py
│   └── vector_store.py
│
└── utils/
    └── helpers.py

⚙️ Installation

1. Clone the Repository

git clone <your-repository-url>
cd youtube_rag

2. Create Virtual Environment

py -3.11 -m venv venv

Activate the environment:

Windows

venv\Scripts\activate

3. Install Dependencies

pip install -r requirements.txt

🤖 Install Ollama

Download and install Ollama:

https://ollama.com/

Pull a model:

ollama pull mistral

or

ollama pull gemma:2b

▶️ Run the Application

Start the Streamlit app:

streamlit run app.py

Open the application in your browser:

http://localhost:8501

🧠 How It Works

  1. User enters a YouTube video URL
  2. Transcript is fetched using YouTube Transcript API
  3. Transcript is split into smaller chunks
  4. Embeddings are generated for each chunk
  5. Embeddings are stored in ChromaDB
  6. User asks questions about the video
  7. Relevant chunks are retrieved using semantic search
  8. Ollama generates contextual answers using retrieved information

📸 Example Queries

  • Summarize the video
  • What are the key points discussed?
  • Explain the main concept
  • What tools were mentioned?
  • Give actionable insights from the video

👨‍💻 Author

Nimish Pathak

About

A YouTube Video RAG application built with Streamlit, LangChain, ChromaDB, HuggingFace Embeddings, and Ollama. Extracts video transcripts, creates vector embeddings, and enables conversational Q&A over YouTube content using Retrieval-Augmented Generation (RAG).

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages