Ask questions about YouTube videos using Retrieval-Augmented Generation (RAG) powered by Hugging Face models.
- Smart Q&A: Ask questions about any YouTube video content
- Multiple URL Formats: Supports full URLs or just video IDs
- AI-Powered: Uses Mistral-7B and sentence transformers for accurate responses
- User-Friendly: Clean Streamlit interface with real-time feedback
- Flexible Configuration: Environment-based settings
# Create environment
conda create -n rag_pipeline python=3.10 -y
conda activate rag_pipeline
# Install dependencies
conda install numpy scipy scikit-learn -y
pip install -r requirements.txtCreate a .env file:
HUGGINGFACE_TOKEN=your_token_hereGet your token from Hugging Face Settings
streamlit run rag_pipeline.py- Input: Paste a YouTube URL or video ID
- Processing: Extracts transcript and creates vector embeddings
- Query: Ask your question about the video content
- Answer: Get AI-powered responses based on the transcript
https://www.youtube.com/watch?v=VIDEO_IDhttps://youtu.be/VIDEO_IDhttps://www.youtube.com/embed/VIDEO_ID- Just the video ID:
VIDEO_ID
Customize settings in .env:
HUGGINGFACE_TOKEN: Your HF authentication tokenCHUNK_SIZE: Text processing chunk size (default: 800)RETRIEVAL_K: Number of relevant chunks to retrieve (default: 4)MAX_NEW_TOKENS: Maximum response length (default: 512)
- Frontend: Streamlit
- LLM: Mistral-7B-Instruct via Hugging Face
- Embeddings: sentence-transformers/all-MiniLM-L6-v2
- Vector Store: FAISS
- Framework: LangChain
- No transcript available: Some videos don't have captions
- Token errors: Ensure your HF token has proper permissions
- Installation issues: Use the automated setup script
- Python 3.10+
- 4GB+ RAM recommended
- Internet connection for model downloads
- "What are the main topics discussed in this video?"
- "Can you summarize the key points?"
- "What examples were given about [specific topic]?"
- "Who is mentioned in the video?"
Note: This tool only works with videos that have available transcripts/captions.
