MOOSEnger -- a Domain-Specific AI Agent for the MOOSE Ecosystem

MOOSEnger is a domain-specific AI agent that combines retrieval-augmented generation with deterministic, MOOSE-aware parsing and execution tools to automatically convert natural language into validated simulation inputs, achieving a 93% execution success rate on a diverse benchmark compared to just 8% for an LLM-only baseline.

Mengnan Li, Jason Miller, Zachary Prince, Alexander Lindsay, Cody Permann

Published 2026-03-06
📖 5 min read🧠 Deep dive

Imagine you are an architect who wants to build a complex, high-tech skyscraper. You have a brilliant vision in your head: "I want a building that can withstand earthquakes, has solar glass, and a self-cooling system."

However, the construction crew (the MOOSE software) doesn't speak English. They only speak a very strict, ancient, and unforgiving dialect called HIT (Hierarchical Input Text). If you tell them "put a window here" but miss a single comma or use the wrong word for "glass," the entire building plan is rejected, or worse, the building collapses silently.

For years, getting a building built with MOOSE was like trying to translate your vision into this ancient dialect by hand. It took days of reading dusty manuals, guessing syntax, and fixing tiny errors.

Enter MOOSEnger.

What is MOOSEnger?

Think of MOOSEnger as a super-smart, bilingual construction foreman who speaks both your language (natural English) and the construction crew's strict dialect (MOOSE code).

Instead of you trying to write the code yourself, you just tell the foreman your idea: "Build a 2D heat simulation for a steel rod that gets hot on one end."

MOOSEnger then does the heavy lifting, but with a special twist: it doesn't just guess. It acts like a perfectionist editor with a safety net.

How It Works: The "Verify-and-Correct" Loop

Most AI tools are like a student taking a test: they write an answer once and hope it's right. If they get a "C," they stop. MOOSEnger is different; it's like a craftsman who keeps refining the work until it's perfect.

Here is the process, broken down into simple steps:

1. The "Translation" (RAG)

First, MOOSEnger looks at your request. It doesn't just guess; it opens a massive library of blueprints, manuals, and past successful buildings (the RAG system). It finds the exact examples of how to build a "steel rod" simulation so it knows the right vocabulary to use.

2. The "Sanitization" (Cleaning the Mess)

When you type on a computer, you might accidentally copy-paste invisible characters (like weird spaces or smart quotes) that look fine to you but break the construction crew's code.

  • The Analogy: Imagine you hand a blueprint to a builder, but the paper has invisible ink stains that confuse their laser cutter.
  • MOOSEnger's Fix: It runs a "cleaning robot" that strips away all the invisible junk, ensuring the blueprint is perfectly clean before the builder even sees it.

3. The "Grammar Police" (Repairing the Structure)

MOOSE code is like a house of cards; if one block is missing a bracket [ ], the whole thing falls.

  • The Analogy: If you say "Build a wall [and a roof]," but forget the closing bracket, the builder is confused.
  • MOOSEnger's Fix: It has a grammar-constrained repair loop. It checks the structure. If it sees a missing bracket, it doesn't just guess; it uses a strict rulebook to fix only that specific error without changing the rest of your design. It keeps fixing until the structure is solid.

4. The "Name Check" (Fixing Typos)

Sometimes you might say "use a ThermalConductor" but the software only knows "ThermalConducter" (with an 'e').

  • The Analogy: You ask for a "Red Fire Truck," but the garage only has "Red Fire Truks." A normal AI might say, "I can't find that."
  • MOOSEnger's Fix: It looks at the context. It sees you are talking about heat and trucks, realizes you made a typo, and automatically swaps "Truks" for "Trucks" because it knows what you meant.

5. The "Dry Run" (The Smoke Test)

This is the most important part. Before the AI sends the final plan to the supercomputer to run a real simulation (which takes hours), it runs a mini-test.

  • The Analogy: Before building the whole skyscraper, the foreman builds a tiny cardboard model and shakes it. If it wobbles, he fixes it.
  • MOOSEnger's Fix: It runs a "smoke test." If the simulation crashes, the computer sends back an error message like "The roof is too heavy." MOOSEnger reads that error, understands it, and rewrites the code to fix the roof. It repeats this cycle until the model stands up perfectly.

Why Is This a Big Deal?

The paper tested this system against 125 different construction challenges (from simple heat flow to complex fluid dynamics).

  • The Old Way (Just an AI): If you asked a standard AI to write the code, it would succeed only 8% of the time. It would usually get stuck on a tiny typo or a missing bracket and give up.
  • The MOOSEnger Way: By using this "clean, fix, check, and retry" loop, it succeeded 93% of the time.

The Bottom Line

MOOSEnger changes the game from "You must be an expert coder to use this powerful software" to "You just need to be an expert in your field (physics, engineering, etc.), and the AI handles the coding."

It turns the frustrating process of debugging complex code into a conversation. You describe your dream, and MOOSEnger acts as the tireless, detail-oriented partner who ensures the dream is built exactly right, brick by brick, without you ever having to worry about a missing semicolon.