BinKhoaLe1812 commited on
Commit
c963bd1
Β·
verified Β·
1 Parent(s): 86cc960

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +97 -67
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
- ```mermaid
65
- flowchart LR
66
- U[Clinician / User] -->|case, symptoms, meds| ORCH(MCP Orchestrator)
67
- ORCH -->|route| AG1[Diagnostics Agent]
68
- ORCH -->|route| AG2[Pharmacology Agent]
69
- ORCH -->|route| AG3[Triage Agent]
70
-
71
- subgraph RAG[Agentic RAG]
72
- Q[Query Router] --> RET[Retriever (Node & Graph)]
73
- RET --> KB1[(EMR/EHR)]
74
- RET --> KB2[(PubMed)]
75
- RET --> SR[Safety Rails: filters, provenance, sectioning]
76
- end
77
-
78
- AG1 --> RAG
79
- AG2 --> RAG
80
- AG3 --> RAG
81
- RAG --> AG1
82
- RAG --> AG2
83
- RAG --> AG3
84
-
85
- AG1 --> FUSE[Evidence Fusion & Self-Consistent Reasoning]
86
- AG2 --> FUSE
87
- AG3 --> FUSE
88
- FUSE --> OUT[Final Report: summary, citations, cautions]
89
-
90
- subgraph EVAL[Evaluation & QA]
91
- M1[MedMCQA]
92
- M2[PubMedQA]
93
- SIM[Semantic Similarity Audits (biomedical embeddings)]
94
- LR[Early-Stopping + LR Scheduling]
95
- end
96
- OUT -. logged .-> EVAL
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
- Apache-2.0.
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.