Paper - Pytorch
Project description
Medical Diagnosis Swarm Architecture
A production-grade multi-agent system for comprehensive medical diagnosis and coding using specialized AI agents.
Installation
pip install mcs
Usage
from mcs.main import MedicalCoderSwarm
import json
if __name__ == "__main__":
# Example patient case
patient_case = """
Patient: 45-year-old White Male
Location: New York, NY
Lab Results:
- egfr
- 59 ml / min / 1.73
- non african-american
"""
swarm = MedicalCoderSwarm(patient_id="Patient-001", max_loops=1, patient_documentation="")
swarm.run(task=patient_case)
print(json.dumps(swarm.to_dict()))
Architecture Overview
flowchart TB
CMO[Chief Medical Officer] --> V[Virologist]
V --> I[Internist]
I --> MC[Medical Coder]
MC --> S[Synthesizer]
Features
- Specialized Agent Roles: Each agent has specific medical expertise and responsibilities
- Structured Diagnostic Flow: Organized pipeline from initial assessment to final synthesis
- ICD-10 Coding Integration: Comprehensive medical coding at each diagnostic stage
- Automated Report Generation: Standardized medical and coding reports
- Evidence-Based Decision Making: Multi-stage verification and synthesis process
Agent Responsibilities
mindmap
root((Medical Swarm))
Chief Medical Officer
Initial Assessment
Coordinate Specialists
Treatment Plans
Lab Range Analysis
Virologist
Viral Analysis
Disease Progression
Risk Assessment
Internist
System Review
Vitals Analysis
Comorbidity Evaluation
Medical Coder
ICD-10 Assignment
Coding Compliance
Documentation Review
Synthesizer
Integration
Reconciliation
Final Assessment
Diagnostic Flow Process
sequenceDiagram
participant P as Patient Case
participant CMO as Chief Medical Officer
participant V as Virologist
participant I as Internist
participant MC as Medical Coder
participant S as Synthesizer
P->>CMO: Initial Data
CMO->>V: Preliminary Assessment
V->>I: Viral Analysis
I->>MC: Comprehensive Review
MC->>S: Coded Diagnosis
S->>P: Final Report
Docker Usage
To build and run the Docker container for the Medical Coder Swarm, follow these steps:
- Build the Docker Image:
docker build -t mcs .
- Run the Docker Container:
docker run --rm mcs
Docker Compose
docker-compose up
To stop the services, run:
docker-compose down
Lab Range Analysis
The system includes specialized functionality for analyzing lab results against diagnostic criteria:
- Automated range checking for common tests (e.g., eGFR)
- Diagnosis-specific range validation
- Multi-factor analysis for complex diagnoses
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE.md file for details
Acknowledgments
- Built with the Swarms framework
- Utilizes GPT-4 for advanced medical reasoning
- ICD-10 coding standards compliance
Contact
For questions and support, please open an issue in the repository.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcs-0.0.3.tar.gz.
File metadata
- Download URL: mcs-0.0.3.tar.gz
- Upload date:
- Size: 7.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.6 Darwin/23.3.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6fc1b275e820350eacc198a3ba73e2ce11c0abc127e660412df354311db42d1f
|
|
| MD5 |
c71530f8fecbae404bf814ae619d0496
|
|
| BLAKE2b-256 |
5b38a1040f769850e36e5fe7a0d796816112e8c2085c02b03387ad17056e5797
|
File details
Details for the file mcs-0.0.3-py3-none-any.whl.
File metadata
- Download URL: mcs-0.0.3-py3-none-any.whl
- Upload date:
- Size: 7.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.6 Darwin/23.3.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
611009bcb256f1e7b697d134875442d08b8ed6339c6656469fd99a4f84fd34b3
|
|
| MD5 |
9c7a99c1a64cae8e011dac581b424d06
|
|
| BLAKE2b-256 |
4888599d36354918305db272983bcb0d97bdabc6ab0580f72d62a0affd340638
|