How chanakya2906/rag-based-ai-teaching-assistant works
This repository implements a local video-lecture RAG workflow: extract audio from videos, transcribe and timestamp it into chunks, embed those chunks into a persisted store, then retrieve relevant passages and generate cited answers through Ollama. inspect_embeddings.py provides a separate search-and-inspection utility over the same store. Relationships below are grounded in the sampled scripts; the README is empty, so no additional capabilities are documented.
Main entry points: rag_chat.py Interactive RAG chat · transcribe_chunks.py Whisper transcription · generate_embeddings.py Embedding generation · inspect_embeddings.py Store inspection
Components 17
Media preparation
- Audio extraction
process_video.py - Whisper transcription
transcribe_chunks.py - Timestamped chunks
transcribe_chunks.py
Transcript indexing
- Chunk loading
generate_embeddings.py - Embedding generation
generate_embeddings.py - Embedding store
generate_embeddings.py
Question answering
- Interactive RAG chat
rag_chat.py - Similarity retrieval
rag_chat.py - Grounded prompt
rag_chat.py - Streaming answer
rag_chat.py - Store inspection
inspect_embeddings.py
Other components
- Video files
- MP3 audio
- Whisper model
- Chunk JSON
- BGE-M3 model
- Ollama service
Connections 18
- Video files → Audio extraction: provides videos
process_video.py - Audio extraction → MP3 audio: writes MP3
process_video.py - MP3 audio → Whisper transcription: provides audio
transcribe_chunks.py - Whisper transcription → Whisper model: transcribes with
transcribe_chunks.py - Whisper transcription → Timestamped chunks: groups segments
transcribe_chunks.py - Timestamped chunks → Chunk JSON: writes chunks
transcribe_chunks.py - Chunk JSON → Chunk loading: loads JSON
generate_embeddings.py - Chunk loading → Embedding generation: supplies text
generate_embeddings.py - Embedding generation → BGE-M3 model: encodes chunks
generate_embeddings.py - Embedding generation → Embedding store: saves bundle
generate_embeddings.py - Interactive RAG chat → Embedding store: loads bundle
rag_chat.py - Interactive RAG chat → Similarity retrieval: calls retrieval
rag_chat.py - Similarity retrieval → BGE-M3 model: encodes query
rag_chat.py - Interactive RAG chat → Grounded prompt: builds prompt
rag_chat.py - Interactive RAG chat → Streaming answer: streams answer
rag_chat.py - Streaming answer → Ollama service: posts request
rag_chat.py - Store inspection → Embedding store: loads bundle
inspect_embeddings.py - Store inspection → BGE-M3 model: encodes queries
inspect_embeddings.py