Skip to content

Vinit-007/Youtube-Rag-Chrome-Extension

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

YouTube RAG Chrome Extension

A full-stack Retrieval-Augmented Generation (RAG) application that allows you to chat with YouTube videos in real-time. It seamlessly integrates a Python backend (for transcript extraction, local embeddings, and LLM inference) with a Chrome Extension frontend embedded directly in the YouTube interface.

Prerequisites

  • Python 3.9+
  • Ollama installed and running on your system.
  • Google Chrome browser.

Installation & Setup

1. Clone the Repository

git clone https://github.com/Vinit-007/Youtube-Rag-Chrome-Extension
cd youtube-rag

2. Set Up the Python Environment

Create and activate a virtual environment:

python -m venv venv

# On Windows:
.\venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activate

3. Install Dependencies

pip install -r requirements.txt

4. Pull the Local LLM

Ensure Ollama is running, then download the model required for this project:

ollama pull llama3.2:1b

Running the Application

1. Start the Backend Server

The Python backend handles transcript downloads, chunking, embedding generation, and answering questions. Keep this running in the background.

# Ensure your virtual environment is active
python -m app.server

The server will start listening on http://127.0.0.1:8765.

2. Load the Chrome Extension

To interact with the RAG pipeline directly from your browser:

  1. Open Google Chrome.
  2. Go to chrome://extensions/ in the address bar.
  3. Toggle Developer mode to ON (top right corner).
  4. Click the Load unpacked button (top left).
  5. Select the chrome-extension folder located inside this project directory.

How to Use

  1. Go to YouTube and open any video that contains an English transcript or closed captions.
  2. Look for the newly added AI Assistant UI on the page.
  3. Type your question about the video's content into the chatbox and press Ask.
  4. The extension will send the video URL and your question to the local backend, retrieve relevant chunks from the video transcript, and stream an AI-generated answer back to your screen.

Exploring the Pipeline

If you want to understand how the RAG pipeline operates without the server or UI, open the Main.ipynb Jupyter Notebook. It provides a step-by-step walkthrough of transcript loading, text splitting, embedding storage, and query retrieval.


Note: Since embeddings are processed locally using CPU (via FAISS and Sentence Transformers), the initial load and processing time for a new video depends on the video's length and your system's hardware.

About

A full-stack RAG application that allows you to chat with YouTube videos in real-time. It seamlessly integrates a Python backend (for transcript extraction, local embeddings, and LLM inference) with a Chrome Extension frontend embedded directly in the YouTube interface.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors