AI INVESTIGATOR / 03 / FINALISTS DEEP DIVE / 2026
DoWhy, pgmpy и EconML: точные роли.
Детальный разбор финалистов Investigator. Цель — определить, где библиотека действительно даёт causal/probabilistic value, а где canonical investigation state, hypotheses, evidence, scope, counterevidence и routing должны оставаться нашими.
Архитектурная гипотеза: DoWhy — causal computation adapter, pgmpy — Bayesian hypothesis scoring adapter, EconML — узкий quantitative specialist. Canonical Investigation Graph остаётся engine-neutral.
1. Role split
OUR INVESTIGATOR CORE
|
+-- Investigation
+-- Hypothesis
+-- Evidence
+-- CounterEvidence
+-- CausalLink
+-- OpenGap
+-- Verdict
+-- VersionScope
|
+-- DoWhyAdapter
| causal inference / RCA / counterfactual
|
+-- PgmpyAdapter
| Bayesian belief update
|
+-- EconMLAdapter
treatment-effect specialist
Library result = evidence signal, not final Investigator verdict.
2. DoWhy / PyWhy — causal computation
Best-fit capabilities
graphical causal models causal mechanisms interventions counterfactuals distribution change attribution anomaly/root-cause attribution causal influence
Where Investigator should use it
- когда есть explicit variables/events и causal graph;
- когда доступны observational/experimental measurements;
- для проверки confounders/mediators;
- для intervention/what-if analysis;
- для ranking candidate causes в quantitative RCA.
Where NOT to use it
- как генератор причин из текста;
- как источник truth без assumptions;
- для sparse documentary-only cases без data;
- как storage для investigation lifecycle;
- для provenance/authority decisions.
Adapter input
{
"investigation_id": "...",
"graph": {
"nodes": [...],
"edges": [...]
},
"data_ref": "...",
"target": "...",
"candidate_causes": [...],
"assumptions": [...]
}
Adapter output
{
"engine": "dowhy",
"analysis_type": "ROOT_CAUSE_ATTRIBUTION",
"result": {...},
"assumptions": [...],
"warnings": [...],
"reproducibility_ref": "...",
"confidence_metadata": {...}
}
3. pgmpy — probabilistic hypothesis scoring
Core use
Hypothesis H1/H2/H3 + observed evidence E1/E2/E3 + conditional structure → posterior beliefs
Why valuable
- uncertainty explicit;
- new evidence can update beliefs incrementally;
- competing hypotheses can coexist;
- sensitivity to priors can be measured;
- diagnostic-style reasoning fits technical troubleshooting.
Critical warning
Bayesian edge ≠ automatically causal edge probability update ≠ proof of mechanism
Adapter output
{
"engine": "pgmpy",
"posterior": {
"hyp_1": 0.72,
"hyp_2": 0.18,
"hyp_3": 0.10
},
"prior_sensitivity": {...},
"missing_observations": [...],
"model_ref": "..."
}
Where to require human/domain priors
Если conditional probabilities не выводятся из достаточных данных, они должны быть явно помечены как expert/model assumptions, а не скрыто «придуманы» Qwen.
4. EconML — specialist path
Use only when structure fits
T = intervention/treatment Y = outcome X/W = covariates/confounders Question: What is effect of T on Y? For which subgroup/environment?
Examples
- включение feature flag и latency;
- новый scheduler mode и throughput;
- configuration change и error rate;
- разница treatment effect по hardware revision.
Do not use when
- единственный incident без repeated observations;
- нет plausible treatment/control separation;
- только narrative evidence;
- version scope не сопоставим.
Статус: не MVP-critical dependency; adapter can be deferred if benchmark shows low coverage.
5. Canonical Investigation Graph
Nodes
ENTITY EVENT CLAIM HYPOTHESIS EVIDENCE COUNTEREVIDENCE FACTOR OUTCOME OPEN_GAP EXPERIMENT_RESULT
Edges
SUPPORTS ATTACKS PRECEDES CAUSES CONTRIBUTES_TO TRIGGERS ENABLES CORRELATES_WITH CONFOUNDS MEDIATES APPLIES_TO_SCOPE REQUIRES_TEST SUPERSEDES
Why canonical
- одна model для document-only и numeric investigations;
- DoWhy/pgmpy mapping optional;
- можно export в Dossier;
- можно передать causal claims Skeptic;
- Experiment results становятся обычным evidence node.
6. Exact adapter boundaries
DoWhyAdapter
can: run causal computations return attribution/counterfactual results cannot: create final Hypothesis change verdict route Researcher promote knowledge
PgmpyAdapter
can: calculate posterior beliefs sensitivity cannot: declare CAUSES invent priors silently close investigation
EconMLAdapter
can: estimate treatment effects cannot: be used without treatment design assumptions convert estimate directly to permanent fact
7. Qwen 30B role
Good uses
generate candidate hypotheses extract factors/events from evidence propose causal mechanisms identify discriminating evidence suggest confounders summarize library outputs draft ResearchRequest
Bad uses
"Qwen says A caused B" → final causal verdict FORBIDDEN
Structured output
{
"candidate_hypotheses": [...],
"possible_confounders": [...],
"missing_evidence": [...],
"mechanism_candidates": [...],
"confidence": 0.0
}
Qwen confidence не смешивается напрямую с statistical posterior/causal estimator confidence.
8. server2 / resource strategy
| Component | Expected profile | Policy |
|---|---|---|
| Investigator core | LOW | always available |
| pgmpy small network | LOW/MEDIUM | local sync/worker |
| DoWhy small analysis | LOW/MEDIUM | worker |
| DoWhy large bootstrap/simulation | CPU-heavy | queue/concurrency limit |
| EconML training | potentially heavy | isolated optional queue |
| Qwen hypothesis pass | GPU/LLM-heavy | selective |
Priority
Qwen 30B primary service Investigator numerical jobs yield under system load
9. Controlled server2 spike
Fixture A — confounder
C → A C → B naive correlation: A ~ B expected: no A→B causal support
Fixture B — mediator
A → M → Y expected: identify mediated path avoid double-counting M as independent root cause
Fixture C — competing causes
A → Y B → Y evidence favors A but B remains plausible expected: rank, retain alternative
Fixture D — Bayesian troubleshooting
H1 firmware regression H2 cable issue H3 environment observations arrive sequentially expected: pgmpy posterior updates + prior sensitivity report
Fixture E — quantitative intervention
config T on/off covariates X outcome latency Y expected: EconML if statistically suitable
Fixture F — sparse documents only
release notes manuals issues no numeric dataset expected: Investigator works without causal library → hypotheses + evidence + gaps → no fake numeric certainty
Measure
correct causal direction confounder handling alternative retention posterior stability sensitivity to priors mapping effort runtime RAM/CPU Qwen coexistence reproducibility explainability
10. Decision before benchmark
LIKELY REUSE: DoWhy / PyWhy for explicit causal computations LIKELY REUSE: pgmpy for probabilistic hypothesis scoring OPTIONAL: EconML for treatment-effect cases BUILD: canonical Investigation Graph hypothesis lifecycle evidence/counterevidence scope/version semantics Researcher/Experiment/Skeptic routing verdict policy
ADR possibilities
REUSE: DoWhy + pgmpy both useful ADAPT: only DoWhy integrated, pgmpy optional BUILD: canonical core sufficient for MVP; libraries deferred to advanced cases
Следующий документ: `AI_investigator_4_benchmark_и_golden_set.html` — formal benchmark dataset, causal/confounder golden cases, probabilistic scoring tests, sparse-evidence cases, resource metrics и hard gates.