medical-rag  by yolo-hyl

Intelligent medical Q&A via Retrieval Augmented Generation

Created 8 months ago
264 stars

Top 96.6% on SourcePulse

GitHubView on GitHub
Project Summary

Summary

This project delivers a professional medical domain Retrieval Augmented Generation (RAG) system using LangChain and Milvus. It offers an end-to-end solution for intelligent medical Q&A, featuring hybrid retrieval and an automated RAG agent, targeting researchers and power users needing robust, domain-specific AI applications.

How It Works

The system leverages multi-vector hybrid retrieval (dense + sparse BM25) for enhanced recall and domain-specific optimizations like medical tokenization. A core RAG agent automates retrieval parameters, fact-checking, and web search, simplifying complex RAG operations. Flexible LLM/embedding provider support and an end-to-end data pipeline facilitate integration and deployment.

Quick Start & Requirements

  • Installation: Clone repo, git lfs pull, create/activate Conda env (conda env create -f environment.yml, conda activate rag), install project (pip install -e .).
  • Prerequisites: Git LFS, Conda, Milvus (start script), Ollama (optional, for local models). Environment variables for LLM/embedding providers, Langchain API key, and Tencent Cloud credentials (for network search) are necessary.
  • Configuration: Adjust src/MedicalRag/config/app_config.yaml for Milvus, models, and data.
  • Links: GitHub Repository

Highlighted Details

  • Medical Domain Optimization: Uses pkuseg for specialized medical tokenization and vocabulary.
  • Hybrid Retrieval: Combines dense and sparse vectors for >85% Q&A accuracy, outperforming single methods.
  • RAG Agent: Automates retrieval decisions, fact verification, and web search initiation.
  • Flexible Providers: Supports OpenAI, Ollama, and others via configuration.
  • Performance: Hybrid retrieval < 500ms, handles millions of documents and high concurrency.

Maintenance & Community

The project welcomes Issues and Pull Requests. Specific community links (Discord/Slack) or a roadmap are not detailed in the README.

Licensing & Compatibility

Licensed under the MIT License, which is permissive for commercial use and integration into closed-source applications.

Limitations & Caveats

Intended for research/learning, not professional medical advice. Users must ensure data security and regulatory compliance (HIPAA, GDPR), ideally deploying privately. Network search requires Tencent Cloud credentials. Minimum 16GB RAM recommended.

Health Check
Last Commit

1 month ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
26 stars in the last 30 days

Explore Similar Projects

Feedback? Help us improve.