Devpost submission text — MedExplain (UnivaBio)

Inspiration

Medical documents are written for professionals, not patients. A lab report full of reference ranges and flagged values can be confusing and frightening exactly when a person is most anxious. Generic AI chatbots will answer health questions from internet generalities — or invent numbers — which is unsafe for health decisions.

We asked: what if AI could be a translator instead of a doctor-substitute — something that explains your own document, cites your own values, admits what it doesn't know, and sends you to your clinician better prepared?

What it does

MedExplain is a health-literacy companion. You upload your own medical document — a lab report, discharge summary, or medication guide — and MedExplain:

  • Explains it in plain language, with every explanation cited to the exact line of your document (e.g. "your ferritin is 9 ng/mL, flagged LOW against a 30–300 range — here is what your report says about it").
  • Reads explanations aloud (neural TTS, cached) — accessible to low-vision and reading-fatigued users, and reassuring by voice.
  • Refuses what it doesn't know: questions the document doesn't cover return "NOT_COVERED: I couldn't find this in the document." No guessing. No generalities.
  • Never diagnoses, prescribes, or gives dosages — every medical explanation ends with "Discuss this with your clinician — this is not medical advice."
  • Checks understanding: generated comprehension questions (independently verified before serving) let patients confirm they understood the document.
  • Plays a spoken health summary of the document's key points.

How we built it

  • Python + FastAPI backend; single-page web UI (no build step).
  • Retrieval: scikit-learn TF-IDF (local, any language of document) + optional LLM re-ranking.
  • Grounding contract: retrieval-scoped prompts + mandatory citations + explicit refusal token.
  • Audio: edge-tts neural voices with content-hash caching (repeat = instant).
  • Comprehension questions: generate → structural validation → independent solve-verification.
  • Safety: a strict system prompt forbids diagnosis/prescription/dosage; answers are limited to retrieved excerpts; the bundled demo report is entirely synthetic.
  • LLM: any OpenAI-compatible endpoint.

Challenges we ran into

  • Making an LLM reliably refuse off-document questions took a strict prompt contract plus UI-level flags — early versions blended outside medical knowledge subtly.
  • Independent verification of comprehension questions caught answer-key errors that pure generation missed.
  • Keeping explanations useful while staying strictly inside the document: the trick is quoting the document's own comments and reference ranges instead of adding facts.

What we learned

In health, an AI's most important feature is what it doesn't say. Grounding (citations to the exact line), explicit refusal, and a clinician handoff together turn a chatbot from a liability into a literacy tool. Patients don't need a fake doctor — they need a translator they can trust.

What's next

  • OCR for scanned reports; support for more document types (ECGs, imaging reports).
  • Clinician-reviewed explanation templates; localization.
  • Voice input so the whole loop is eyes-free.

Built with

python, fastapi, scikit-learn, edge-tts, llm, rag, health-literacy, accessibility

Built With

Share this project:

Updates

Submission history