Multi-Model AI Office Agent Architecture: A Practical Guide

    This article explains how to build an AI office agent that works with multiple LLMs without letting model differences leak into business logic. It covers a four-layer architecture (access, abstraction, routing, and governance), declarative capability contracts, configurable routing with fallback and canary rollouts, prompt and tool-output normalization, and a three-tier evaluation strategy. A phased rollout plan shows how to move from a single baseline to automatic routing, cost visibility, and version-controlled model policies.

    1. Why Office Agents Need Multiple Models

    The core scenario is an AI office agent that, beyond its own lightweight and professional models, adds several third-party LLMs to execute tasks and deliver results in productivity workflows. Strip away the specific product details and this becomes a common engineering problem: how to let an agent whose goal is to deliver work output rely on in-house models for cost and control, while calling external models on demand to fill capability gaps.

    Office work is too varied for a single model. Writing weekly reports, reviewing contracts, building spreadsheets, reading long documents, and running data analysis differ enormously in their demands on context length, instruction following, structured output, and tool-calling reliability. Multiple models are therefore not about piling on features but about resource scheduling: making dynamic trade-offs across quality, latency, cost, and compliance.

    2. Overall Architecture: Four Decoupled Layers

    Split the system into four layers so model differences do not propagate upward into business code:

    1. Access layer: hides per-vendor API differences and unifies authentication, timeouts, retries, and streaming output.
    2. Abstraction layer: defines a unified model capability description and invocation contract.
    3. Routing layer: selects models based on task characteristics and policy.
    4. Governance layer: handles evaluation, quotas, logging, and cost attribution.

    A sketch of the unified invocation contract (pseudocode):

    1. class ModelAdapter:
    2. def chat(self, messages, tools=None, max_tokens=2048,
    3. temperature=0.3, stream=False): ...
    4. def capabilities(self) -> ModelCaps: ...
    5. @dataclass
    6. class ModelCaps:
    7. context_window: int # context window
    8. supports_tools: bool # tool calling support
    9. supports_vision: bool # image input support
    10. structured_output: bool # strict structured output support
    11. latency_tier: str # latency tier: low/mid/high
    12. cost_tier: str # cost tier

    The key point: describe capabilities with declarative fields instead of scattering if-else branches through business code. Adding an external model then requires only a capability description and one adapter implementation.

    3. Capability Routing: Turning Model Selection into Explainable Policy

    Routing should not be hard-coded. It should be a set of configurable, observable, and rollback-friendly policies. Common dimensions include:

    • Task type: extraction and rewriting lean toward lightweight models; long-document reasoning and complex multi-step planning lean toward stronger reasoning models.
    • Context size: switch automatically when input exceeds the lightweight model’s window, or summarize in segments first and then aggregate.
    • Output constraints: when strict JSON or a fixed template is required, prefer models with more reliable structured output.
    • Cost and latency: route high-frequency, low-value tasks to the low-cost tier; route key deliverables to the high-quality tier.
    • Failure fallback: on timeout or rate limiting from the primary model, degrade to backup models in order.
    1. routes:
    2. - name: long_doc_summary
    3. match: {input_tokens: ">60000", task: "summarize"}
    4. primary: model_strong
    5. fallback: [model_mid, model_light]
    6. - name: structured_extract
    7. match: {require_schema: true}
    8. primary: model_structured
    9. policy: {temperature: 0.0, retry: 2}

    Routing policies must also support canary rollouts: a newly onboarded model takes only a small share of traffic at first and runs in parallel with the existing model for comparison; traffic increases only after metrics meet the bar.

    4. Context and Tool Adaptation: The Most Underestimated Cost

    Models differ in their sensitivity to system prompts, tool description formats, and multi-turn history trimming. Three things matter in practice:

    • Prompt template normalization: maintain one neutral task-semantics description and let each adapter render it into the format the target model needs, so business code does not maintain multiple prompt sets.
    • Unified history compression: compress history into four parts — goal, constraints, completed steps, and pending work — to reduce semantic drift when switching models.
    • Tool result normalization: convert external tool returns into structured snippets before feeding them to the model, lowering sensitivity to long-text noise across models.

    Sketch:

    1. def render(adapter, task):
    2. base = f"Goal: {task.goal}\nConstraints: {task.constraints}\n" \
    3. f"Done: {task.done}\nTodo: {task.todo}"
    4. return adapter.render_prompt(base, tools=task.tool_specs)

    5. Evaluation and Governance: No Evaluation, No Multi-Model

    The biggest risk in a multi-model architecture is that quality becomes incomparable. Build three tiers of evaluation:

    1. Offline benchmark set: maintain labeled samples by office task category, recording accuracy, format compliance rate, average latency, and cost per call.
    2. Online parallel runs: the new model processes the same request alongside the baseline model, results recorded but not returned, to surface regressions.
    3. Human spot checks: keep human review for key deliverables such as contracts, financial spreadsheets, and external-facing copy.

    Governance also needs quotas and isolation: set per-tenant call limits, account for external and in-house model calls separately, and log the reason for each routing decision to support debugging and cost optimization.

    6. Suggested Rollout Path

    • Phase 1: complete the abstraction layer and unified contract, get the in-house lightweight and professional tiers working end to end, and establish a baseline.
    • Phase 2: onboard one or two external models as supplements, covering only clear capability gaps, with canary and parallel runs enabled.
    • Phase 3: introduce automatic routing and fallback, and build cost and quality dashboards.
    • Phase 4: bring the evaluation set and policy configuration under version control, enabling continuous iteration of model capabilities and fast rollback.

    The essence of multi-model integration is separating model selection from business logic and turning it into an infrastructure capability. Once the access, abstraction, routing, and governance layers are stable, an office agent can deliver results reliably in productivity scenarios without being tied to the quirks of any single model.