Kye Gomez commited on
Commit
d9837be
Β·
1 Parent(s): 9f7a101
Files changed (3) hide show
  1. README.md +44 -0
  2. mai_dx/__init__.py +0 -0
  3. mai_dx/main.py +12 -0
README.md CHANGED
@@ -14,6 +14,50 @@ pip3 install mai-dx
14
 
15
  ...
16
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
 
18
  ## Citation
19
 
 
14
 
15
  ...
16
 
17
+ ---
18
+
19
+ ## Architecture
20
+
21
+ ### Virtual Panel Roles
22
+
23
+ The virtual panel consists of five specialized roles:
24
+
25
+ - **Dr. Hypothesis** – Maintains a probability-ranked differential diagnosis with the top three most likely conditions, updating probabilities in a Bayesian manner after each new finding.
26
+
27
+ - **Dr. Test-Chooser** – Selects up to three diagnostic tests per round that maximally discriminate between leading hypotheses.
28
+
29
+ - **Dr. Challenger** – Acts as devil's advocate by identifying potential anchoring bias, highlighting contradictory evidence, and proposing tests that could falsify the current leading diagnosis.
30
+
31
+ - **Dr. Stewardship** – Enforces cost-conscious care by advocating for cheaper alternatives when diagnostically equivalent and vetoing low-yield expensive tests.
32
+
33
+ - **Dr. Checklist** – Performs silent quality control to ensure the model generates valid test names and maintains internal consistency across the panel's reasoning.
34
+
35
+ ### Decision Process
36
+
37
+ After internal deliberation, the panel reaches consensus on one of three actions:
38
+ - Asking questions
39
+ - Ordering tests
40
+ - Committing to a diagnosis (if certainty exceeds threshold)
41
+
42
+ Before tests are ordered, an optional budget tracker can be invoked to estimate both the cumulative medical costs so far and the cost of each test in the order.
43
+
44
+ ### MAI-DxO Variants
45
+
46
+ We evaluate five variants of MAI-DxO to explore different points on the accuracy-cost frontier (from most cost conscious to least):
47
+
48
+ - **Instant Answer** – Diagnosis based solely on initial vignette (as in Figure 3), without any follow-up questions or tests.
49
+
50
+ - **Question Only** – The panel can ask questions, but cannot order diagnostic tests. The cost is simply the cost of a single physician visit.
51
+
52
+ - **Budgeted** – The panel is augmented with a budgeting system that tracks cumulative costs (a separately orchestrated language model call) towards a max budget and allows the panel to cancel tests after seeing their estimated cost.
53
+
54
+ - **No Budget** – Full panel with no explicit cost tracking or budget limitations.
55
+
56
+ - **Ensemble** – Simulates multiple doctor panels working in parallel, with an additional panel to provide a final diagnosis. This is implemented as multiple independent No Budget runs with a final aggregation step to select the best diagnosis. Costs are computed as the sum of the costs of all tests ordered by each of the runs, accounting for duplicates.
57
+
58
+ ### Technical Implementation
59
+
60
+ MAI-DxO was primarily developed and optimized using GPT-4.1, but is designed to be model-agnostic. All MAI-DxO variants used the same underlying orchestration structure, with capabilities selectively enabled or disabled for variants.
61
 
62
  ## Citation
63
 
mai_dx/__init__.py ADDED
File without changes
mai_dx/main.py ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from swarms import Agent
2
+
3
+
4
+ class MaiDxOrchestrator:
5
+ def __init__(self, conversation_backend: str = None, agents: list[Agent] = None):
6
+ self.conversation_backend = conversation_backend
7
+ self.agents = agents
8
+
9
+ def run(self, task: str, *args, **kwargs):
10
+ pass
11
+
12
+