Introduction
AI agents that coordinate humans often rely on large language models to hold entire workflows in context. But when participants reply hours late, change their minds, or ignore messages entirely, context-dependent designs fail silently. This article flips the approach: place the state machine in charge, and reserve the LLM for only the parts where it adds genuine value—translating natural language into structured inputs and rendering friendly output.
What Happened
A tenant reports a leaking kitchen sink to their landlord's agent. The agent must coordinate a plumber, the tenant, and a landlord who approves any expense—all without a shared communication channel and with no obligation for anyone to reply quickly. The piece builds a nine-state finite state machine that tracks the job from reported through scheduling, landlord approval, and completion. Each transition is triggered by concrete inputs: a tenant reply, a contractor update, or landlord approval, all persisted in a database rather than the AI's transient memory.
Why This Matters
Traditional agent architectures place the model at the center, letting it remember who said what. With humans, who are inherently unpredictable, that design breaks down. By moving state into durable code and using the LLM only as an input encoder and output renderer, the system stays predictable. The machine knows exactly who’s been asked what, what they agreed to, and what’s still pending—even when people don’t reply on time or retract consent.
Key Takeaways
- Store all job state in a durable register, not the AI’s context window.
- Use the LLM to encode incoming messages into state machine symbols, with UNCLEAR as a first-class option.
- Use the LLM only to render outgoing messages in natural tone, while code decides the factual content.
- Human inputs arrive late, may be missing, or contradict earlier replies—the machine must handle that without breaking.
- The AI speaks human; the machine keeps humans in sync.
Conclusion
Shifting state from LLM memory to deterministic code doesn’t limit AI capability—it strengthens it. When the machine owns the workflow, the LLM becomes a reliable bridge between natural language and structured action. The result is an agent that can coordinate real people across real time gaps without losing track, forgetting promises, or making unauthorized decisions.








Discussion
Join the conversation
Thoughtful reactions, questions, and follow-up ideas help shape the next story.