Medical-RAG's hybrid retrieval system utilizes aDual-channel parallel search + intelligent fusionThe design concept includes the following core components:
retrieval channel
- dense vector search::
- Support for multiple embedded models: including locally deployed bge-m3, OpenAI API or HuggingFace models
- Milvus-based implementation of high-performance Approximate Nearest Neighbor Search (ANN)
- Specializes in capturing semantic relevance for scenarios such as complex symptom descriptions
- sparse vector search::
- Keyword matching using BM25 algorithm
- Enhancing terminology recognition accuracy through medical domain-specific vocabularies (vocab.pkl.gz)
- Ideal for dealing with the need for exact matching of drug names, disease codes, etc.
Resulting fusion layer
Two convergence strategies are offered:
- RRF fusion: Dynamically adjusts the result ordering based on the Reciprocal Rank Fusion algorithm.
- weighted fusion: By
search_answer.yamlConfiguration file to customize the weight ratio of each channel
The architecture is realized through theLangChain FrameworkThe process orchestration is implemented and the optimized retrieval results are finally passed to the generative model to construct the answer.
This answer comes from the articleMedical-RAG: A Retrieval-Augmented Generation Framework for Constructing Chinese Medical Q&AsThe































