К содержанию
Статья ещё не опубликована на языке Russian. Показана версия на English.

Deterministic State Machines vs Open-Ended Autonomous Agents: Choosing the Right Tool

2 мин на чтение

A common engineering anti-pattern is forcing an autonomous LLM agent to execute a strict, compliance-sensitive multi-step procedure that belongs in a deterministic state machine. Conversely, forcing rigid decision trees onto messy natural-language conversations leads to brittle "Press 1 for Billing" bots customers hate.

Decision Matrix

RequirementDeterministic State MachineHybrid (State Machine + LLM Nodes)Open-Ended Agent
Strict legal or billing sequenceBestGoodPoor (risk of skipped steps)
Long-running timed waits (hours/days)BestBestPoor
Free-form Q&A over large docsPoorStrongBest
Unpredictable multi-tool investigationPoorModerateBest
Predictable cost & audit trailBestStrongHarder to bound

The Hybrid Architecture: Graph Skeleton, AI Inside Nodes

Most real-world business automation shines with a deterministic graph skeleton (state machine or durable workflow) that controls:

  • Entry triggers, audience eligibility, quiet hours, and opt-out rules.
  • Timed waits (for example wait 2 hours; cancel reminder if payment arrives).
  • Exact transition edges and audit logs.

Inside specific nodes of that graph, you invoke narrow, bounded LLM capabilities: classifying a free-text customer reply into an explicit branch, answering a clarifying product question from RAG, or personalizing message phrasing within approved template variables.

ts
export type FunnelState =
  | { stage: "awaiting_reply"; reminderSent: boolean }
  | { stage: "answering_question"; turnCount: number }
  | { stage: "converted"; orderId: string }
  | { stage: "handed_off"; reason: string }
  | { stage: "closed_opted_out" };

Rule of Thumb

If you can draw the business rule on a whiteboard with if / else arrows, encode the transition in deterministic code. Reserve LLM judgment for the unstructured language edges where deterministic parsers break down.

Next: organize what agents remember across sessions in Agent Memory Systems.

Было ли это полезно?