https://github.com/gersteinlab/medagents-2
https://github.com/gersteinlab/medagents-2
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/gersteinlab/medagents-2
- Owner: gersteinlab
- License: apache-2.0
- Created: 2024-10-19T17:33:51.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-09-07T02:46:25.000Z (9 months ago)
- Last Synced: 2025-09-07T04:26:11.504Z (9 months ago)
- Language: Python
- Size: 402 MB
- Stars: 3
- Watchers: 10
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# MedAgents-2: Multi-Agent Medical Question Answering System
MedAgents-2 is a next-generation, evidence-based multi-agent system for medical question answering. It brings together a team of specialized AI agentsβeach with unique expertiseβto collaboratively solve complex medical problems through structured debate, dynamic evidence gathering, and consensus-building.
---
## ποΈ How MedAgents-2 Works
Imagine a virtual medical boardroom, where each agent plays a distinct, expert role:
```
βββββββββββββββββ βββββββββββββββββ βββββββββββββββββ
β The Triage β β The Experts β β The Moderator β
β Coordinator β β Panel β β β
β β β β β β
β β’ Reads and βββββΆβ β’ Specialists βββββΆβ β’ Guides β
β classifies β β debate β β discussion β
β questions β β β’ Gather and β β interpret β
β β’ Selects β β evidence β β evidence β
β the right β β β’ Justify β β answers β
β experts β β β β β
β β’ Assesses β β β β β
β complexity β β β β β
βββββββββββββββββ βββββββββββββββββ βββββββββββββββββ
β β β
ββββββββββββββββββββββββΌβββββββββββββββββββββββ
β
ββββββββββββββββββββββ
β The Researcher β
β (Search Engine) β
β β
β β’ Finds evidence β
β β’ Evaluates β
β relevance β
β β’ Refines queries β
ββββββββββββββββββββββ
```
---
## π Meet the Team
**The Triage Coordinator**
Reads each question, determines its complexity, and selects the most relevant medical specialists for the case. Crafts detailed, CV-style profiles for each expert, ensuring the right knowledge is at the table. Can also run in βablationβ mode for controlled experiments.
**The Expert Panel**
A diverse group of AI medical specialists, each with a unique background and research focus. They analyze the question, use advanced search tools to gather evidence, and provide structured, explainable answersβcomplete with reasoning, confidence, and justification. They can review previous searches and adapt their approach as the discussion evolves.
**The Researcher**
A powerful, configurable search engine that scours medical literature, clinical guidelines, and textbooks. It rewrites queries for better results, checks for redundant searches, and adapts its strategy based on the needs of the experts. Integrates with Milvus for vector search and supports multiple medical sources.
**The Moderator**
Guides the debate, synthesizes expert opinions, and provides actionable feedback. Highlights areas of agreement and disagreement, suggests further exploration, and decides when consensus is reached or more discussion is needed. Ensures every decision is well-justified and evidence-based.
---
## π Quick Start
1. **Install dependencies**
```bash
pip install -r requirements.txt
```
2. **Set up environment variables**
Copy `.example.env` to `.env` and fill in your credentials.
3. **Run in interactive mode**
```bash
python main.py
```
4. **Single question mode**
```bash
python main.py --mode single \
--question "A patient presents with chest pain..." \
--options "A:Angina" "B:Heart attack" "C:Indigestion" "D:Anxiety"
```
5. **Batch processing**
```bash
python main.py --mode batch \
--questions questions.json \
--output results.json \
--difficulty medium
```
---
## βοΈ Configuration
MedAgents-2 uses Hydra for flexible configuration. Main config files:
- `conf/config.yaml`: Main entry point
- `conf/orchestrate/default.yaml`: Agent orchestration
- `conf/triage/default.yaml`: Triage/difficulty
- `conf/search/default.yaml`: Search/retrieval
- `conf/execution/default.yaml`: Execution
**Ablation experiments and advanced configuration:**
- [Triage Config & Ablation](conf/triage/README.md)
- [Search Config & Ablation](conf/search/README.md)
---
## π More Info
- See [CONTRIBUTING.md](CONTRIBUTING.md) for development guidelines.
- See [LICENSE](LICENSE) for license details.
---
For detailed architecture, advanced features, and ablation studies, refer to the documentation in the `conf/` subfolders.