Design and Implementation of a Medical Question Answering System Based on Retrieval-Augmented Generation
With the rapid growth of medical information demand, providing accurate and reliable medical question-answering services has become a pressing challenge. Traditional generative Q&A models are prone to hallucinations, frequently generating inaccurate medical advice, while simple retrieval systems lack natural fluency. To address this, we propose a Retrieval-Augmented Generation (RAG)-based medical QA system with a five-layer architecture. The data processing layer cleans and formats data from the MedChatZH dataset. The knowledge storage layer encodes documents into 768-dimensional vectors using the BGE-small-zh-v1.5 embedding model and builds an index. The retrieval layer selects relevant documents via cosine similarity. The answer generation layer employs the ChatGLM3-6B language model for context-aware responses. Finally, a user-friendly web interface is implemented using Gradio, offering high-quality medical Q&A services.
Authors
- Dongrui Wu (ORCID: https://orcid.org/0000-0002-7153-9703)
- Jian‐Yun Nie (ORCID: https://orcid.org/0000-0003-1556-3335)
- Yuhao Tang (ORCID: https://orcid.org/0000-0001-6026-0769)
- Yanan Tu (ORCID: https://orcid.org/0000-0002-4803-1207)
- Xiaochun Liu (ORCID: https://orcid.org/0000-0002-6395-8262)
- Geng Zhao (ORCID: https://orcid.org/0009-0003-7037-805X)
Institutions
- North China University of Technology (CN)
Publication Details
- Journal
- International Journal of Biology and Life Sciences
- Published
- 2025-08-28
- DOI
- https://doi.org/10.54097/4xqm5c93
- Citations
- 1
- Primary Topic
- Topic Modeling
- Type
- article
- Field-Weighted Citation Impact
- 2.48