A Practical Guide to Multi-Model Integration for Office AI Agents

    This article explains how to build office AI agents that work across multiple models instead of relying on a single one. It covers a three-tier capability abstraction (L1, L2, L3), rule-based plus dynamic routing with self-verification and escalation, context and tool orchestration for multi-step tasks, iterative convergence for complex deliverables, enterprise governance for permissions and quotas, and task-level evaluation and cost metrics. It also lists common anti-patterns and a phased rollout plan, showing that the durable enterprise assets are the abstraction layer, routing and verification, context and tool contracts, and governance and evaluation.

    1. Background: Why Office Agents Need Multiple Models

    As office agents evolve from single-turn question answering to multi-step task execution, the assumption that one model can handle everything starts to break down. The original material reflects a common pattern: a platform gradually opens up a dozen or so selectable models spanning three tiers — flagship reasoning, balanced, and lightweight low-cost — and gives individual and standard-tier users the choice, while providing enterprise administrators with model permission controls by department, user group, and member.

    There are three engineering drivers behind this.

    First, task complexity is highly uneven. Everyday office work is dominated by copywriting, information extraction, and formatting, which place limited demands on reasoning depth. Tasks such as solution validation, rule consolidation, process orchestration, and 3D or visualization demos require long-chain planning and self-verification. Running simple tasks on a flagship model is a pure waste of compute.

    Second, the cost structure shifts from “price per call” to “total task cost.” A complex task may require dozens of model calls, and unit-price differences get amplified by the number of calls. The metric that truly needs optimizing is not the price per thousand tokens, but the end-to-end cost of completing a business task.

    Third, governance requirements emerge. Enterprises need to answer “who can use which tier of model in which scenario,” otherwise costs become uncontrollable, data boundaries unclear, and the audit chain broken.

    2. Capability Tiers: Abstract Models as Three Tiers, Not Specific Models

    To avoid being locked in by a single vendor, it is advisable to establish a model-agnostic capability abstraction layer at the design stage. The industry commonly divides available capabilities into three tiers:

    • L1 lightweight tier: high throughput, low latency, suitable for extraction, classification, rewriting, summarization, and templated generation.
    • L2 balanced tier: stable instruction following and structured output, suitable for rule consolidation, solution checks, and multi-turn tool calling.
    • L3 flagship tier: strong long-context and complex planning capabilities, suitable for operations modeling, constraint solving, cross-system orchestration, and continuous iterative delivery.

    The value of the abstraction layer is that business code only declares “I need the L2 tier + structured output support + a context window no smaller than a given threshold,” and which specific model it maps to is decided by a configuration center. When a vendor iterates a version or adjusts pricing, only the mapping table needs to change, with no changes to business logic.

    An illustrative capability declaration and routing configuration:

    1. # Vendor-agnostic model capability abstraction
    2. tiers:
    3. L1: { min_context: 32k, supports_json_schema: true, latency_budget_ms: 800 }
    4. L2: { min_context: 128k, supports_json_schema: true, latency_budget_ms: 3000 }
    5. L3: { min_context: 256k, supports_tool_calling: true, latency_budget_ms: 12000 }
    6. routing:
    7. - task: extract_fields # information extraction
    8. tier: L1
    9. - task: check_plan_rules # rule consolidation and solution checks
    10. tier: L2
    11. - task: multi_step_orchestration
    12. tier: L3
    13. max_iterations: 12

    3. Routing Strategy: From Static Tiers to Dynamic Decisions

    Static tiers are only the starting point. A more reliable approach in production is two-layer routing that combines “rules + feedback.”

    The first layer is deterministic rules. Traffic is hard-coded and split by task type, input length, whether external tools need to be called, and whether output requires strict-mode validation. This layer is explainable and testable, and covers most traffic.

    The second layer is dynamic escalation and de-escalation. When a lightweight-tier model fails in the self-check step (for example, structured output validation fails, unit tests do not pass, or key fields are missing), it automatically escalates to a higher tier and retries, and records escalation/de-escalation events for later tuning.

    1. def run_task(task, ctx):
    2. tier = rule_based_router(task, ctx) # Layer 1: deterministic rules
    3. for attempt in range(MAX_ATTEMPTS):
    4. result = call_model(tier, task, ctx)
    5. ok, reason = verifier(task, result) # self-check: schema validation/assertions/rule comparison
    6. if ok:
    7. return result
    8. tier = escalate(tier) # Layer 2: escalate on failure
    9. ctx = append_feedback(ctx, reason) # feed the failure reason back into context
    10. return fallback_plan(task, ctx)

    The key design here is to feed the “failure reason” back to the model in a structured way, rather than simply retrying. Experience shows that a second generation carrying an explicit error description has a significantly higher first-pass rate than blind resampling.

    4. Context and Tool Orchestration: The Real Difficulty of Multi-Step Tasks

    The failure of complex office tasks is mostly not due to insufficient model capability, but to poor context management. Three practices are recommended:

    First, layered context. Store system constraints, long-term memory, current task state, and tool return results in separate partitions, and inject only the necessary fragments in each round to avoid irrelevant information diluting attention.

    Second, externalized state. The state of a multi-step task is kept in external storage (such as object storage or a document database), and the model only reads and writes state snapshots. This makes tasks interruptible, recoverable, and auditable, and also makes human takeover easier.

    Third, tool contracts. Each tool describes its inputs, outputs, and failure codes with a unified schema, and model output is validated against the schema before execution, preventing “hallucinated parameters” from landing directly in real systems.

    1. {
    2. "tool": "calendar.create_event",
    3. "input_schema": {"title": "string", "start": "iso8601", "attendees": "array<string>"},
    4. "failure_codes": ["CONFLICT", "PERMISSION_DENIED", "INVALID_TIME"]
    5. }

    5. Continuous-Delivery-Style Generation: From “One Final Version” to Version-by-Version Convergence

    For complex deliverables (such as solution documents, page prototypes, and presentation materials), generating a complete result in one shot often fails to satisfy constraints. A more robust pattern is iterative convergence: first produce a runnable or readable first version, then expand and correct it version by version based on feedback, keeping a diff record for each version. Engineering-wise, this requires three capabilities: version snapshot storage, diff comparison, and a rollback-capable release switch. This pattern shares the same roots as traditional continuous integration — small commits, fast validation, and the ability to roll back at any time.

    6. Enterprise Governance: Permissions, Quotas, and Observability

    After opening up multiple models, governance complexity rises exponentially. At least four mechanisms are recommended.

    Model the permissions. Authorize with a “department/user group/member — tier — scenario” triple, defaulting to least privilege, forcing higher tiers for sensitive scenarios and enabling stricter log retention.

    Quotas and budgets. Set call quotas and budget alerts per team, and automatically de-escalate to the lightweight tier when approaching thresholds to ensure business continuity. Build observability. Uniformly collect call volume, latency distribution, failure-code distribution, escalation rate, and cost per task to form dashboards; for scenarios with abnormally high escalation rates, prioritize optimizing prompts and tool contracts.

    Audit and data boundaries. Record “who, in which scenario, used which tier, and processed which kind of data” to meet internal audit and compliance requirements; route highly sensitive data through an independent channel, not mixed with general calls.

    7. Evaluation and Cost: Replace Unit-Price Comparison with Task-Level Metrics

    Model selection cannot rely on marketing claims; you must build your own evaluation set. The recommended process:

    1. Sample from historical real tasks to construct an evaluation set with standard answers or automatically verifiable assertions, covering the three difficulty levels L1/L2/L3.
    2. Define task-level metrics: first-pass rate, average number of iterations, end-to-end latency P95, cost per task, and human takeover rate.
    3. Run the same evaluation set for each tier of model, output an “effectiveness–cost” curve, and identify the applicable range and inflection points for each tier.
    4. After launch, continuously feed back failure samples to form a closed loop.

    An illustrative metrics summary structure:

    1. tier | pass@1 | avg_iters | p95_latency | cost_per_task | human_takeover
    2. L1 | 0.71 | 1.2 | 900ms | low | 18%
    3. L2 | 0.86 | 1.6 | 3.4s | medium | 9%
    4. L3 | 0.93 | 2.4 | 11s | high | 4%

    (The table above is a structural illustration; actual values must be based on your own evaluation results.)

    8. Common Anti-Patterns

    • Routing everything to the flagship tier: costs spiral out of control and latency becomes unacceptable, the most common waste.
    • Retrying without self-check: writing generation results directly into business systems amplifies errors.
    • No context partitioning: instruction following degrades significantly in the later stages of long conversations.
    • One-size-fits-all permissions: either everyone can use higher tiers, causing budget overruns, or everyone is disabled, causing an efficiency regression.
    • Comparing only unit price: ignoring the number of iterations, the cost per task is actually higher.

    In the first phase, build the abstraction layer and rule-based routing, first switching over the L1 scenarios that can be automatically validated to quickly gain cost benefits; in the second phase, introduce self-check and escalation mechanisms to cover L2 scenarios, and establish an evaluation set and dashboards; in the third phase, connect externalized state, tool contracts, and enterprise-level permission quotas to handle L3 complex orchestration tasks. The general cloud resource capabilities provided by Baidu AI Cloud, such as container platforms, object storage, message queues, log services, and monitoring and alerting, can serve as a general foundation for the above architecture, but specific selection should still be based on your own evaluation and budget constraints.

    The conclusion about multi-model coexistence is not complex: models are compute resources that can be swapped by tier, and what truly constitutes enterprise assets are the capability abstraction layer, the routing and self-check mechanisms, the context and tool contracts, and the governance and evaluation system. Make these four things solid, and any version update in the model market is just a configuration change.