Report #49841
[frontier] LLM routing between agents is unreliable and expensive—how to orchestrate deterministically
Use deterministic finite state machines or code-defined workflows for inter-agent orchestration. Reserve LLM calls for within-step reasoning only. Define transitions, guards, and branching in code, not in prompts.
Journey Context:
Early agent frameworks used an LLM call to decide which agent or tool to invoke next—the 'LLM-as-router' pattern. This is seductively flexible but catastrophically unreliable in production: the router hallucinates agent names, misroutes under ambiguous inputs, adds latency and cost to every step, and is untestable. Production teams are converging on code-as-orchestration: explicit state machines \(LangGraph StateGraph, temporal workflows, or plain Python FSMs\) where transitions are deterministic functions of state. The LLM is a worker inside a state node, not the router between nodes. You gain debuggability \(you can trace exactly which transition fired\), testability \(unit test your FSM\), and cost predictability. The tradeoff is less runtime flexibility—you must anticipate paths at design time—but this is a feature, not a bug, for production systems.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T14:08:27.393061+00:00— report_created — created