How unnatiagarwal02/pubmed-rag-assistant works
PubMed RAG Assistant collects brain-tumor MRI research abstracts, prepares and indexes them, then answers questions from retrieved passages with PMID citations and optional support checks. The main path is user → web UI/API → retrieval and answer generation → guardrail verdict. A separate corpus-refresh path fetches PubMed records and rebuilds the vector index. The README documents the UI and metadata endpoints; the frontend implementation was not sampled, so its internal behavior is not expanded here.
Main entry points: api.py FastAPI service · rag.py Retrieve and answer · index.html Web UI · index.py Build index
Components 12
Corpus acquisition
- Fetch records
pubmed_rag/fetch.py - Abstract records
data/raw/abstracts.jsonl
Preparation and indexing
- Clean and chunk
pubmed_rag/chunk.py - Build index
pubmed_rag/index.py - Chroma collection
pubmed_rag/index.py
Answer and verification
- Retrieve and answer
pubmed_rag/rag.py - Support checks
pubmed_rag/guardrail.py
User interface
- FastAPI service
pubmed_rag/api.py - Web UI
frontend/index.html
Other components
- Questioner
- PubMed E-utilities
- Groq LLM
Connections 13
- Questioner → Web UI: asks
- Web UI → FastAPI service: submits question
- FastAPI service → Web UI: serves
- FastAPI service → Retrieve and answer: requests answer
- Retrieve and answer → Chroma collection: retrieves passages
- Retrieve and answer → Groq LLM: generates answer
- FastAPI service → Support checks: checks result
- Support checks → Groq LLM: judges claims
- PubMed E-utilities → Fetch records: supplies records
- Fetch records → Abstract records: writes JSONL
- Clean and chunk → Abstract records: reads records
- Build index → Clean and chunk: cleans and chunks
- Build index → Chroma collection: embeds and stores