Blog Post
Explainable Rule Runs: See Why, Not Just What
Most rule engines hand you an answer. When the answer is wrong, or just surprising, you are left reconstructing how it got there from the outputs alone. AI Rule Engine now records the reasoning itself. The inference trace is a complete, readable account of a run: every rule that fired, in the order it fired, why each condition passed or failed, and every change it made to the context.
A timeline of every firing
A trace opens with a headline that tells you how the run ended and how big it was — a halt banner plus a count like “7 firing(s) · 3 iteration(s)”. The banner is one of a small set of exact outcomes: “Reached a stable state — no more rules to fire.”, “Stopped at the activation cap (possible write/read loop).”, “Cancelled before reaching a stable state.”, or “Stopped by an error during inference.” You know at a glance whether the run finished cleanly.
Below that is the timeline — one entry per firing, in sequence. Each entry shows its sequence number, an iteration badge, the rule’s name, its salience chip, and a row of “triggered by” chips naming the context keys whose change put this rule back in play. Reading top to bottom is watching the run happen.
“Why it matched,” in green and red
Every firing expands two ways.
Expand “Why it matched” and you get the rule’s condition tree with each clause colored green where it passed and red where it failed — and, crucially, the actual value each clause saw at the moment it was evaluated. Not the rule as written, but the rule as it ran. When a rule fires that you did not expect, the offending clause is right there, green, with the value that made it true.
Expand the “N change(s)” delta and you get a table of what the firing wrote: each key, the kind of change, and the value moving from old → new. Nothing about the run’s effect on the context is hidden.
The trace also carries a Derived Facts section — which facts were resolved, whether lazily or eagerly, at which iteration, and from which input keys — and an Events section that notes things like re-fires the engine suppressed because a rule’s inputs had not changed. That last one is often the answer to “why didn’t this rule fire again?”
Explain with AI
Reading a trace is precise, but sometimes you want the summary. Open Explain with AI on any trace, pick a provider — OpenAI, Azure OpenAI, Anthropic, Google, or xAI — type a model, and optionally ask a specific question (the box is pre-filled with “Why did this run produce its result?”). Generate, and you get a plain-language explanation of the run grounded in the actual trace. It is the difference between handing a colleague a stack trace and handing them a paragraph that says what happened.
Always on for tests, opt-in for production
Test runs are always traced — open any test result and the inference trace is right there, no configuration. That makes the trace your primary debugging tool while you author: change a rule, run the test, read exactly why the result moved.
For production, tracing is opt-in. Turn on Record run traces in the execution toolbar (it appears in Inference mode) and every real run captures a viewable, AI-explainable trace you can open later from run history. The toggle is honest about the trade: it “adds a small per-run cost,” because storing every firing, condition result, and context change is real work. Leave it off for high-volume sets where you do not need the detail; turn it on for the ones where an unexplained decision is expensive.
Where traces show up
Once a trace exists, it appears in three places: inside test results, in run history when the set recorded traces (expand a run and the trace card is there, Explain with AI included), and inside what-if comparisons. Run history answers what happened. The trace answers why. Very long runs are size-capped and may be marked as truncated, so a runaway set never produces an unusable wall of data.
Correct results are good. Explainable results are what you need when someone asks how a decision was made — and now you can show them, clause by clause.
Visit RuleEngine.ai to try it.
The AI Rule Engine Team