Hybrid Memory-Retrieval Model: Enhancing Trust in Medical Chatbots
Discuss this preprint
Start a discussion What are Sciety discussions?Listed in
This article is not in any list yet, why not save it to one of your lists.Abstract
Large language model-based medical chatbots face two major challenges: hallucination, where models generate plausible but incorrect information, and context loss in multi-turn conversations. These issues reduce trust and safety in healthcare applications. This work presents a hybrid memory-retrieval architecture that enhances factual accuracy and conversational continuity. The system combines a dual-retriever pipeline using BM25 and MedCPT with long-term memory retrieval via ChromaDB. Retrieved documents and past interactions are fused using Reciprocal Rank Fusion and passed to a compact language model (Phi-2) for response generation. When relevant context is missing, the model defaults to fallback instructions to avoid hallucinated outputs. Evaluation on the MedQuAD dataset shows strong semantic alignment (BERTScore F1 = 0.8644), improved fluency, and significantly faster response times compared to baseline retrieval-augmented models. This approach demonstrates the effectiveness of integrating structured memory with selective retrieval to build more trustworthy and reliable medical chatbots.