Skip to content

Latest commit

Β 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

AI Video Assistant Banner

πŸŽ₯ AI Video Assistant

Transform YouTube videos and local video files into intelligent, searchable knowledge using OpenAI Whisper, LangChain, ChromaDB, and Mistral AI.

Python Streamlit LangChain ChromaDB Whisper Mistral AI


πŸ“Œ Overview

AI Video Assistant is an end-to-end Retrieval-Augmented Generation (RAG) application that transforms YouTube videos and local video files into searchable knowledge.

The application automatically extracts audio from a YouTube URL or a local video file, transcribes speech using OpenAI Whisper, generates semantic embeddings with Sentence Transformers, stores them in ChromaDB, and enables intelligent question answering using LangChain and Mistral AI.

Instead of manually watching long videos, users can quickly:

  • Read AI-generated summaries
  • View complete transcripts
  • Extract action items
  • Identify key decisions
  • Find open questions
  • Chat with the video using natural language

✨ Features

  • πŸŽ₯ Analyze YouTube videos using a URL
  • πŸ“ Analyze local video files (MP4, AVI, MOV, MKV, etc.)
  • πŸŽ™οΈ Automatic speech-to-text transcription using OpenAI Whisper
  • βœ‚οΈ Audio extraction and preprocessing
  • πŸ“ AI-generated structured summaries
  • 🏷️ Automatic title generation
  • πŸ“Œ Extract action items
  • πŸ”‘ Identify key decisions
  • ❓ Detect open questions
  • 🧠 Generate semantic embeddings
  • πŸ“š Store embeddings in ChromaDB
  • πŸ” Retrieval-Augmented Generation (RAG)
  • πŸ’¬ Context-aware conversational AI
  • 🎨 Interactive Streamlit interface

πŸ—οΈ System Architecture

flowchart TD

A[User]

A --> B1[YouTube URL]
A --> B2[Local Video File]

B1 --> C[Download Audio using yt-dlp]

B2 --> D[Extract Audio using FFmpeg]

C --> E[Audio Processing]
D --> E

E --> F[OpenAI Whisper]

F --> G[Transcript]

G --> H[Sentence Transformer Embeddings]

H --> I[ChromaDB Vector Store]

A --> J[Ask Question]

J --> K[LangChain Retriever]

K --> I

I --> L[Relevant Transcript Chunks]

L --> M[Mistral AI]

M --> N[Context-Aware Answer]

N --> A
Loading

βš™οΈ Workflow

                 User Input
                     β”‚
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚                         β”‚
        β–Ό                         β–Ό
  YouTube URL              Local Video File
        β”‚                         β”‚
        β–Ό                         β–Ό
 Download Audio            Extract Audio
      yt-dlp                 FFmpeg
        β”‚                         β”‚
        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                     β–Ό
            Audio Processing
                     β”‚
                     β–Ό
          Whisper Transcription
                     β”‚
                     β–Ό
               Transcript
                     β”‚
                     β–Ό
        Sentence Transformer
             Embeddings
                     β”‚
                     β–Ό
              ChromaDB
                     β”‚
                     β–Ό
            User Question
                     β”‚
                     β–Ό
          Semantic Retrieval
                     β”‚
                     β–Ό
         Relevant Transcript
                     β”‚
                     β–Ό
             Mistral AI LLM
                     β”‚
                     β–Ό
         Context-Aware Answer

πŸ› οΈ Tech Stack

Category Technologies
Programming Language Python 3.11
Frontend Streamlit
Speech Recognition OpenAI Whisper
Audio Processing yt-dlp, FFmpeg, Pydub
Embeddings Sentence Transformers
Vector Database ChromaDB
RAG Framework LangChain
LLM Mistral AI
Deep Learning PyTorch

πŸ“‚ Project Structure

AI-Video-Assistant/
β”‚
β”œβ”€β”€ assets/
β”‚   β”œβ”€β”€ banner.png
β”‚   β”œβ”€β”€ dashboard.png
β”‚   β”œβ”€β”€ summary.png
β”‚   β”œβ”€β”€ chat.png
β”‚   └── rag_answer.png
β”‚
β”œβ”€β”€ core/
β”‚
β”œβ”€β”€ utils/
β”‚
β”œβ”€β”€ downloads/
β”‚
β”œβ”€β”€ vector_db/
β”‚
β”œβ”€β”€ app.py
β”œβ”€β”€ main.py
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ .env.example
└── README.md

πŸ“Έ Screenshots

🏠 Dashboard

Analyze a YouTube URL or a local video file.

The application automatically:

  • Downloads or extracts audio
  • Transcribes speech
  • Generates summaries
  • Extracts insights
  • Builds a searchable knowledge base

Dashboard


πŸ“ AI Summary

Generate professional summaries containing:

  • Key insights
  • Important concepts
  • Practical implications
  • Final takeaways

Summary


πŸ’¬ Chat with the Video

Interact with your video using natural language.

The application retrieves relevant transcript chunks from ChromaDB before generating accurate answers with Mistral AI.

Chat


πŸ” Retrieval-Augmented Generation (RAG)

Every answer is grounded in the video's transcript, providing context-aware and reliable responses.

RAG


πŸš€ Installation

1. Clone Repository

git clone https://github.com/yourusername/AI-Video-Assistant.git

cd AI-Video-Assistant

2. Create Virtual Environment

Windows

python -m venv venv

venv\Scripts\activate

Linux / macOS

python3 -m venv venv

source venv/bin/activate

3. Install Dependencies

pip install -r requirements.txt

4. Install FFmpeg

Download and install FFmpeg.

Verify installation:

ffmpeg -version

5. Configure Environment Variables

Create a .env file.

MISTRAL_API_KEY=your_api_key

SARVAM_API_KEY=your_api_key

▢️ Run the Application

streamlit run app.py

πŸ’‘ Example Usage

Analyze a YouTube Video

https://www.youtube.com/watch?v=XXXXXXXX

Analyze a Local Video

Windows

C:\Users\Heet\Videos\lecture.mp4

Linux/macOS

/home/user/videos/lecture.mp4

Click Analyze.

The application will automatically:

  • Extract audio
  • Generate transcript
  • Create AI summary
  • Extract action items
  • Identify key decisions
  • Detect open questions
  • Build a vector database
  • Enable conversational AI

🌟 Future Improvements

  • 🌍 Multi-language transcription
  • 🎀 Speaker diarization
  • ⏱️ Timestamp-based transcript navigation
  • πŸ“„ PDF summary export
  • πŸ’Ύ Download transcript and chat history
  • πŸ€– Multiple LLM support
  • ☁️ Cloud deployment
  • πŸ” User authentication
  • πŸ“Ί Playlist and batch video processing
  • πŸ“± Responsive mobile interface

🀝 Contributing

Contributions are welcome!

  1. Fork the repository

  2. Create a new branch

git checkout -b feature-name
  1. Commit your changes
git commit -m "Add new feature"
  1. Push your branch
git push origin feature-name
  1. Open a Pull Request

πŸ‘¨β€πŸ’» Author

Heet Patel


⭐ If you found this project useful, please consider giving it a star!

About

Transform YouTube videos and local video files into searchable knowledge using Whisper, LangChain, ChromaDB, and Mistral AI.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages