Don't Let LLMs Drive: State Machines in Agents
AI Engineer · youtube · 2026-07-20
Sharing core insights from a production voice AI tutoring app, the speaker advises: do not let the LLM dictate process progress and state. LLMs frequently cause issues in multi-step workflows, such as prematurely declaring completion, skipping validations, or getting stuck in infinite loops.
The real solution is to build an external control flow (harness) around the model. In practice, this involves abstracting the curriculum into a state machine (containing nodes like intro, teaching, checking, grading, advancing, and ending), where each node feeds the LLM a very narrow contract (e.g., "execute this action and return a specific result"). The harness validates the return values, advances the state, and determines the next action, simply ignoring the LLM if it attempts to cross boundaries, thereby ensuring system reliability.
More from coding & agent
- Coding agents are heading toward an AI-writes, AI-reviews, human-approves workflow — aftahi_ai · 2026-07-22
- oMLX 0.5.2 adds Mac menu-bar stats, low-bit decode kernels, and faster downloads — awnihannun · 2026-07-22
- GitHub review bot hits its PR limit and forces a 39-minute cooldown — DanielLockyer · 2026-07-22
- Max reasoning effort appears to be mobile-only in Codex Remote, not desktop — GabGarrett · 2026-07-22
- A Reddit demo argues online stores should expose carts and pricing through MCP — gelembjuk · 2026-07-22
- Open-source AI SDK provider routes Vercel apps through a local Codex subscription — lgrammel · 2026-07-22