Agent State-Machine Router Evaluator

Define your agent's states and transitions as rows or pasted text, then detect unreachable states, duplicates, cycles, and dead-ends — with a DOT-style graph export.

State & Transition Model

from-state, event, to-state
You can also edit transitions directly as editable rows below.

Transition Rows

Ready

State Table

State Type Reachable In-Degree Out-Degree

Analysis Warnings

Level Issue Detail

DOT-Style Graph


            

Professional Insights & Guide

How reachability, cycle detection, and dead-end analysis work under the hood, and how to read the warnings.

How the Analysis Works

The evaluator builds a directed graph where states are nodes and transitions are edges. Reachability uses a breadth-first traversal from the start state to find every state that can actually be entered. Cycle detection runs a depth-first search with a recursion stack: any back edge to a grey (in-progress) node reveals an infinite loop, including self-loops like idle → idle. Duplicate and conflicting transitions are found by grouping transitions on from + event; duplicates repeat an identical route while conflicts fan out to multiple targets. Dead-ends are simply nodes whose out-degree is zero.

Troubleshooting & Edge-Case Failure Points

  • A start state that isn't in the transition set is flagged immediately — reachability has nowhere to begin.
  • States with only incoming edges (like done) are legitimately terminal; the tool labels them as dead-ends rather than errors.
  • Duplicate routes that look identical may hide a mismatch in event spelling — each warning shows the exact offending strings.
  • Cycles that pass through several states are reported as full paths so you can trace the loop directly.

Detailed Step-by-Step Instructions

  1. Paste a transition list (from, event, to) or enter transitions directly in the row editor.
  2. Set the start state, then click "Analyze State Machine".
  3. Read the state table for reachability and degree counts, and the warnings table for duplicates, conflicts, loops, and dead-ends.
  4. Copy the DOT-style graph into Graphviz, Mermaid, or your design docs to visualize the corrected model.

How to Use the Agent State-Machine Router Evaluator

Models agent states and transitions, then audits for unreachable states, infinite loops, and dead-ends before runtime.

  1. Define states (awaiting_input, researching, executing, done).
  2. Wire transitions with triggers and conditions.
  3. Run the audit; fix every unreachable or loop-flagged state.

The Three Bugs That Kill Agent Routers

Reachability + cycle-exit + terminal check

State machines fail three ways: unreachable states (dead code that looks like a feature), infinite loops (A-B-A with no terminal escape), and dead-end states (non-terminal, no exits - the conversation that can never finish). The audit is classic graph reachability: walk from entry; unvisited = unreachable; cycles lacking exit edges = loops; non-terminals without outbound edges = dead-ends. Explicit routing makes these visible before users find them - free-form agent loops hide them by design.

Agent State-Machine Router Evaluator FAQ

Why use a state machine instead of letting the LLM choose steps?

The three silent killers become visible and testable. Free-form loops hide them until production.

What is a dead-end state?

A non-terminal state with no outbound transitions. Every state needs a path to done or failed.

How do I break retry loops?

Cap retries in the transition condition (attempts < 3) and provide a failure exit. Escalate on cap.