A context-aware AI learning assistant that extracts relevant content from YouTube videos based on timestamps and provides intelligent Q&A capabilities.
👉 Try the hosted app here: Kriar-Learning-Assistant (Streamlit)
- 🎥 YouTube video integration with transcript extraction
- 🎯 Timestamp-based context extraction
- 🤖 AI-powered Q&A using video context
- 💻 Code assistance and review
- 📊 Session tracking and statistics
- 🔧 Multiple AI model provider support (OpenAI, Groq, Google)
How to get Groq API Key for Free: https://www.youtube.com/watch?v=TTG7Uo8lS1M
pip install -r requirements.txt
- Copy
.env.template
to.env
- Add your API keys for the model providers you want to use:
- For OpenAI: Add your API key to
API_KEY
- For Groq: Add your API key to
GROQ_API_KEY
- For Google AI: Add your API key to
GOOGLE_API_KEY
- For OpenAI: Add your API key to
streamlit run app.py
The application will open in your browser at http://localhost:8501
- Enter a YouTube URL in the video section
- Click "Load Video" to extract the transcript
- Wait for the success message confirming transcript extraction
- Go to the Q&A Chat tab
- Ask questions about the video content
- The AI will use the context from timestamp to provide accurate answers
- Check "Use current timestamp" to automatically include timestamp context
- Use the Code Assistant tab for programming questions
- Enter code in the text area
- Use "Review Code" or "Get Help" buttons for AI assistance
app.py
: Main Streamlit application with UI and session managementmodel.py
: AI model wrapper supporting OpenAI, Groq, and Google AIcontext_extractor.py
: YouTube transcript extraction and timestamp-based context analysisagent.py
: LangGraph-based AI agent for intelligent, context-aware responsestools.py
: Additional tools for Wikipedia search
- Video Loading: The system extracts the full transcript from YouTube videos
- Timestamp Context: When you set a timestamp, it finds relevant transcript segments around that time
- Context-Aware Responses: The AI agent uses this specific context to answer your questions
- Smart Integration: All components work together through LangGraph workflows
The application uses LangGraph to create a stateful AI agent that:
- Extracts relevant context from video transcripts at specific timestamps
- Optimizes user queries for better understanding
- Provides context-aware responses using the video content
- Integrates with external tools when needed
- "No transcript available": Some YouTube videos don't have transcripts
- API Key Errors: Make sure your
.env
file has valid API keys - Import Errors: Run
pip install -r requirements.txt
to install all dependencies - Video Loading Issues: Check that the YouTube URL is valid and the video is public
- Refresh the Streamlit page if you encounter session state issues
- Check your internet connection for API calls
- Verify that your API keys have sufficient credits/quota
- Try a different YouTube video if transcript extraction fails
- Requires: OpenAI API key
- Models: GPT-3.5-turbo, GPT-4, etc.
- Set
API_KEY
in your.env
file
- Requires: Groq API key
- Fast inference with various open-source models
- Set
GROQ_API_KEY
in your.env
file
- Requires: Google AI API key
- Models: Gemini and other Google AI models
- Set
GOOGLE_API_KEY
in your.env
file
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is open source and available under the MIT License.
If you encounter any issues or have questions, please check the troubleshooting section above or create an issue in the repository.