This repository implements a Retrieval-Augmented Generation (RAG) pipeline tailored for the clinical / medical domain.
It combines a retriever (for fetching relevant passages from a medical knowledge base) with a large language model (LLM) to generate grounded, context-aware answers to clinical queries.
- Retriever: indexes clinical knowledge (e.g., PubMed abstracts, patient notes, or structured medical texts).
- Augmented Generation: retrieved chunks are passed into the LLM to enhance factual accuracy and reduce hallucinations.
- Goal: demonstrate how RAG can be applied in the healthcare space to support clinical decision-making, question answering, and knowledge exploration.
This is described in detail in the blog post:
Clinical Retrieval-Augmented Generation
I used the MIMIC-IV-Ext Direct dataset, I chunked the data, the optimal size and overlap of the data was decide by reading Evaluating the Ideal Chunk Size for a RAG System using LlamaIndex, Given the medical orientation of the data I decide to use BioBert to generate domain-specific embeddings. To store and retreive these vectors I used FAISS a library for efficient similarity search and clustering of dense vectors. To demonstrate my RAG app I coupled it with Google Gemini. This repositry contains the notebook for indexing and pre-proccessing medical data as well as the demo web app.