How ameygupta25/rmp-rag works
UCSD ProfAI combines a weekly professor/review data pipeline with a student-facing search and cited-answer app. Students ask questions or browse professor and course data; the frontend calls the API, which retrieves and reranks review evidence, optionally runs guarded SQL for ranking questions, and generates cited answers. The pipeline extracts and validates source data, models it into serving tables, and separately embeds reviews and enriches them with LLM-derived attributes and summaries. Several backend and frontend details are unsampled; those relationships are shown only where the README or excerpts support them.
Main entry points: main.jsx React app · main.py FastAPI service · api.js API client · router.py Guarded SQL router
Components 22
Student app
- React app
frontend/src/main.jsx - Ask page
frontend/src/pages/Ask.jsx - Browse pages
frontend/src/pages/Search.jsx - Profile and compare
frontend/src/pages/Professor.jsx - Shortlist state
frontend/src/shortlist.jsx - API client
frontend/src/api.js
API and retrieval
- FastAPI service
api/main.py - Guarded SQL router
api/router.py - Review retrieval
data/vectorstore.py - Pinecone index
Data pipeline
- Review extraction
pipeline/extract.py - Record validation
pipeline/validate.py - S3 raw layer
- Review embedding
pipeline/embed.py
Warehouse
- dbt models
transform/models - Serving DuckDB
data
LLM enrichment
- Review attributes
pipeline/attributes.py - Professor summaries
pipeline/summaries.py - Backfill runner
pipeline/backfill.py
Other components
- Student
- Groq LLM
- Rate My Professor
Connections 29
- Student → React app: uses
README.md - React app → Ask page: routes to
frontend/src/main.jsx - React app → Browse pages: routes to
frontend/src/main.jsx - React app → Profile and compare: routes to
frontend/src/main.jsx - React app → Shortlist state: provides state
frontend/src/main.jsx - Ask page → API client: requests
frontend/src/pages/Ask.jsx - Browse pages → API client: requests
frontend/src/pages/Search.jsx - Profile and compare → API client: requests
frontend/src/pages/Professor.jsx - API client → FastAPI service: calls HTTP API
README.md - FastAPI service → Review retrieval: retrieves reviews
README.md - Review retrieval → Pinecone index: searches and reranks
README.md - FastAPI service → Groq LLM: generates cited answer
README.md - FastAPI service → Guarded SQL router: routes rankings
README.md - Guarded SQL router → Groq LLM: requests SQL
api/router.py - Guarded SQL router → Serving DuckDB: queries guarded tables
README.md - Groq LLM → FastAPI service: returns answer
README.md - Rate My Professor → Review extraction: provides review data
README.md - Review extraction → Record validation: validates records
pipeline/extract.py - Record validation → S3 raw layer: lands accepted data
README.md - S3 raw layer → dbt models: models raw data
README.md - dbt models → Serving DuckDB: publishes tables
README.md - S3 raw layer → Review embedding: supplies reviews
README.md - Review embedding → Pinecone index: writes embeddings
README.md - Backfill runner → Review attributes: runs extraction
pipeline/backfill.py - Backfill runner → Professor summaries: runs summaries
pipeline/backfill.py - Review attributes → Groq LLM: extracts fields
pipeline/attributes.py - Professor summaries → Groq LLM: generates summaries
README.md - Review attributes → S3 raw layer: writes enriched data
pipeline/attributes.py - Professor summaries → S3 raw layer: writes summaries
pipeline/summaries.py