How sytrox918/m-rag works
This is an educational multimodal RAG tutor: users ingest PDFs, PowerPoints, or YouTube videos, then ask grounded questions or explore prerequisite learning paths. Ingestion extracts text and visual assets, enriches content with vision and learning metadata, embeds it, and persists it for hybrid retrieval. The tutor rewrites follow-ups, retrieves and reranks evidence, checks grounding, generates structured answers, and validates citations. The README also documents GPU inference and interactive knowledge-graph visualization. Some subsystem links rely on README descriptions or index references; unsampled implementation details are not inferred.
Main entry points: ingestion_service.py Ingestion Orchestrator · chain.py RAG Chain · retriever.py Hybrid Retriever · app.py Streamlit Dashboard
Components 25
User Interfaces
- Streamlit Dashboard
app.py - API Entry
api/main.py
Content Ingestion
- Ingestion Orchestrator
services/ingestion_service.py - PDF Parser
ingestion/pdf/parser.py - PowerPoint Parser
ingestion/pptx/parser.py - Video Parser
ingestion/video/parser.py - Content Units
ingestion/common/content_units.py
Content Enrichment
- Vision Processing
services/vlm_service.py - Topic Metadata
services/metadata_service.py - Embedding Service
services/embedding_service.py
Tutor And Learning Graph
- Prerequisite Graph
services/graph_service.py - Answer Service
services/answer_service.py - RAG Chain
rag/chain.py - Grounding Check
rag/grounding.py - Citation Validation
rag/citations.py
Retrieval And Storage
- Hybrid Retriever
rag/retriever.py - Dense Retrieval
retrieval/dense.py - Sparse Retrieval
retrieval/sparse.py - Rank Fusion
retrieval/fusion.py - Cross-Encoder Reranker
services/reranker_service.py - Vector Store
storage/vector_store.py - Postgres Database
storage/postgres.py
Other components
- Learner
- Answer Model
- Gemini Vision
Connections 33
- Learner → Streamlit Dashboard: uses
README.md - Learner → API Entry: requests
- Streamlit Dashboard → Ingestion Orchestrator: submits media
app.py - Streamlit Dashboard → Answer Service: asks questions
app.py - Streamlit Dashboard → Prerequisite Graph: requests learning path
app.py - API Entry → Ingestion Orchestrator: routes ingestion
api/main.py - API Entry → Answer Service: routes questions
api/main.py - API Entry → Prerequisite Graph: routes graph requests
api/main.py - Ingestion Orchestrator → PDF Parser: parses PDFs
services/ingestion_service.py - Ingestion Orchestrator → PowerPoint Parser: parses slides
services/ingestion_service.py - Ingestion Orchestrator → Video Parser: parses videos
services/ingestion_service.py - PDF Parser → Content Units: creates units
ingestion/pdf/parser.py - PowerPoint Parser → Content Units: creates units
ingestion/pptx/parser.py - Video Parser → Content Units: creates units
ingestion/video/parser.py - Ingestion Orchestrator → Vision Processing: describes assets
services/ingestion_service.py - Ingestion Orchestrator → Topic Metadata: enriches units
services/ingestion_service.py - Ingestion Orchestrator → Embedding Service: embeds text
services/ingestion_service.py - Ingestion Orchestrator → Vector Store: saves units
services/ingestion_service.py - Vision Processing → Gemini Vision: analyzes visuals
README.md - Vector Store → Postgres Database: writes records
storage/vector_store.py - Prerequisite Graph → Postgres Database: reads units
services/graph_service.py - Answer Service → RAG Chain: runs answers
services/answer_service.py - RAG Chain → Hybrid Retriever: retrieves evidence
rag/chain.py - Hybrid Retriever → Dense Retrieval: runs dense search
rag/retriever.py - Hybrid Retriever → Sparse Retrieval: runs sparse search
rag/retriever.py - Hybrid Retriever → Rank Fusion: fuses results
rag/retriever.py - Hybrid Retriever → Cross-Encoder Reranker: reranks candidates
rag/retriever.py - Dense Retrieval → Embedding Service: embeds query
retrieval/dense.py - Dense Retrieval → Postgres Database: searches vectors
retrieval/dense.py - Sparse Retrieval → Postgres Database: searches text
retrieval/sparse.py - RAG Chain → Grounding Check: checks evidence
rag/chain.py - RAG Chain → Answer Model: generates answer
- RAG Chain → Citation Validation: validates claims
rag/chain.py