Mixture of Agents (MoA): Architecture and Practical Setup

    Learn how Mixture of Agents (MoA) separates parallel model analysis from centralized decision-making and execution. This guide explains reference and aggregator roles, model selection, prompt templates, workflow orchestration, and practical ways to manage cost, conflicting advice, and tool permissions.

    Mixture of Agents (MoA): Architecture and Practical Setup

    1. What Is Mixture of Agents?

    Mixture of Agents (MoA) is a collaborative inference architecture that combines multiple models. Its core idea is straightforward: multiple models analyze a task in parallel, while one model makes the final decision.

    A conventional single-model AI assistant has clear limitations. On complex tasks, it may rely on unsupported assumptions, hallucinate facts, miss logical flaws, or produce incomplete solutions. Simply allowing multiple agents to work independently can introduce a different problem: unclear responsibilities. Agents may operate tools simultaneously, overwrite each other’s results, and leave outputs that are difficult to reconcile.

    The MoA workflow described here uses a clear division of labor: separate exploratory analysis from final decision-making and execution. It combines the diverse perspectives of several models with the coordinated execution of a single model, reducing both narrow reasoning and the operational confusion of concurrent agent actions.

    2. The Two Roles in This MoA Workflow

    Reference Models: The Advisory Team

    A typical setup uses two or three reference models with complementary strengths, such as code analysis, logical reasoning, or domain knowledge. Lightweight or mid-sized models can serve this role.

    Their responsibilities are deliberately limited:

    • Analyze, but do not execute. Reference models have no tool permissions and cannot access terminals, file systems, or browsers.
    • Provide perspectives. They examine the user’s question from different angles, identify potential weaknesses, surface overlooked details, and suggest candidate approaches.
    • Do not produce the final answer. Their outputs are advisory material, not the system’s final conclusion.

    This design offers several benefits:

    • Broader perspectives: Differences in training data and model tendencies can produce complementary analyses and reduce dependence on a single viewpoint.
    • Lower advisory costs: Lightweight models can be used, without tool-call overhead.
    • Risk isolation: An incorrect suggestion does not directly trigger an action or alter the execution workflow.

    The Aggregator Model: Decision-Maker and Executor

    The aggregator is the only model in this workflow with full execution permissions:

    • Access to the complete context: It receives the original question, conversation history, and all reference-model outputs.
    • Access to tools: Terminal operations, file reads and writes, and web searches are centralized here.
    • Synthesis and cross-checking: It compares recommendations, identifies agreement and contradictions, retains useful reasoning, and addresses weaknesses.
    • Final output and execution: It produces the final answer and initiates any required actions.

    The central benefit is that the system does not rely solely on one model’s perspective. Cross-checking multiple analyses can reduce hallucinations, logical gaps, and incomplete solutions, improving accuracy on complex tasks.

    3. Why This Architecture Works

    From an engineering perspective, this workflow relies on three mechanisms:

    1. Diversity supports error correction. Independent models can expose mistakes that a single model may repeat across multiple attempts. Agreement across different perspectives can increase confidence in a conclusion.
    2. Restricted permissions simplify execution. Only the aggregator can take action, creating a single, auditable tool-use path. Keeping tools unavailable to advisory models follows the principle of least privilege.
    3. Clear responsibilities enable focused prompts. Reference models concentrate on analysis, while the aggregator focuses on synthesis, verification, and execution. Each role can use a purpose-built system prompt.

    4. Building a MoA Workflow

    Step 1: Select the Models

    • Reference models: Choose two or three models with complementary strengths—for example, code analysis, logical reasoning, and domain knowledge. Lightweight models can help control costs.
    • Aggregator model: Choose a capable mid-sized or large model with reliable instruction following, since it is responsible for final decisions and tool execution.

    Step 2: Design the Prompts

    A reference model’s system prompt should define a concise advisory role:

    1. You are an analysis adviser. For the user's question:
    2. 1. Analyze the problem from your area of expertise.
    3. 2. Identify potential weaknesses and risks.
    4. 3. Suggest 1–3 candidate approaches.
    5. Do not call tools, provide the final actionable answer, or produce lengthy commentary.
    6. Output format:
    7. Analysis Points / Risks / Suggested Approaches

    The aggregator’s system prompt should emphasize comparison, verification, and controlled execution:

    1. You will receive analysis from multiple advisers.
    2. 1. Compare their perspectives and identify agreement and conflicts.
    3. 2. Independently verify conflicting points.
    4. 3. Combine the useful findings into a final solution and present it in a standard format.
    5. 4. When actions are required, use the available tools step by step.
    6. You are the only role with execution permissions. Before taking action, confirm that the proposed solution is logically complete.

    Step 3: Orchestrate the Calls

    A typical workflow looks like this:

    1. User input
    2. ├─ Call reference models A / B / C in parallel
    3. │ Each independently analyzes the same question
    4. ├─ Collect their outputs into structured advisory material
    5. └─ Call the aggregator model
    6. Input = user question + conversation history + advisory material
    7. └─ Produce the final answer / execute tool operations

    Step 4: Optimize the Workflow

    • Layered MoA: For especially complex tasks, pass the first advisory layer’s outputs into a second round of analysis before final aggregation. This may further reduce errors, at a higher cost.
    • Task-based routing: Send simple tasks directly to the aggregator. Reserve the full MoA workflow for complex or multi-step reasoning tasks to reduce latency and cost.
    • Conflict-first checks: Use simple rules to detect significant disagreements before aggregation. When no conflict is detected, proceed directly to synthesis; when conflicts appear, ask the aggregator to investigate them more deeply.
    • Bound advisory output length: Limit reference-model responses to prevent excessive context growth from diluting important information.
    • Keep auditable logs: Record advisory outputs and the aggregator’s decision rationale so errors can be traced to their source.

    5. Common Problems and How to Avoid Them

    All Advisers Offer the Same Perspective

    Select models with more distinct strengths or response styles. Alternatively, ask each adviser to include at least one counterintuitive alternative perspective.

    The Aggregator Overlooks Advisory Input

    Require the aggregator to explicitly reference and evaluate each adviser’s key points. This helps ensure that all contributions are considered.

    Costs Become Difficult to Control

    Route tasks according to complexity, use lightweight reference models where appropriate, and enforce output-length limits.

    Tool Operations Become Confusing

    Check the permission boundaries again. Only the aggregator should have tool access; reference models must remain text-only advisory roles.

    6. Conclusion

    MoA combines multi-model diversity with centralized execution through a simple division of labor: several models explore the problem, and one model decides and acts.

    For complex tasks, this approach can improve accuracy and operational stability without allowing multiple agents to compete over tools or shared outputs. Clear role boundaries, well-designed prompts, and task-based routing are the key building blocks.

    Start with a small configuration, evaluate it on real tasks, and refine the workflow over time to fit your requirements and budget.