The stage
World-State Model
A directed, weighted graph of institutions, contracts, routes, buffers, capital limits, and dependencies. NetworkX keeps active runs fast; Neo4j preserves versioned state.
NetworkX / Neo4j / Redis
PEI is not a prediction feed. It is a scenario-native simulation method that turns stress signals into breakpoints, constrained actor responses, burden-transfer maps, and stabilization paths.
5
simulation phases
4
technical layers
10k+
parallel branches
The pipeline is designed to answer the operational question: where does pressure go, who absorbs it, and which action changes the equilibrium?
The stage
A directed, weighted graph of institutions, contracts, routes, buffers, capital limits, and dependencies. NetworkX keeps active runs fast; Neo4j preserves versioned state.
NetworkX / Neo4j / Redis
The weather
Volatility, dependency, and regime models produce distributions instead of single-point forecasts, giving each run realistic uncertainty.
PyMC / Pyro / Stan / GARCH
The actors
Institutions do not role-play. LangGraph policies choose from allowed actions and validate every move against hard constraints.
LangGraph / LiteLLM / policy YAML
The director
Monte Carlo branches run in parallel, mutate the graph, aggregate outcomes, and return auditable intervention maps.
Ray / Mesa / Prefect
The graph defines what exists. The constraint layer defines what is possible. The model only selects from validated actions.
Read only the local state a real institution would know: nearby nodes, contracts, buffers, and balance-sheet pressure.
Compute margin stress, liquidity headroom, exposure concentration, slack, and trigger conditions using deterministic business logic.
Ask the constrained model to select from pre-compiled actions, never an open-ended fantasy response.
Reject anything that violates capital, treaty, contractual, operational, or policy constraints; then write the approved action back to the graph.
policy:
institution: Tier_1_Reinsurer
trigger: geopolitical_tension > 85
allowed_actions:
- surcharge_renewals
- activate_war_risk_exclusion
validation:
capital_ratio >= regulatory_minimum
no retroactive clause voidanceFastAPI receives the scenario, Prefect orchestrates, Redis restores state, Ray and Mesa run branches, LangGraph validates actions, and the UI receives the intervention map.
01
Trigger
02
Orchestrate
03
Retrieve state
04
Distribute runs
05
Execute actors
06
Query policy
07
Validate action
08
Mutate graph
09
Aggregate
10
Persist
11
Deliver
Historical crises become calibration events. PEI replays pre-crisis snapshots, compares predicted burden-transfer paths against observed outcomes, then updates the mechanism library where the model missed a real-world channel.
Methodology review