Back to work

Full-Stack + Applied AI

MediVise

Medical document RAG platform (capstone)

Built a secure, multi-tenant medical document RAG platform with FastAPI, Phi-4-mini, and Supabase/PostgreSQL—enforcing per-user authorization via Row-Level Security and optimizing retrieval with hybrid sparse/dense vectors and cached RxNorm lookups.

Role
Capstone Developer
Timeframe
Aug 2025 – Nov 2025
Status
Not shipped (capstone prototype)
Links

Educational prototype; not intended for diagnosis or medical advice.

Product screenshots

Context and problem

Medical documents are difficult for patients to parse; the platform needed secure multi-tenant ingestion, hybrid retrieval over user-uploaded files, and latency-aware LLM responses without crossing into clinical advice.

Challenge

Deliver a production-quality RAG backend for medical documents within a capstone scope—strict tenant isolation, controlled context windows, and bounded non-diagnostic AI outputs.

Constraints

  • Educational capstone scope—not a clinical or FDA-regulated product
  • Per-user document isolation required at the database layer
  • Latency-sensitive RAG over documents of varying quality and format

Key contributions

  • Built a secure multi-tenant document ingestion API using Phi-4-mini, isolating user vectors and metadata with Supabase Row-Level Security over PostgreSQL.
  • Improved retrieval quality with hybrid sparse/dense search, token-aware chunking, and caching for RxNorm lookups to reduce external API latency.

Architecture

Key engineering decisions

  • Enforced tenant isolation with Supabase RLS policies rather than application-layer checks alone
  • Used hybrid sparse/dense retrieval instead of semantic-only search to improve recall on medical terminology
  • Aggressively cached RxNorm lookups to mitigate external API latency on the hot path

Security and reliability

  • Row-Level Security policies isolating user vectors and metadata per tenant
  • Dynamic token-aware chunking to control retrieved context size
  • Cached RxNorm lookups reducing redundant external API calls

Outcome

Built a capstone RAG platform demonstrating secure multi-tenant document ingestion, hybrid retrieval tuning, and responsible AI boundaries in a healthcare-adjacent domain.

Limitations

  • Not shipped; educational capstone prototype only
  • Not intended for diagnosis, treatment decisions, or medical advice

Next steps

  • Expand automated evaluation for RAG answer quality across document types
  • Harden auth boundaries and document access policies before any broader release

Tech stack

  • FastAPI
  • PostgreSQL
  • Supabase
  • Phi-4-mini
  • RAG
  • Hybrid retrieval
  • RxNorm API