Agentic AI
AI Framework Bridges Gap Between LLM Code Generation and Scientific Simulation Execution
MOOSEnger introduces a "simulation-aware" agent that wraps AI models with domain validation, iterative repair, and physics-informed feedback to dramatically improve success rates for generating executable multiphysics simulation inputs.
Large language models can struggle to generate working simulation code on the first try—syntax errors, schema mismatches, and solver configuration problems often prevent code from running, even when the underlying logic is sound. MOOSEnger tackles this bottleneck by embedding AI reasoning inside a purpose-built validation and repair framework designed specifically for the MOOSE multiphysics simulation ecosystem.
The Core Problem#
Generating simulation inputs is fundamentally different from writing standalone software. A plausible-looking configuration may parse correctly but violate domain constraints, or it may execute without error while producing physically nonsensical results. Prior one-shot language model approaches fail because they have no way to ground abstract reasoning in the specific rules, file formats, and solver behavior of a target simulation engine.
How MOOSEnger Works#
The framework integrates several layers around an interchangeable reasoning model (tested with both GPT 5.2 and Gemma 4 31B):
- Domain grounding: retrieval of MOOSE-specific knowledge and documentation
- Format awareness: parsing and validation of Hierarchical Input Text (HIT) schema, syntax metadata, and language-server diagnostics
- Iterative repair: a generate-check-repair-run workflow that catches errors, proposes fixes, and validates each revision before acceptance
- Executable feedback: local validation or Model Context Protocol (MCP) backed execution, with solver output bound to each candidate input
This closed-loop approach prevents flawed code from being declared successful simply because it runs.
Measured Impact#
Testing across 200 prompts spanning eight simulation families showed dramatic improvements:
- GPT 5.2 API: success rate climbed from 5% (10/200) to 89.5% (179/200)
- Gemma 4 31B: success rate rose from 0% to 76.5% (153/200)
A complementary benchmark using the Method of Manufactured Solutions—a rigorous test that verifies both semantic correctness and numerical accuracy—found that all ten generated inputs met semantic alignment criteria, with eight also passing single-mesh accuracy checks.

