Back to Portfolio

Hippocrates AI: Clinical Decision Support with RAG

Role
AI Research Lead
Domain
Healthcare AI / NLP
Date
Sep 2024 - Nov 2024

Description

While Large Language Models (LLMs) have revolutionized NLP, their adoption in medicine is hindered by "hallucinations"—the generation of plausible but factually incorrect medical information. In a clinical setting, a hallucination isn't just a bug; it's a patient safety risk. Hippocrates AI was developed to solve this by creating a Retrieval-Augmented Generation (RAG) pipeline that grounds AI responses in verified medical literature.

As the AI Research Lead, I architected a pipeline that moves away from the "black box" nature of standard LLMs. We used LangChain to orchestrate the retrieval process. We indexed thousands of pages from the Merck Manual and PubMed Central into ChromaDB, a vector database. We used the all-MiniLM-L6-v2 embedding model to transform medical text into high-dimensional vectors, allowing for semantic search rather than just keyword matching.

For data privacy, the entire system runs locally using Ollama to serve a Mistral-7B model. This ensures that sensitive patient queries never leave the local infrastructure. To further increase trust, I implemented Explainable AI (XAI) features. Every suggestion provided by Hippocrates AI is accompanied by direct citations from the source material and a color-coded confidence score.

A major hurdle was latency. Initial RAG queries took upwards of 8 seconds. I optimized this to 2.4 seconds by implementing 4-bit quantization (AWQ) on the Mistral model and using KV-caching. Our validation showed a 94% reduction in hallucinations compared to vanilla GPT-3.5, achieving an internal diagnostic accuracy of 89.2%.

Technologies Used

LangChain
Mistral-7B
ChromaDB
spaCy
Ollama
FAISS

How I Did It

I built a RAG pipeline using LangChain and ChromaDB, and optimized inference latency using 4-bit quantization on a locally served Mistral-7B model.

Media

Image/Video Placeholder