Back to Index
StreamlitLangChainQwen 2.5FAISSHugging Face

YouTube RAG

The Problem

Extracting specific insights from long-form YouTube videos—especially in foreign languages—is incredibly tedious. Standard LLMs hallucinate because they lack the video's direct context, and manually reading auto-generated transcripts is unscalable.

The Hard Constraint

The pipeline needed to seamlessly extract, chunk, and embed YouTube transcripts across 10 different languages on-the-fly, storing them in an ephemeral vector database for instantaneous retrieval-augmented generation.

Architecture

[YouTube URL] │ ▼ [Transcript Extractor (10 Languages)] │ ▼ [Text Splitter (Semantic Chunking)] │ ▼ [HF Sentence Transformers] ──► [FAISS Vector DB] │ ▼ [User Query] ────────────────► [Semantic Search] │ ▼ [Qwen 2.5 Instruct LLM] │ ▼ [Context-Aware Answer]

Results & Caveats

The Outcome

Successfully engineered a multi-lingual RAG pipeline. The local FAISS database provides lightning-fast semantic retrieval, allowing Qwen 2.5 to generate accurate, context-bound answers directly from the video source.

Honest Caveats

The initial transcript extraction and vector embedding phase introduces a bottleneck for extremely long videos (e.g., 3-hour podcasts), causing a slight delay before the chat interface becomes fully interactive.