A virtual AI hospital you can run on a laptop — multiple specialist agents coordinated by a conversational orchestrator.
Swap the trivia question for a patient’s symptoms, labs, imaging, or genomics.
AiMedOrchestra routes your natural sentence to the right specialist agent(s) and stitches results into a single response.
- The orchestrator reads your request (“create two synthetic patients”, “trials near Boston”) and picks the right agent(s).
- Each agent is a focused specialist (diagnostics, imaging, genomics, trials, diet/treatment, literature, mental‑health support, ethics).
- Outputs from one agent can feed the next, giving you an end‑to‑end answer in plain language.
| Agent | Agent / Model | Role | Input | Output |
|---|---|---|---|---|
| 1 | Data Synthesis | Create synthetic patient records | N = 2 | Two JSON rows (synthetic patients) |
| 2 | Diagnostics | Suggest likely diagnosis from symptoms | 55F, chest pain + cough | Differential (e.g., bronchitis, pneumonia) |
| 3 | Clinical Trial Matching | Find recruiting trials for a given profile | 65M, lung cancer, Boston | Trial shortlist (e.g., NCT012345, NCT067890) |
How to use it: Type natural instructions. The orchestrator handles routing (e.g., “create 2 synthetic patients”, “diagnose a 55 yo female with chest pain”, “trials for lung cancer near Boston”).
git clone https://github.com/semework/AiMedOrchestra.git
cd AiMedOrchestra
# Python 3.10+ recommended
python -m venv .venv
source .venv/bin/activate # on Windows: .venv\Scripts\activateUse either requirements.txt or editable install via pyproject.toml:
Option A — requirements.txt
pip install -r requirements.txtOption B — editable install (preferred for dev)
pip install -e .Editable install lets you
import aimedorchestra...without fiddling withPYTHONPATH.
jupyter lab # or: jupyter notebook
# Open: aimedorchestra_demo_notebook_chat.ipynb
# Run the "Chat UI for AiMedOrchestra" cell, then try:
# - "create two synthetic patients"
# - "diagnose a 55 yo female with chest pain and cough"
# - "find clinical trials for lung cancer near Boston"
# - 'run full pipeline on {"age":60, "sex":"male"}'If installed with pip install -e .:
python - << 'PY'
from aimedorchestra.orchestrator.agent import aimedorchestraAgent
orch = aimedorchestraAgent()
print(orch.route("create two synthetic patients"))
print(orch.route("diagnose a 55 yo female with chest pain and cough"))
print(orch.route("find clinical trials for lung cancer near Boston"))
print(orch.route('run full pipeline on {"age":60,"sex":"male","conditions":["diabetes"]}'))
PYAlternative (use top‑level file from repo root):
PYTHONPATH=. python - << 'PY'
from aimedorchestraagent import aimedorchestraAgent
print(aimedorchestraAgent().route("create 3 synthetic patients"))
PYStreamlit
If the app can’t import the package, prefix with
PYTHONPATH=.
PYTHONPATH=. streamlit run apps/orchestrator_app.py
# or per-agent:
# PYTHONPATH=. streamlit run apps/data_synthesis_app.py
# PYTHONPATH=. streamlit run apps/diagnostics_app.py
# ...Pure Python / Dash
python apps/orchestrator_app.py
# or per-agent:
# python apps/data_synthesis_app.py
# python apps/diagnostics_app.py
# ...Streamlit typically uses 8501; Dash commonly uses 8050.
docker build -t aimed:latest .
# If Streamlit (8501):
docker run --rm -p 8501:8501 aimed
# If Dash/Flask (8050):
# docker run --rm -p 8050:8050 aimed# Local K8s
kind create cluster --name aimed
# Deploy
kubectl apply -f k8s_deployment.yaml
# Check rollout
kubectl get pods
kubectl logs deploy/aimedorchestra -f
# Optional port-forward:
kubectl port-forward deploy/aimedorchestra 8501:8501- Sample image:
data/sample_image.jpg - Trials JSON:
data/trials.json - Literature snippets:
data/literature/*.txt
- If the package can’t be found, run with
PYTHONPATH=.from the repo root, e.g.:PYTHONPATH=. python apps/orchestrator_app.py
- For Streamlit imports, use:
PYTHONPATH=. streamlit run apps/orchestrator_app.py
- If an agent import fails, the router returns
(agent_unavailable). Ensureaimedorchestra/agents/<agent>/agent.pyexists and its class ends withAgent.
AiMedOrchestra is a team of specialized AI agents coordinated by an orchestrator so you can chat your way through complex clinical tasks and get a single, coherent answer.
(See project README or paper references as applicable.)
Released for non‑commercial & research use. See the repository’s LICENSE file for details.
Thanks to Matthew Phillips for reviewing this article and helping improve its clarity and flow.