How shadab-sy/rag-based-college-assistance works
MHSSCE Knowledge Assistant lets users ask questions about the college’s official documents and receive evidence-grounded answers with citations. The main flow runs from the chat UI through the API and RAG pipeline, which retrieves and ranks document chunks before generating an answer. The repository also includes the corpus and a local vector store used for retrieval. The README documents OpenRouter generation and the frontend/backend connection; sampled source confirms key calls, but not every retrieval or generation detail.
Main entry points: retrieval.py Hybrid retrieval · main.py FastAPI routes · rag_pipeline.py RAG pipeline · vector_store.py Chroma vector store
Components 15
Chat client
- Chat interface
frontend/src/App.jsx - API client
frontend/src/services/api.js
Answer service
- FastAPI routes
backend/app/main.py - RAG pipeline
backend/app/rag_pipeline.py - Grounded generation
backend/app/llm.py
Retrieval system
- Hybrid retrieval
backend/app/retrieval.py - Cross-encoder reranker
backend/app/reranker.py - Embedding manager
backend/app/embeddings.py - Document metadata
backend/app/document_metadata.py - Chroma vector store
backend/app/vector_store.py
Knowledge corpus
- Indexed chunks
MHSSCE_CHUNKS/chunks.json - Approved source PDFs
MHSSCE_RAG_FINAL - Extracted document text
MHSSCE_CLEAN_TEXT
Other components
- Questioner
- OpenRouter
Connections 15
- Questioner → Chat interface: asks
README.md - Chat interface → API client: submits question
frontend/src/App.jsx - API client → FastAPI routes: posts question
frontend/src/services/api.js - FastAPI routes → RAG pipeline: invokes
backend/app/main.py - RAG pipeline → Hybrid retrieval: retrieves evidence
backend/app/rag_pipeline.py - RAG pipeline → Grounded generation: generates answer
backend/app/rag_pipeline.py - Grounded generation → OpenRouter: requests completion
README.md - Hybrid retrieval → Embedding manager: embeds query
backend/app/retrieval.py - Hybrid retrieval → Chroma vector store: queries chunks
backend/app/retrieval.py - Hybrid retrieval → Cross-encoder reranker: reranks candidates
backend/app/retrieval.py - Hybrid retrieval → Document metadata: normalizes years
backend/app/retrieval.py - FastAPI routes → Chroma vector store: counts chunks
backend/app/main.py - Indexed chunks → Chroma vector store: provides index data
README.md - Approved source PDFs → Extracted document text: source for extraction
- Extracted document text → Indexed chunks: source for chunking