FastAPI โข LangChain โข Ollama โข FAISS โข RAG
Turn any YouTube video into an intelligent knowledge base and chat with its content.
YouTube videos contain valuable information, but finding specific insights often requires watching hours of content.
This project solves that problem by combining:
- YouTube Transcript Extraction
- Retrieval-Augmented Generation (RAG)
- FAISS Vector Search
- Ollama Local LLMs
- FastAPI Backend
Users can load a YouTube video's transcript into a vector database and ask natural language questions about the video's content.
The system retrieves relevant transcript segments and generates context-aware answers using a local LLM.
- Automatic transcript extraction
- Support for English transcripts
- Transcript chunking for efficient retrieval
- Retrieval-Augmented Generation (RAG)
- Context-aware responses
- Grounded answers from transcript content
- Hallucination reduction through retrieval
- FAISS Vector Database
- Embedding-based similarity search
- Relevant transcript retrieval
- Powered by Ollama
- No OpenAI API required
- Fully local execution
- Clean responsive UI
- Real-time interaction
- FastAPI REST endpoints
YouTube Video
โ
โผ
Transcript Extraction
โ
โผ
Text Chunking
โ
โผ
Ollama Embeddings
โ
โผ
FAISS Vector Store
โ
โผ
Similarity Search
โ
โผ
Relevant Context
โ
โผ
ChatOllama (LLM)
โ
โผ
Generated Answer
- FastAPI
- Python
- Pydantic
- LangChain
- Ollama
- ChatOllama
- Ollama Embeddings
- FAISS
- YouTube Transcript API
- Recursive Character Text Splitter
- HTML
- CSS
- JavaScript
YT-Transcript-AI-Assistant/
โโโ main.py
โโโ requirements.txt
โโโ index.html
โโโ README.md
โโโ assets/
POST /load-video{
"videolink": "https://www.youtube.com/watch?v=VIDEO_ID"
}{
"message": "Video transcript loaded into FAISS.",
"video_id": "VIDEO_ID",
"cached": false,
"chunks": 32
}POST /ask-assistant{
"videolink": "https://www.youtube.com/watch?v=VIDEO_ID",
"target_question": "What is the video about?"
}{
"answer": "Generated answer from transcript context"
}git clone https://github.com/your-username/yt-transcript-ai-assistant.git
cd yt-transcript-ai-assistantpip install -r requirements.txtDownload:
https://ollama.com
Pull the model:
ollama pull qwen2.5-coder:3bVerify:
ollama listuvicorn main:app --reloadServer starts at:
http://127.0.0.1:8000
Open:
index.html
Or use:
- VS Code Live Server
- Python HTTP Server
python -m http.server 5500Summarize this video.
What are the key points discussed?
Explain the main concept.
What technologies were mentioned?
Give me a short overview.
What are the speaker's conclusions?
- Educational video summarization
- Technical tutorial analysis
- Lecture understanding
- Research assistance
- Knowledge extraction
- Content review
- Personal learning assistant
- Multi-video knowledge base
- Playlist ingestion
- Persistent vector storage
- Chat memory
- Streaming responses
- PDF summary export
- User authentication
- Docker deployment
- Multi-language support
If you found this project useful:
- Star the repository
- Fork the project
- Share feedback
- Contribute improvements
Built with โค๏ธ using FastAPI, LangChain, Ollama and FAISS