Mixture of Agents and Global Routing: A Practical Guide to Multi-Agent Configuration
This guide explains how to configure a Mixture of Agents (MoA) architecture with global routing for AI assistant applications. It covers why single-model setups struggle with complex tasks, how to divide responsibilities between reference models and an aggregator model, and how routing rules direct each request to the right roles. You will also find a step-by-step configuration workflow, a sample routing configuration, an aggregation prompt structure, and practical tips for avoiding common pitfalls such as granting tool access to reference models or missing fallback branches.
1. Why Single-Model Architectures Fail on Complex Tasks
When building AI assistant applications, the most common approach is to connect a single general-purpose large language model and hand it all reasoning, planning, and execution. This works well for simple question answering, but problems surface quickly once the task chain grows longer. The model tends to keep reasoning along its first judgment without external validation. As the context grows, early constraints are easily diluted. Tool calls and final answer generation happen within the same inference pass, making it hard to tell whether an error came from wrong thinking or wrong execution.
The core idea of Mixture of Agents (MoA) is to decouple thinking from execution. It does not make multiple agents argue with each other. Instead, it uses a structured two-stage collaboration: several reference models first produce perspectives from different angles, and a single aggregator model then performs cross-validation, integration, and execution. This pattern of “multiple people brainstorm, one person delivers” naturally fits AI assistant scenarios that need both divergence and control.
2. Role Separation: Reference Models vs. the Aggregator
Reference Models (the think tank)
You typically configure 2 to 3 reference models with different specialties: one focused on logical reasoning, one on code and engineering implementation, and one on business logic and boundary-condition review. The key constraint is that reference models receive no tool permissions. They only output analysis and suggestions. They do not execute commands or write the final answer.
This delivers three benefits. First, divergence: different models have different training distributions and preferences, covering blind spots a single model would miss. Second, cost control: the reference stage only performs short-text reasoning, without triggering tool calls or long-context reads and writes, so token consumption is far lower than in the execution stage. Third, a clear security boundary: no permissions means no risk of accidental operations.
The Aggregator Model (decision maker and executor)
The aggregator is the only core role holding full permissions. It can read the entire conversation context and call tools such as the terminal, file system, and browser. Its input is the original question plus all reference perspectives. Its output is the cross-validated standard answer and the actual execution results.
The aggregator’s key capability is not generation but adjudication: deciding which perspectives contradict each other, which contain factual errors, and which approaches are not feasible in the current environment, along with the reasoning behind each decision. Choose a model with stronger general capabilities and a wider context window for this role, and make sure full tool-chain permissions are enabled.
3. Global Routing: Sending Requests to the Right Roles
Global routing determines which models a request passes through, in what order, and how to degrade when failures occur. Well-designed routing significantly reduces wasted calls.
route:default: [ref_logic, ref_engineering, ref_review]by_intent:code_task: [ref_engineering, ref_review]research: [ref_logic, ref_review]chitchat: [] # go straight to the aggregatoraggregator: core_modelfallback:on_ref_timeout: skip_and_aggregateon_ref_error: retry_once_then_skipconcurrency: parallel # call reference models in parallelmax_ref_tokens: 1200
A few practical points: the reference stage should run in parallel rather than sequentially, so latency is roughly equal to the slowest branch; intent recognition should allow an “empty think tank,” letting chitchat requests go directly to the aggregator to avoid waste; always set timeouts and fallback policies so unavailable reference models cannot block the main chain; and keep routing rules in an external configuration file to make gradual rollouts and rollbacks easier.
4. Configuration Workflow: From Zero to Working
Step 1: Prepare the environment. Confirm the model service endpoints, authentication method, and quotas. Plan the resource allocation between reference and aggregator models; the aggregator side usually needs a higher quota.
Step 2: Declare the roles. Write a system prompt for each reference model that makes clear it should “only analyze, not execute, and not write the final answer,” and require structured output segments such as “Conclusion / Evidence / Risks / Gaps” so the aggregation stage can parse them easily.
Step 3: Wire up routing. Put intent classification, role orchestration, concurrency, and fallback into the configuration file. Start with fixed rules to get it working, then gradually introduce intent-based dynamic policies.
Step 4: Implement the aggregation logic. The aggregation prompt must explicitly require listing each reference perspective, flagging conflicts, giving adjudication reasoning, and then outputting the final answer and execution steps.
[Reference perspective summary]- Perspective A: ... Risks: ...- Perspective B: ... Conflict with A: ...[Adjudication] Adopt B, because the current environment lacks the runtime that A depends on[Execution plan] 1) ... 2) ... 3) ...[Final answer] ...
Step 5: Gradual rollout and observability. Validate on a small traffic share first, recording each reference model’s adoption rate, conflict rate, average latency, and token cost, then increase traffic step by step.
5. Advanced Tips and Common Pitfalls
When selecting reference models, avoid choosing models from the same source and version; otherwise their perspectives overlap heavily and cross-validation becomes meaningless. In prompt design, do not let reference models see each other’s output, since second-hand contamination breaks independence; if iteration is needed, the aggregator should initiate a second round of targeted follow-up questions. For cost control, adjust the think tank size dynamically based on task complexity, reducing it to a single branch for simple tasks. For reproducibility, fix the random seed and temperature, and retain all intermediate artifacts for traceability.
Common pitfalls include: granting tool permissions to reference models, which causes repeated execution and state pollution; routing without a default branch, causing long-tail requests to fail outright; an overly loose aggregation prompt, where the model merely concatenates perspectives instead of adjudicating; and missing monitoring, making it impossible to tell whether accuracy gains come from the architecture or from prompt tuning.
6. Conclusion
Mixture of Agents plus global routing is essentially trading architectural constraints for stability: reference models handle divergence and gap-finding, the aggregator handles adjudication and delivery, and routing directs resources to where they are truly needed. On a general-purpose cloud platform, combining logging services, monitoring alerts, and message queues for call-chain observability and asynchronous orchestration is enough to build a multi-model collaboration setup that is operable and measurable.
