How gayatripachpande99/rag-based-ai-teaching-assistant works
This is a RAG teaching assistant for finding course material in video subtitles. The main workflow converts course videos into timestamped transcript chunks, embeds them for retrieval, then answers a learner’s question with relevant video and timestamp references. Learners can use either the Flask web chat or the Streamlit app; a separate CLI script offers another query path. The README documents the ingestion stages, while the sampled sources show retrieval and response generation. The audio, JSON, and video directories are documented or referenced in code but are not present in the tree.
Main entry points: process_incoming.py CLI Assistant · app.py Flask Assistant · script.js Chat Client · embeddings.joblib Embedding Index
Components 16
Media Ingestion
- Video Converter
video_to_mp3.py - Transcriber
mp3_to_json.py
Knowledge Index
- Index Builder
preprocess_json.py - Embedding Index
embeddings.joblib
Assistant Interfaces
- Web Chat UI
templates/index.html - Chat Client
static/js/script.js - Flask Assistant
app.py - Streamlit Assistant
streamlit_app.py - CLI Assistant
process_incoming.py
AI Services
- Ollama
Other components
- Learner
- Course Videos
- Audio Files
- Transcript Chunks
- Prompt Output
prompt.txt - Response Output
response.txt
Connections 21
- Course Videos → Video Converter: converts
- Video Converter → Audio Files: writes audio
- Audio Files → Transcriber: transcribes
- Transcriber → Transcript Chunks: writes chunks
- Transcript Chunks → Index Builder: reads chunks
- Index Builder → Ollama: requests embeddings
- Index Builder → Embedding Index: writes index
- Learner → Chat Client: asks question
- Web Chat UI → Chat Client: hosts chat
- Chat Client → Flask Assistant: posts query
- Flask Assistant → Embedding Index: loads and searches
- Flask Assistant → Ollama: embeds and generates
- Flask Assistant → Chat Client: returns answer
- Learner → Streamlit Assistant: asks question
- Streamlit Assistant → Embedding Index: loads and searches
- Streamlit Assistant → Ollama: embeds and generates
- Learner → CLI Assistant: asks question
- CLI Assistant → Embedding Index: loads and searches
- CLI Assistant → Ollama: embeds and generates
- CLI Assistant → Prompt Output: writes prompt
- CLI Assistant → Response Output: writes response