Building Multi agent Systems with Finite State Machines
Feb 22, 2025 · 17:11
Adam Terlson argues that finite state machines (state charts) combined with the Actor model provide a structured, reliable foundation for building AI agents, addressing the predictability, observability, and control that LLMs lack. He introduces five agentic patterns—tool use, human-in-the-loop, feedback, collaboration, orchestration, and chartering—each demonstrated with concrete examples like a recipe-writing agent that checks inventory, a two-agent feedback loop for nutritional critique, and a multi-agent team delivering a meal. For orchestration, an LLM directs state transitions via event emitters, while chartering lets the LLM generate the entire state chart from a privacy-removal process. Terlson uses XState library for implementations and points to his demo 'Red versus Blue' for further exploration.