Multi-Agent Collaboration in Practice: From Hardcoded Gateway Binding to a Pluggable Model Aggregation Mechanism
Multi-agent collaboration (Mixture of Agents, MoA) lets multiple LLMs work together—reference models analyze in parallel while an aggregator model synthesizes the results. This article explains how we redesigned MoA from a hardcoded tool bound to a single gateway into an independent virtual model provider, covering the architecture change, configuration model, measurable quality gains, and practical engineering lessons for latency control, aggregator selection, and session integration.
1. What Is the Mixture of Agents Mechanism?
In LLM application scenarios, a single model usually has capability boundaries: some models excel at reasoning and analysis, while others perform better in language expression or tool calling. The core idea of the multi-agent collaboration architecture—commonly known as MoA (Mixture of Agents)—is to let multiple models work together through a two-stage process: reference models analyze in parallel, and an aggregator model consolidates the results, producing a final answer that surpasses the capability of any single model.
The mechanism can be broken down into two stages:
Stage 1: Parallel reference analysis. A set of reference models independently analyze the same input and produce their own answers. Because different models differ in training data, alignment strategies, and reasoning paths, they interpret the same question from different angles, cover different details, and expose different blind spots. The output of this stage is essentially a set of heterogeneous perspectives.
Stage 2: Aggregation and synthesis. An aggregator model receives all reference model outputs, performs cross-validation, deduplication, error correction, and summarization, and finally synthesizes a structurally complete, higher-quality answer. The aggregation step effectively introduces an extra round of peer review—cross-confirmation among reference models can significantly suppress hallucinations from any single model.
The value of this mechanism has been validated in practice: in similar evaluation scenarios, a well-chosen model combination often achieves several percentage points of quality improvement over the strongest single model.
2. Pain Points of the Old Architecture: Hardcoded Binding to a Single Gateway
Previously, the common implementation was to hardcode MoA capabilities to one specific model aggregation gateway. This design has clear architectural flaws:
1. Vendor lock-in. With MoA welded to a single gateway as a tool, users cannot bring in models from other channels to participate in the collaboration, severely limiting flexibility.
2. Uncontrollable costs. Flagship models on the aggregation gateway are usually billed by token, and one MoA round requires parallel calls to multiple models—so the cost stacks up to several model invocations. For high-frequency development scenarios, this expense is far from friendly.
3. No freedom of combination. Other model services the user has subscribed to (for example, model APIs from various cloud vendors or locally deployed open-source models) cannot be connected at all, making it impossible to leverage existing resources and spread out costs.
3. New Architecture Design: From a “Tool” to a “Virtual Model Provider”
The key to this architectural evolution is re-abstracting MoA from a hardcoded tool into an independent virtual model provider. This design shift is highly instructive from an engineering perspective.
3.1 Changes at the Abstraction Level
In the old design, MoA was an add-on feature alongside the model invocation chain; in the new design, MoA is modeled as a “logical model”—the interface it exposes externally is identical to an ordinary model, while internally it encapsulates the complete multi-model collaboration workflow. This means:
- MoA presets can appear in the model selector like ordinary models. Users can enable them through regular model switching commands, for example by specifying the provider as the virtual provider:
/model default --provider moa
After switching, what you get is a full agent session: it supports tool calling, multi-turn follow-ups, and context retention, rather than a one-shot invocation.
A lightweight single-call mode is also supported, letting you issue a single-round request directly as a command:
/moa <prompt>
3.2 Configuration Model
Because MoA is decoupled from any specific gateway, users can freely configure reference models and aggregator models from any source in a preset. A typical preset structure looks like this:
provider: moaname: my-moa-presetreference_models:- provider: cloud-provider-amodel: reasoning-model-large- provider: cloud-provider-bmodel: general-model-x- provider: localmodel: local-open-weights-modelaggregator_model:provider: premium-providermodel: flagship-model
This composability brings several direct benefits:
- Layered cost optimization. The reference layer can use lower-cost models or locally deployed open-weight models (local inference incurs no token fees), reserving the aggregator—the high-value step—for a flagship model. This enables a fine-grained quality-versus-cost trade-off.
- Leveraging existing subscriptions. Model APIs the user has already subscribed to can be connected directly as reference models, avoiding duplicate payments.
- Complementary capabilities. Code-savvy models and reasoning-savvy models can work side by side in the reference layer, with the aggregator responsible for combining their strengths.
4. Results and Engineering Takeaways
According to public evaluation data, a preset using a flagship model as the aggregator combined with strong reference models scored roughly 8 percentage points higher than the aggregator model alone and about 11 percentage points higher than the reference models on a comprehensive benchmark. This shows that the gain from the aggregation mechanism is real and reproducible.
For developers looking to implement a similar mechanism in their own systems, here are some engineering recommendations:
1. Control the number of reference models and latency. Reference models are called in parallel, so end-to-end latency roughly equals the slowest reference model plus aggregation time. Two to four reference models are generally sufficient; more only drives up cost and latency with diminishing marginal returns.
2. The choice of aggregator matters more than the reference models. The aggregation step requires strong long-context comprehension, information comparison, and synthesis capabilities, so you should usually assign the strongest available model to this role.
3. Handle output format alignment carefully. Output styles and formats vary widely across reference models. The aggregation prompt should explicitly require structured comparison and fusion strategies (for example, evaluate consistency item by item first, then synthesize the conclusion); otherwise, aggregation quality will fluctuate noticeably.
4. Integrate deeply with agent sessions. Abstracting MoA as a virtual provider rather than a standalone tool is the most reusable design in this refactoring—it lets multi-model collaboration seamlessly inherit existing capabilities such as session management and tool calling, avoiding reinventing the wheel.
5. Conclusion
The essence of this architectural evolution is liberating “multi-model collaboration” from dependence on any specific vendor and restoring it to a pure orchestration pattern: reference models provide heterogeneous perspectives, and the aggregator model delivers the final synthesis. The provider-agnostic design gives both the cost structure and the model combination strategy their freedom. For teams building AI applications, the “reference–aggregate” two-stage architecture combined with a pluggable model access layer is a deployment direction worth serious evaluation.
