MoA Multi-Agent Consultation: Architecture and Global Routing Configuration

    Learn how to implement a Mixture of Agents (MoA) consultation workflow with advisory models and a single executor. This guide covers role boundaries, a minimal setup, global request routing, and tuning techniques for quality, cost, latency, and operational control.

    1. Why Use a Multi-Agent Consultation Pattern?

    When building AI assistant applications, developers often face two extremes:

    • A single-model approach: Simple to implement, but difficult to protect against one model’s knowledge gaps, reasoning biases, and hallucinations.
    • Unstructured multi-agent interaction: Multiple agents converse and execute actions independently. Although this can appear productive, it can lead to circular debates, unclear responsibilities, and uncontrolled costs.

    MoA, or Mixture of Agents, offers a more structured middle ground. The consultation pattern described here follows a simple principle: multiple advisors, one executor.

    • Two or three models with complementary strengths form an advisory group. They analyze the problem, identify gaps, add details, and suggest alternatives.
    • One main model consolidates their recommendations, produces the final answer, and performs any required actions.

    This pattern offers three key benefits:

    1. Separation of responsibilities: Advisory models have no tool-execution permissions. They provide recommendations rather than run commands, avoiding the permission-control problems associated with multiple independently acting agents.
    2. Improved answer quality: Analysis from multiple perspectives can help reduce omissions and hallucinations.
    3. Controlled costs: Lightweight advisory models can participate only when needed, keeping costs below approaches that involve large models in every request.

    2. Role Design for a MoA Architecture

    A typical MoA consultation workflow has three layers.

    User Layer

    The user submits a question naturally, without having to follow a special input format.

    Advisory Model Layer

    The advisory group should have clear responsibilities and constraints:

    • Number of models: Start with two or three. Adding more can introduce noise and increase latency.
    • Complementary strengths: For example, use one model for logical reasoning, another for code implementation, and a third for risk review.
    • Permission boundaries: Disable tool execution for all advisory models. Allow text output only.
    • Output structure: Ask each advisor to return three sections: reasoning approach, potential issues, and recommended solution. A consistent format makes consolidation easier.

    Main Model Layer

    The main model receives the original user question and the advisory outputs. It removes duplication, evaluates competing recommendations, and integrates the useful findings into a final answer.

    If the task requires tools—such as code execution, file access, or retrieval—only the main model executes those operations.

    The following pseudocode illustrates the orchestration:

    1. def moa_pipeline(user_query):
    2. opinions = []
    3. for ref_model in reference_models: # 2–3 advisory models
    4. opinions.append(ref_model.think(user_query)) # Analyze only; do not execute
    5. final_answer = main_model.execute(
    6. query=user_query,
    7. advisory=opinions # Consolidate advice and execute as needed
    8. )
    9. return final_answer

    3. A Minimal Setup for Beginners

    If you are new to multi-agent orchestration, begin with a small configuration:

    1. Choose the main model: Select a capable model that supports tool calling to serve as the executor.
    2. Choose the advisory models: Select two lightweight models and give them analysis-focused and review-focused system prompts, respectively.
    3. Disable advisory tool permissions: Explicitly disable function calling for those models in the configuration.
    4. Write a consolidation prompt: Instruct the main model to evaluate the advisors’ recommendations and produce a final answer, rejecting incorrect recommendations when opinions conflict.
    5. Validate the workflow sequentially: First test the pipeline with one advisor, then expand to two or three while observing changes in output quality.

    The goal at this stage is not maximum performance. It is to get the consultation workflow running and understand the role boundaries.

    4. Advanced Configuration: Global Request Routing

    Applications that handle multiple task types—such as question answering, coding, and data analysis—benefit from a global routing layer.

    This layer sits at the request entry point. It determines whether a request needs MoA consultation and which advisory models should participate.

    Routing Design Principles

    • Intent classification: Use a lightweight classification model or rule-based keyword matching to identify the request category and complexity.
    • Tiered handling:
      • Simple requests, such as casual conversation or single-step queries, go directly to the main model to save costs.
      • Complex requests, such as solution design or code refactoring, trigger MoA consultation.
      • High-risk operations, such as deleting data or changing a production environment, require consultation and human confirmation.
    • Configurable routing rules: Store intent-to-model mappings in a configuration file rather than hard-coding them, so they can be adjusted later.

    Example Routing Configuration

    1. routing_rules:
    2. - intent: simple_qa
    3. mode: direct
    4. executor: main_model
    5. - intent: code_design
    6. mode: moa
    7. advisors: [logic_model, code_model]
    8. executor: main_model
    9. - intent: risky_operation
    10. mode: moa_strict
    11. advisors: [logic_model, review_model, safety_model]
    12. require_confirmation: true

    5. Tuning the Consultation Workflow

    Limit Advisory Context Length

    Advisory outputs can become verbose. Set an output-length limit or summarize the recommendations before passing them to the main model to avoid exceeding its context window.

    The original guidance suggests keeping each advisory response to roughly 300 characters; the practical objective is to keep recommendations concise.

    Deduplicate Advice and Resolve Conflicts

    When advisors disagree, define prioritization rules in the main model’s prompt. For example, safety-review recommendations should take precedence over efficiency suggestions.

    The main model should assess the recommendations rather than simply combine all of them.

    Balance Latency and Concurrency

    Advisory models do not depend on one another, so their calls can run in parallel. This can bring the consultation-stage latency closer to the time needed for a single advisory call.

    Use Progressive Consultation

    Start with one advisor. Add a second only when the main model has low confidence or the request contains risk-related keywords.

    This allows consultation costs to adapt to the needs of each request.

    Establish an Evaluation Loop

    Record each consultation’s input, advisory outputs, and final response. Regularly review a sample to determine whether consultation actually improves answer quality.

    Use the findings to adjust the advisory model combinations and routing rules.

    6. Conclusion

    The MoA consultation pattern replaces unstructured agent interaction with clearly defined responsibilities: advisors analyze without executing, while the main model evaluates their advice and handles the final response and any actions. Global routing then determines which requests need consultation and which can be handled directly.

    For beginners, the priority is to build a working minimal pipeline and establish clear role boundaries. For production teams, configurable routing, concise advisory context, and ongoing evaluation are key to making the architecture stable and manageable.

    Together, these practices provide a foundation for a controlled, scalable multi-model collaboration system.