simengine

v3.0.1
io.github.cogswellspacely8-star/simengine Checked 2 days ago Published 4 months ago

Monte Carlo decision-intelligence over MCP: simulate, optimize, and decide under uncertainty.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

simulate

Run a Monte Carlo simulation. Provide either a domain filename (from the domains/ directory) or an inline config JSON. Returns statistics, safety results, fitness score, and a narrative summary.

ParameterTypeDescription
configobjectInline domain config JSON (alternative to domain filename)
domainstringDomain config filename (e.g. 'saas_startup.json')
n_simulationsintegerNumber of simulations to run (default: from config)
overridesobjectDot-path overrides applied to the config, e.g. {'parameters.close_rate.params.mode': 0.35}
seedintegerRandom seed for reproducibility (default: 42)

list_domains

List all available domain configuration files in the SimEngine domains/ directory.

validate_config

Validate a domain configuration JSON. Returns whether it is valid and any errors found.

ParameterTypeDescription
config *objectThe domain config JSON to validate

optimize

Run evolutionary optimization on a domain to find the best control settings. Uses a genetic algorithm with safety constraints.

ParameterTypeDescription
domain *stringDomain config filename
generationsintegerNumber of GA generations (default: 15)
populationintegerPopulation size per generation (default: 20)

update_bayesian

Bayesian-update simulation parameters using real observed data. Uses conjugate prior updates (Beta-Binomial, Gamma-Poisson, Normal-Normal) to calibrate the model.

ParameterTypeDescription
domain *stringDomain config filename
observations *objectMap of variable_name to array of observed values, e.g. {'close_rate': [0.25, 0.30, 0.28]}

convergence_check

Run convergence diagnostics to verify that the simulation sample size is sufficient. Tests whether statistics stabilize as N increases.

ParameterTypeDescription
domain *stringDomain config filename
max_runsintegerMaximum runs to test (default: 10000)
metricstringTarget metric to check (default: first metric)

sensitivity_analysis

Run one-at-a-time sensitivity analysis to rank which input parameters drive the most output variance. Returns elasticity and relative importance scores.

ParameterTypeDescription
domain *stringDomain config filename
metricstringTarget metric to analyze (default: first metric)
n_baseintegerBase simulation count (default: 1000)
n_perturbintegerPerturbation trials per parameter (default: 10)

baseline_comparison

Compare Monte Carlo simulation results to a deterministic (spreadsheet-style) single-point forecast. Shows the risk information hidden by deterministic forecasting.

ParameterTypeDescription
domain *stringDomain config filename
n_simulationsintegerMC simulation count (default: 5000)

decide_under_uncertainty

Decision gate for agents. Runs a Monte Carlo simulation and returns whether to PROCEED or ESCALATE based on how much of the OUTCOME distribution falls inside an acceptable range you specify. Returns the full outcome distribution plus a proceed/escalate flag and a plain-English reason. Use this to stop a multi-step agent from acting on an overconfident point estimate. NOTE: this models OUTCOME RISK (the spread of results given uncertain inputs) — not the language model's own token confidence.

ParameterTypeDescription
acceptable *objectAcceptable range for the metric; provide at least one of 'min' or 'max'.
metric *stringThe output metric to evaluate the decision against
configobjectInline domain config JSON (alternative to domain filename)
domainstringDomain config filename (alternative to config)
min_confidencenumberProbability mass that must fall within the acceptable range to proceed (default: 0.8)
n_simulationsintegerNumber of simulations to run (default: from config)
seedintegerRandom seed for reproducibility (default: 42)