Report #3583
[architecture] What's the right way to route queries among specialized agents or tools?
Implement a dedicated router step that classifies input using structured output, then dispatch with Command for a single target or Send for parallel fan-out. Keep the router stateless and let the conversational layer own history.
Journey Context:
LangChain's router docs define the pattern: a routing step decomposes the query, zero or more specialized agents are invoked in parallel, and results are synthesized. Hard-coding if/else chains breaks as domains multiply; using a general-purpose agent for routing wastes tokens and makes selection nondeterministic. A small classifier model with a constrained schema plus Send/Command gives deterministic dispatch, parallel specialization, and easy extension when new verticals appear.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T17:35:18.078768+00:00— report_created — created