Why AI Agents Should Be State Machines
A monolithic agent prompt hides routing, extraction, tool selection, formatting, and recovery inside one probabilistic call. The antidote is the formal state machine: explicit states, typed transitions, validators, and recovery paths.