Syed Zulqarnain Hassan.

GitHub ↗

Live assistant RAG over a medical reference

A medical assistant that cites its homework.

Ask about a condition, a medicine, or a diagnosis. The answer is not free-form generation: MedBot retrieves the most relevant passages from a medical reference text and the model is constrained to them — when the reference does not support an answer, it says it does not know.

For information only. MedBot is a portfolio demonstration, not a substitute for professional medical advice, diagnosis, or treatment. If this is an emergency, contact local emergency services.

Try it

Ask the reference.

Three starter questions are below, or type your own. Answers stay within the retrieved passages and are kept to three sentences.

MedBot

Hello. Ask me about a condition, a medicine, or a treatment — I answer from the medical reference I was indexed on, and I will tell you when it does not cover something.

POST /get · retrieval first, then a constrained answer · not medical advice

How it works

Grounded, not guessing.

A retrieval-augmented generation pipeline. The model never answers from memory alone — the reference is retrieved first, every time.

  1. Ingest & chunk

    The medical reference PDF is split into overlapping 500-character chunks, so each passage stays small enough to retrieve precisely.

  2. Embed

    Every chunk becomes a 384-dimension vector with the open all-MiniLM-L6-v2 sentence-transformer.

  3. Retrieve

    Your question is embedded the same way, and Pinecone returns the three most similar passages by cosine similarity.

  4. Answer

    An OpenAI model writes a concise answer constrained to those passages — and declines when they do not support one.