HomeAboutServicesPortfolioScrapersReviewsBlog Hire me
Case study

A Clinical Q&A Assistant Grounded in the Merck Manual

Category
AI & NLP · RAG
Stack
LangChain · ChromaDB · Mistral-7B
Data
Merck Manual (4,114-page PDF)
Status
Completed study
2.0 → 5.0
Grounding score with RAG
4,114
Pages indexed
100%
Local & private (no API calls)

Problem

A bare LLM answering clinical questions is fluent but unaccountable — it cites no sources and quietly invents specifics. The goal: make a local, private assistant whose answers are grounded in an authoritative reference, and measure whether retrieval actually improves answer quality rather than assuming it does.

Approach

Four configurations were evaluated on the same five clinical queries with a scoring rubric (grounding, specificity, coverage): (1) bare Mistral-7B, (2) prompt-engineered, (3) RAG over the Merck Manual, (4) RAG with tuned temperature. Scoring the stages separately shows exactly what each technique buys.

Answer quality by stage averaged over five clinical queries: grounding, specificity and coverage all rise from LLM-only to tuned RAG

Technology

  • Mistral-7B-Instruct (GGUF) running locally via llama-cpp — no patient data leaves the machine
  • LangChain + ChromaDB for chunking, embedding, and retrieval
  • gte-small sentence embeddings; PyMuPDF for PDF extraction

Result

Grounding rose from 2.0 (bare LLM) to 5.0 once retrieval was attached; without retrieval the model cited zero numeric clinical values across all five queries. The evaluation also surfaced two findings that matter in production: a silent retrieval failure (a leg-fracture query retrieved hip-fracture rehabilitation content and the model answered confidently anyway), and evidence that the LLM scoring its own answers rated everything 5/5 — so human rubric scoring was used instead.

Per-query breakdown showing where each pipeline stage wins and loses across the five clinical questions

Need a similar system?

Describe your data and the decision it should support — you'll get a feasibility answer and a fixed quote.

Start a project →