Skip to content

ahmertsengol/Youtube-comment-RAG

Repository files navigation

YouTube Channel RAG Tool

A RAG (Retrieval Augmented Generation) tool that scrapes YouTube channel videos, extracts transcripts, and enables AI-powered chat interactions using Google's Gemini API.

Python License Version Gemini API

Features

  • Extract video lists from YouTube channels using Apify
  • Automatically fetch transcripts using free YouTube Transcript API
  • AI-powered content search with Gemini API
  • Interactive terminal chat interface with markdown support
  • Local transcript storage

Quick Start

Prerequisites

Installation

# Clone repository
git clone <repo-url>
cd Youtube-comment-RAG

# Install dependencies
pip install -r requirements.txt

# Configure API keys
cp .env.example .env
# Edit .env and add your API keys

Usage

Scrape videos and chat:

python main.py

Chat with existing transcripts:

python chat.py

Test single video (no Apify needed):

python -m tests.test_transcript

Example Questions

  • "What are the main topics covered in these videos?"
  • "What did the creator say about [topic]?"
  • "Which videos mention [keyword]?"
  • "Compare approaches discussed in different videos"

Project Structure

├── main.py              # Main orchestration script
├── chat.py              # Standalone chat interface
├── youtube_scraper.py  # Transcript extraction
├── gemini_rag.py       # Gemini API integration
├── tests/              # Test files
├── utils/              # Utility scripts
└── docs/               # Documentation

License

MIT License - see LICENSE file for details.

For complete license and legal information including third-party licenses, see LICENSE_INFO.md.

Contributing

Contributions welcome! See CONTRIBUTING.md for guidelines.

Support

About

A powerful RAG tool that scrapes YouTube channel videos, extracts transcripts, and enables AI-powered chat interactions using Google's Gemini API.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Sponsor this project

Packages

 
 
 

Contributors