Final Year Project — LLM + RAG
Virtual Patient System
Overview
Developed an AI-powered medical education platform that helps medical students practice clinical reasoning and diagnostic skills. The system features two main modules: a Virtual Patient simulator and an intelligent MCQ generator.
🎯 Goal: Bridge the gap between theoretical knowledge and practical clinical experience for medical students through interactive AI-driven simulations.
System Modules
🏥 Virtual Patient
Simulates realistic patient interactions based on medical case records. Students can practice taking patient history, asking diagnostic questions, and developing differential diagnoses.
📝 MCQ Generator
Automatically generates multiple-choice questions from medical textbooks and lecture materials, complete with explanations and difficulty grading.
Technical Implementation
Virtual Patient Module
- Fine-tuned Llama2 model on medical dialogue datasets to generate patient-like responses
- Trained a custom medical QA retrieval model to fetch relevant patient information
- Designed prompt engineering strategies to maintain consistent patient persona throughout conversations
- Implemented guardrails to prevent the model from providing medical advice or breaking character
MCQ Generator Module
- Used MilvusDB as vector database for efficient storage and retrieval of medical content
- Integrated Dragon+ model for semantic embedding and context retrieval
- Developed prompt templates for generating questions at different cognitive levels (recall, comprehension, application)
- Implemented distractor generation using medical knowledge graphs to create plausible wrong answers
RAG Pipeline
- Document Processing: Chunked medical textbooks and case studies with overlap to preserve context
- Embedding: Used Dragon+ model for dense vector representations of medical text
- Retrieval: Hybrid search combining semantic similarity and keyword matching
- Generation: Llama2 with retrieved context for accurate, grounded responses
Tech Stack
Python
Llama2
MilvusDB
Dragon+
LangChain
RAG
Hugging Face
FastAPI