How prabhukumbar/coursepilot-rag-ai-teaching-assistant works
CoursePilot turns course media into timestamped transcript chunks and an embedding index, then answers student questions with locally hosted Ollama models and cited lesson segments. The browser workflow carries short conversation history and teaching-mode instructions through Flask into retrieval and answer generation; students receive source cards and can optionally play cited audio. The graph also preserves the documented media-ingestion and health-check branches. Unsampled templates and optional runtime details are represented only where README or shown callers establish their role.
Main entry points: app.py Flask API · app.js Chat Interface · rag_engine.py Retrieval and Answering · preprocess_json.py Embedding Index Builder
Components 16
Course Ingestion
- Video to Audio
video_to_mp3.py - Whisper Transcription
mp3_to_json.py - Timestamped Transcripts
jsons
Knowledge Index
- Embedding Index Builder
preprocess_json.py - Embedding Index
preprocess_json.py
Answering Service
- Retrieval and Answering
rag_engine.py - Flask API
app.py - CLI Entry Point
process_incoming.py
Student Interface
- Course Chat Page
templates/index.html - Chat Interface
static/app.js - Source Cards
static/app.js - Cited Audio Playback
static/app.js
Other components
- Student
- Course Media
- Ollama Models
- Local Course Audio
Connections 22
- Student → Chat Interface: asks questions
README.md - Course Media → Video to Audio: converts to audio
README.md - Video to Audio → Whisper Transcription: provides audio
README.md - Whisper Transcription → Timestamped Transcripts: writes chunks
mp3_to_json.py - Timestamped Transcripts → Embedding Index Builder: provides chunks
preprocess_json.py - Embedding Index Builder → Ollama Models: requests embeddings
preprocess_json.py - Embedding Index Builder → Embedding Index: writes index
preprocess_json.py - Chat Interface → Flask API: posts questions
static/app.js - Flask API → Retrieval and Answering: calls answering
app.py - Retrieval and Answering → Embedding Index: loads and searches
rag_engine.py - Retrieval and Answering → Ollama Models: embeds and generates
rag_engine.py - Retrieval and Answering → Flask API: returns answers
app.py - Flask API → Chat Interface: returns JSON
static/app.js - Chat Interface → Source Cards: renders citations
static/app.js - Chat Interface → Flask API: checks health and courses
static/app.js - Flask API → Retrieval and Answering: lists courses and checks Ollama
app.py - Chat Interface → Cited Audio Playback: opens cited segment
static/app.js - Cited Audio Playback → Flask API: requests audio
static/app.js - Flask API → Local Course Audio: serves file
app.py - Student → CLI Entry Point: asks questions
process_incoming.py - CLI Entry Point → Retrieval and Answering: calls answering
process_incoming.py - Course Chat Page → Chat Interface: hosts interface