Update README.md
Browse files
README.md
CHANGED
|
@@ -61,39 +61,102 @@ This project builds a **multi-agent system** for clinical decision support. A ce
|
|
| 61 |
---
|
| 62 |
|
| 63 |
## Architecture
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 97 |
```
|
| 98 |
|
| 99 |
---
|
|
@@ -142,36 +205,6 @@ flowchart LR
|
|
| 142 |
|
| 143 |
---
|
| 144 |
|
| 145 |
-
## Repository Structure
|
| 146 |
-
|
| 147 |
-
```
|
| 148 |
-
ββ apps/
|
| 149 |
-
β ββ orchestrator/ # MCP planner/router, self-consistency, fusion
|
| 150 |
-
β ββ agent_diagnostics/ # differential logic, red flags, uncertainty
|
| 151 |
-
β ββ agent_pharmacology/ # DDIs, dosing, contraindications
|
| 152 |
-
β ββ agent_triage/ # urgency/disposition policy
|
| 153 |
-
ββ rag/
|
| 154 |
-
β ββ pipelines/ # Node & Graph RAG, safety rails
|
| 155 |
-
β ββ build_index.py # EMR/EHR + PubMed indexing
|
| 156 |
-
β ββ server.py # retrieval API with citation payloads
|
| 157 |
-
ββ training/
|
| 158 |
-
β ββ datasets/ # loaders for curated/synthetic cases
|
| 159 |
-
β ββ augmentation/ # QAC, counterfactuals, back-translation
|
| 160 |
-
β ββ finetune/ # KD, LoRA/QLoRA, GRPO loops
|
| 161 |
-
β οΏ½οΏ½β configs/ # seeds, LR schedules, early-stopping
|
| 162 |
-
ββ eval/
|
| 163 |
-
β ββ medmcqa/ # benchmark harness
|
| 164 |
-
β ββ pubmedqa/ # benchmark harness
|
| 165 |
-
β ββ semantics/ # embedding audits, hallucination metrics
|
| 166 |
-
ββ docs/ # design notes, risk register, policies
|
| 167 |
-
ββ scripts/ # utilities, data prep, CI hooks
|
| 168 |
-
ββ requirements.txt
|
| 169 |
-
ββ .env.example
|
| 170 |
-
ββ LICENSE
|
| 171 |
-
```
|
| 172 |
-
|
| 173 |
-
---
|
| 174 |
-
|
| 175 |
## Roadmap
|
| 176 |
|
| 177 |
* [ ] Expand specialty coverage (cardiology, oncology, paediatrics).
|
|
@@ -219,7 +252,4 @@ https://huggingface.co/MedAI-COS30018
|
|
| 219 |
---
|
| 220 |
|
| 221 |
## License
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
|
| 225 |
-
|
|
|
|
| 61 |
---
|
| 62 |
|
| 63 |
## Architecture
|
| 64 |
+
|
| 65 |
+
### *L1. System Overall*
|
| 66 |
+
|
| 67 |
+
```plaintext
|
| 68 |
+
+------------------------+ +----------------------------+
|
| 69 |
+
| 1. Clinician UI / EMR |--C1: symptoms, meds, files ---------> | 2. MCP Orchestrator |
|
| 70 |
+
| plug-in (PHI-safe) | | FastAPI router, planning |
|
| 71 |
+
+------------------------+ | safety, tracing (traceID) |
|
| 72 |
+
+-------------+--------------+
|
| 73 |
+
|
|
| 74 |
+
| plan / route
|
| 75 |
+
v
|
| 76 |
+
+-----------------------+-----------------------+
|
| 77 |
+
| 3. Specialist LLM Agents |
|
| 78 |
+
| +-----------------+ +---------------------+ |
|
| 79 |
+
| | Diagnostics | | Pharmacology (Rx) | |
|
| 80 |
+
| | differential Dx | | DDI, dosing, contra.| |
|
| 81 |
+
| +-----------------+ +---------------------+ |
|
| 82 |
+
| +-----------------+ +---------------------+ |
|
| 83 |
+
| | Triage | | Summarizer (SOAP) | |
|
| 84 |
+
| | urgency, dispo. | | clinical notes | |
|
| 85 |
+
| +-----------------+ +---------------------+ |
|
| 86 |
+
+-----------------------+-----------------------+
|
| 87 |
+
^ ^ ^
|
| 88 |
+
| | |
|
| 89 |
+
| evidence | | evidence
|
| 90 |
+
| | |
|
| 91 |
+
+---------------------------+ evidence queries +-------------------+-----------+----+----------+
|
| 92 |
+
| 5. VectorDB / Long-Term | <--------------------------- | 4. Agentic RAG (Query Router --> Retriever --> |
|
| 93 |
+
| Memory (EMR+Lit embeds, | ---------------------------> | Safety Rails) |
|
| 94 |
+
| chat turns, provenance) | store traces/embeddings +-------------------+-------------------------+-+
|
| 95 |
+
+---------------------------+ | |
|
| 96 |
+
| top-k, citations |
|
| 97 |
+
v v
|
| 98 |
+
+-------------+ +---------------+
|
| 99 |
+
| 4c. Med KB | | 4d. EMR |
|
| 100 |
+
| PubMed, | | summarizer |
|
| 101 |
+
| guidelines | | (PHI-safe) |
|
| 102 |
+
+-------------+ +---------------+
|
| 103 |
+
|
| 104 |
+
|
|
| 105 |
+
| answers + rationale + citations
|
| 106 |
+
v
|
| 107 |
+
+-------------------------+------------------------+
|
| 108 |
+
| 7. Evidence Fusion & Self-Consistency (MCP) |
|
| 109 |
+
| voting, SLM adjudication, risk flags, refusal |
|
| 110 |
+
+-------------------------+------------------------+
|
| 111 |
+
|
|
| 112 |
+
v
|
| 113 |
+
+------------------------+ final report (summary, plan, citations, cautions) +--------------------+
|
| 114 |
+
| 1. Clinician UI / EMR | <----------------------------------------------------------------- | 8. Evaluation & |
|
| 115 |
+
| (display result) | | QA Harness |
|
| 116 |
+
+------------------------+ --------------------- telemetry / traces -------------------------> | MedMCQA, |
|
| 117 |
+
| PubMedQA, sim |
|
| 118 |
+
| audits, LR ctrl |
|
| 119 |
+
+-----------------+
|
| 120 |
+
```
|
| 121 |
+
|
| 122 |
+
### *L2. Agentic RAG Internals*
|
| 123 |
+
|
| 124 |
+
```plaintext
|
| 125 |
+
+----------------------------- 4. Agentic RAG ----------------------------------------------+
|
| 126 |
+
| Inputs: symptoms, vitals, meds, files, chat LTM snippets |
|
| 127 |
+
| |
|
| 128 |
+
| +-----------------+ +-----------------+ +--------------------+ |
|
| 129 |
+
| | 4b Query Router | --> | 4b Rewriter | --> | 4b/RET Retriever | -- top-k --> |
|
| 130 |
+
| | (Node / Graph) | | (expand/disamb) | | (vector + keyword) | |
|
| 131 |
+
| +--------+--------+ +-----------------+ +----------+---------+ |
|
| 132 |
+
| | filter Ο | |
|
| 133 |
+
| +--------v--------+ +------v------+ +-----------+ |
|
| 134 |
+
| | 4 SR Safety | allowlist, section filters, | 4c Med KB | | 4d EMR | |
|
| 135 |
+
| | Rails | dedupe, provenance enforcement | (PubMed/GL) | | Summarizer| |
|
| 136 |
+
| +--------+--------+ +------+------ + +-----+-----+ |
|
| 137 |
+
| | | | |
|
| 138 |
+
| +--------v--------+ +------v------+ +-----v-----+ |
|
| 139 |
+
| | 5 VectorDB/LTM | <---- write embeddings/traces ----| evidence | | patient | |
|
| 140 |
+
| | (embeds+proven.)| | bundle | | snippets | |
|
| 141 |
+
| +-----------------+ +-------------+ +-----------+ |
|
| 142 |
+
+------------------------------------------------------------------------------------------+
|
| 143 |
+
Outputs: Evidence bundle [{snippet, section, citation, similarity}], EMR summary, provenance map
|
| 144 |
+
```
|
| 145 |
+
|
| 146 |
+
### *L3. Single-turn Dataflow*
|
| 147 |
+
|
| 148 |
+
```plaintext
|
| 149 |
+
Clinician --> UI/EMR --> MCP Orchestrator --> RAG (Router --> Retriever --> SafetyRails)
|
| 150 |
+
^ | \
|
| 151 |
+
| v \
|
| 152 |
+
| EMR Summarizer ----------------------------\
|
| 153 |
+
| \
|
| 154 |
+
\------------------------------ Final Report <----- Evidence Fusion <---- Agents (Dx/Rx/Triage)
|
| 155 |
+
| ^ /
|
| 156 |
+
| | /
|
| 157 |
+
+--> VectorDB/LTM -----+----- write ----
|
| 158 |
+
\
|
| 159 |
+
--> Evaluation/QA
|
| 160 |
```
|
| 161 |
|
| 162 |
---
|
|
|
|
| 205 |
|
| 206 |
---
|
| 207 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 208 |
## Roadmap
|
| 209 |
|
| 210 |
* [ ] Expand specialty coverage (cardiology, oncology, paediatrics).
|
|
|
|
| 252 |
---
|
| 253 |
|
| 254 |
## License
|
| 255 |
+
MIT License.
|
|
|
|
|
|
|
|
|