Skip to content

About

AI-powered YouTube Transcript Assistant using RAG, FAISS, LangChain, Ollama, and FastAPI to ask questions and get context-aware answers from YouTube videos.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

ย 

History

9 Commits

Folders and files

Repository files navigation

๐ŸŽฅ YouTube Transcript AI Assistant

Ask Questions About Any YouTube Video Using AI

FastAPI โ€ข LangChain โ€ข Ollama โ€ข FAISS โ€ข RAG

Turn any YouTube video into an intelligent knowledge base and chat with its content.


๐Ÿš€ Overview

YouTube videos contain valuable information, but finding specific insights often requires watching hours of content.

This project solves that problem by combining:

  • YouTube Transcript Extraction
  • Retrieval-Augmented Generation (RAG)
  • FAISS Vector Search
  • Ollama Local LLMs
  • FastAPI Backend

Users can load a YouTube video's transcript into a vector database and ask natural language questions about the video's content.

The system retrieves relevant transcript segments and generates context-aware answers using a local LLM.


โœจ Features

๐Ÿ“บ YouTube Transcript Processing

  • Automatic transcript extraction
  • Support for English transcripts
  • Transcript chunking for efficient retrieval

๐Ÿง  AI-Powered Question Answering

  • Retrieval-Augmented Generation (RAG)
  • Context-aware responses
  • Grounded answers from transcript content
  • Hallucination reduction through retrieval

โšก Fast Semantic Search

  • FAISS Vector Database
  • Embedding-based similarity search
  • Relevant transcript retrieval

๐Ÿค– Local AI Inference

  • Powered by Ollama
  • No OpenAI API required
  • Fully local execution

๐ŸŒ Modern Web Interface

  • Clean responsive UI
  • Real-time interaction
  • FastAPI REST endpoints

๐Ÿ—๏ธ System Architecture

YouTube Video
      โ”‚
      โ–ผ
Transcript Extraction
      โ”‚
      โ–ผ
Text Chunking
      โ”‚
      โ–ผ
Ollama Embeddings
      โ”‚
      โ–ผ
FAISS Vector Store
      โ”‚
      โ–ผ
Similarity Search
      โ”‚
      โ–ผ
Relevant Context
      โ”‚
      โ–ผ
ChatOllama (LLM)
      โ”‚
      โ–ผ
Generated Answer

โš™๏ธ Tech Stack

Backend

  • FastAPI
  • Python
  • Pydantic

AI & RAG

  • LangChain
  • Ollama
  • ChatOllama
  • Ollama Embeddings
  • FAISS

Data Processing

  • YouTube Transcript API
  • Recursive Character Text Splitter

Frontend

  • HTML
  • CSS
  • JavaScript

๐Ÿ“‚ Project Structure

YT-Transcript-AI-Assistant/

โ”œโ”€โ”€ main.py
โ”œโ”€โ”€ requirements.txt
โ”œโ”€โ”€ index.html
โ”œโ”€โ”€ README.md
โ””โ”€โ”€ assets/

๐Ÿ”Œ API Endpoints

Load Video Transcript

POST /load-video

Request

{
  "videolink": "https://www.youtube.com/watch?v=VIDEO_ID"
}

Response

{
  "message": "Video transcript loaded into FAISS.",
  "video_id": "VIDEO_ID",
  "cached": false,
  "chunks": 32
}

Ask Assistant

POST /ask-assistant

Request

{
  "videolink": "https://www.youtube.com/watch?v=VIDEO_ID",
  "target_question": "What is the video about?"
}

Response

{
  "answer": "Generated answer from transcript context"
}

๐Ÿ›  Installation

Clone Repository

git clone https://github.com/your-username/yt-transcript-ai-assistant.git

cd yt-transcript-ai-assistant

Install Dependencies

pip install -r requirements.txt

๐Ÿค– Install Ollama

Download:

https://ollama.com

Pull the model:

ollama pull qwen2.5-coder:3b

Verify:

ollama list

โ–ถ๏ธ Run the Backend

uvicorn main:app --reload

Server starts at:

http://127.0.0.1:8000

๐ŸŒ Run the Frontend

Open:

index.html

Or use:

  • VS Code Live Server
  • Python HTTP Server
python -m http.server 5500

๐Ÿ’ก Example Questions

Summarize this video.

What are the key points discussed?

Explain the main concept.

What technologies were mentioned?

Give me a short overview.

What are the speaker's conclusions?

๐ŸŽฏ Use Cases

  • Educational video summarization
  • Technical tutorial analysis
  • Lecture understanding
  • Research assistance
  • Knowledge extraction
  • Content review
  • Personal learning assistant

๐Ÿ”ฎ Future Improvements

  • Multi-video knowledge base
  • Playlist ingestion
  • Persistent vector storage
  • Chat memory
  • Streaming responses
  • PDF summary export
  • User authentication
  • Docker deployment
  • Multi-language support

๐Ÿ‘จโ€๐Ÿ’ป Author

Nishant Rajora


โญ Support

If you found this project useful:

  • Star the repository
  • Fork the project
  • Share feedback
  • Contribute improvements

Built with โค๏ธ using FastAPI, LangChain, Ollama and FAISS

About

AI-powered YouTube Transcript Assistant using RAG, FAISS, LangChain, Ollama, and FastAPI to ask questions and get context-aware answers from YouTube videos.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages