VidSynth AI is a YouTube content synthesizer that turns any public video into structured knowledge. It can summarize long-form content into bullet-point notes, extract the most important topics, or let you chat with the video through a Retrieval-Augmented Generation (RAG) workflow powered by Gemini models.
- Transcript ingestion
Fetches captions for a YouTube video using
youtube-transcript-api, handling multiple language codes. - On-demand translation
Converts non-English transcripts to English with the Gemini
gemini-2.5-flash-litechat model. - Summaries and notes Produces human-friendly highlights and study notes tailored to the video content.
- Topic extraction Distills the top five topics discussed in the source video.
- Conversational RAG chatbot Splits transcripts into chunks, stores them in an in-memory Chroma vector store, and answers questions about the video context.
- Multiple runtime options
Includes a
Streamlitinterface (app.py) and a production-readyFlaskbackend (flask_app.py) with static assets (index.html,style.css,script.js).
project-root/
├── app.py # Streamlit front-end
├── flask_app.py # Flask API + static site
├── supporting_functions.py # Transcript, translation, RAG utilities
├── index.html # Front-end served by Flask
├── style.css
├── script.js
├── requirements.txt
├── runtime.txt # Python version for deployment
├── Procfile # Process definition for Render/Heroku-like platforms
├── render.yaml # Render.com deployment blueprint
├── simple_test.py # Local sanity test for vector store creation
└── ...
- Python
3.11.x(seeruntime.txt) - A Google Generative AI API key with access to Gemini models
pipfor dependency management
-
Clone and enter the project
git clone <your-fork-url> cd project-3-youtube-rag
-
Create a virtual environment (recommended)
python -m venv .venv .venv\Scripts\activate # Windows
-
Install dependencies
pip install -r requirements.txt
-
Configure environment variables Create a
.envfile in the project root with your API key:GOOGLE_API_KEY=your-google-generative-ai-key
Important: Do not commit the
.envfile. The included.envis for local reference only—replace the placeholder key with your own credentials.
- Start the Streamlit app:
streamlit run app.py
- Open the provided local URL in your browser.
- Paste a YouTube link, choose the language code, and select either Chat with Video or Notes For You.
- Ensure the
.envfile is present. - Launch the Flask server:
python flask_app.py
- Navigate to
http://localhost:5000for the full web experience, or interact with the REST endpoints directly (e.g.,POST /api/transcript,POST /api/chat).
Run the lightweight vector store sanity check with:
python simple_test.pyThis script validates that chunking, embedding creation, and similarity search succeed with the current dependencies.
render.yamldefines a starter Render service that installs requirements and startsflask_app.py.Procfilecontains the same start command for Heroku-style platforms.- Add
GOOGLE_API_KEYas a Render environment variable (markedsync: falseto populate it manually in the dashboard).
- Invalid YouTube URL: Ensure the link is public and contains a valid video ID. The helper
extract_video_id()insupporting_functions.pyexpects standard YouTube URL formats. - Transcript fetch failures: Some videos disable transcripts or restrict them by region/language. Try another language code or video.
- Gemini API errors: Verify your API key, project quota, and network connectivity.
- Chat responses missing: Confirm the vector store was created. In Streamlit, the chatbot becomes available after the transcript is processed and chunks are indexed.
Specify your preferred license here before publishing (e.g., MIT, Apache 2.0). Remember to add a dedicated LICENSE file if needed.