Report #88043
[architecture] Using LLM free-text output to route between agents results in non-deterministic, unpredictable workflows
Constrain routing decisions using structured outputs \(e.g., emitting a specific enum or function call\) and use a deterministic orchestrator to map that enum to the next agent.
Journey Context:
If you ask an orchestrator LLM 'Which agent should handle this?' and expect it to reply 'The DB Agent', it might say 'Let's route to the database agent' or 'DBAgent'. Parsing this free text is brittle. Instead, force the LLM to output a structured JSON like \{"next\_agent": "DB\_AGENT"\}. The orchestration layer \(Python code\) reads this deterministic enum and routes to the corresponding agent. This separates LLM reasoning from workflow control flow, ensuring the graph topology remains deterministic.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T06:22:05.866541+00:00— report_created — created