✦

SAAD ELGHABA

Portfolio

Loading... 0%

AI Automation / Developer Tools

YouTube Knowledge Base Builder (AI Summarizer)

YouTube Knowledge Base Builder (AI Summarizer)

An automated, configurable Python pipeline that mines YouTube channels for actionable business knowledge. It downloads videos, processes them with Gemini AI, and generates structured Markdown summaries of SaaS ideas, RaaS models, tools, and financial figures.

Category

AI Automation / Developer Tools

Technologies

Python, Node.js

The Challenge

Extracting actionable business knowledge and SaaS ideas from hundreds of hours of YouTube content is incredibly time-consuming. Watching 130+ hours of video to find a few golden insights is inefficient and unscalable for entrepreneurs and analysts.

Strategic Approach

Developed a configurable, modular Python pipeline that uses yt-dlp for extraction, ffmpeg for audio chunking, and the Gemini API for AI analysis. It automatically generates structured Markdown summaries of business ideas, tools, and figures, complete with timestamps

Measurable Outcomes

Successfully generated 146 structured summaries for the first channel. Achieved a 7.6x speedup in metadata fetching using early-stop logic and caching. Resolved complex DRM and rate-limit issues, resulting in a stable, RAG-ready database

Overview

Project Overview

The YouTube Knowledge Base Builder is a highly configurable, AI-powered tool designed to eliminate the hours wasted watching long-form content (podcasts, live streams, tutorials) just to extract a few business ideas. It automates the extraction, processing, and structuring of YouTube videos into a queryable, RAG-ready Markdown database.

The Problem: Information Overload

Following tech and business influencers (like @GregIsenberg or @YounessKasmi) means dealing with massive amounts of content. Watching 190 videos of 40 minutes each takes roughly 130 hours. Manually taking notes, tracking timestamps, and extracting SaaS/RaaS ideas from 4-hour live streams in Darija or English is simply unscalable.

The Solution: An AI-Powered Knowledge Miner

I built a modular Python codebase that automates the entire workflow:

  • Extraction: Uses yt-dlp to list every video, Short, and live stream from a channel.
  • Smart Filtering: Applies date, duration, and view filters to only process relevant videos (e.g., only 2026+ videos).
  • AI Processing: Downloads the audio and sends it to the Gemini API (using the generous gemini-3.5-flash-lite free tier).
  • Structuring: Forces the AI to output strict Markdown, including business ideas, models, tools mentioned, and financial figures—all with exact timestamps.
  • Consolidation: Merges everything into a single tous_les_resumes.md file, ready to be dropped into NotebookLM or Claude Projects.

Technical Challenges & Solutions

  • API Rate Limits (429/503): Implemented exponential backoff and retry logic using the official Google GenAI SDK to handle temporary overloads and quota limits.
  • Massive Files (4h+ Live Streams): Gemini has a 1M token limit. I built an automatic chunking system using ffmpeg to split long audio into smaller MP3 chunks, process them individually, and re-encode them to prevent MIME ambiguity issues.
  • YT-DLP JavaScript Challenges: Configured Deno as a JS runtime to bypass YouTube's 2026+ anti-bot challenges.
  • Performance Optimization: Implemented an early-stop metadata enrichment (since YouTube lists newest videos first) and persistent JSON caching, resulting in a 7.6x speedup (fetching 828 videos reduced to only 106 API calls).

Key Features

  • Multi-Channel Support: Switch channels instantly by loading a different config.toml file.
  • Hybrid Categorization: Uses free keyword matching and LLM classification to filter out vlogs and keep only SaaS, AI, and Business topics.
  • Hot-Swappable Prompts: Prompts are written in JavaScript and executed via Node.js, allowing for rapid iteration without touching the Python codebase.
  • Desktop Notifications: Integrated with notify-send (Linux) to monitor the session progress in real-time.

Impact & Results

The tool successfully processed 146 videos from the first channel, turning them into a highly structured, searchable knowledge base. It is currently configured and ready for a second channel of 828 videos. What used to take months of passive watching now yields a queryable database of SaaS and RaaS ideas in a few hours.

Related Services

API Development & Integration

Let's Create Something Extraordinary

Have a project in mind? Let's discuss how we can bring your vision to life.

Start a Project
YouTube Knowledge Base Builder (AI Summarizer)