Multi-Model AI Office Agents: Architecture, Routing, and Tool Orchestration in Practice
This article examines how to build an AI office agent that works across multiple large language models instead of relying on a single one. It explains why office productivity tasks demand different model strengths, lays out a six-layer architecture, and walks through routing strategies, tool contracts, task orchestration, evaluation loops, and security and cost controls, with Python and JSON examples throughout.
1. Why Office Agents Need Multiple Models
Recent reporting indicates that an AI office agent product, in one of its updates, added several third-party large models alongside its own two in-house model tiers to cover more complex productivity tasks. Setting aside the specific brands involved, this reflects a clear engineering trend: a single model struggles to balance cost, latency, long context, and reliable tool calling at the same time, while task distribution in office scenarios is highly uneven. As a result, “multiple models coexisting plus routing by task” is becoming the mainstream architecture.
The goal of an office agent is not to “answer questions” but to break down steps around a user-provided objective, call tools, and produce deliverables (documents, spreadsheets, presentations, code, workflows). The model capabilities these tasks require fall into four categories:
- Instruction following and structured output: whether it can reliably produce parseable JSON or table structures;
- Long-context handling: whether it can locate key information across large volumes of meeting notes, contracts, and logs;
- Tool calling and multi-step planning: whether it can select the right tool, fill in parameters, and handle retries after failures;
- Cost and throughput: high-frequency light tasks need a low unit price, while low-frequency heavy tasks can tolerate higher overhead.
No single model is optimal on all four dimensions at once, which is the fundamental reason for adopting multiple models.
2. Overall Architecture: From Calling a Model to Scheduling Capabilities
A deployable multi-model office agent is typically divided into six layers:
- Access layer: unified authentication, quotas, and auditing;
- Model abstraction layer: converging interface differences across vendors into a unified contract;
- Routing layer: selecting models based on task type, budget, and latency;
- Orchestration layer: task decomposition, tool calling, state machines, and rollback;
- Data and knowledge layer: retrieval, caching, vector and structured storage;
- Observability and governance layer: evaluation, monitoring and alerting, logging services, and cost attribution.
The key principle: business code depends only on abstract interfaces, never on any specific model name.
from dataclasses import dataclassfrom typing import Protocol@dataclassclass ModelRequest:messages: list[dict]tools: list[dict] | None = Nonemax_tokens: int = 2048temperature: float = 0.2deadline_ms: int = 8000class ModelAdapter(Protocol):name: strdef chat(self, req: ModelRequest) -> dict: ...def cost_per_1k(self) -> tuple[float, float]: ... # (input, output)
The abstraction layer must unify four things: message format, tool definitions, streaming responses, and error semantics. Error semantics matter especially: failures should be classified as retryable (rate limiting, timeouts), requiring fallback (model unavailable), or non-retryable (invalid parameters), so that upper layers avoid writing fragile retry logic.
3. Routing Strategy: Sending the Right Task to the Right Model
Routing is the “brain” of the whole system, and a three-tier decision process is recommended:
- Rule tier: hard routing by task label, for example summaries go to a lightweight model and contract review goes to a long-context model;
- Scoring tier: maintain success rate, P95 latency, and unit price over a sliding window for each candidate model, then compute a weighted score;
- Fallback tier: if the primary model fails repeatedly, degrade in a preset order and record the reason for degradation.
def route(task, candidates, stats):scored = []for m in candidates:s = stats[m.name]score = (task.fit[m.name] * 0.5+ s.success_rate * 0.3- s.p95_latency / task.deadline_ms * 0.2)scored.append((score, m))return max(scored, key=lambda x: x[0])[1]
It is worth stressing that routing must be tied to the budget. Set daily/monthly token caps per tenant, and when usage approaches the threshold, automatically switch to a low-cost model or queue requests, so that a single task cannot drain the overall quota.
4. Tool Calling and Task Orchestration
The reliability bottleneck of an office agent often lies not in the model but in the tool layer. Three practices are recommended:
- Contract-based tools: each tool declares its name, purpose, parameter schema, side effects, and idempotency;
- Upfront parameter validation: model output first passes schema validation; on failure, feed the error message back so the model can self-correct, up to two times;
- State machines for long tasks: model “retrieve-draft-validate-deliver” as states, so a failure can replay from the most recent checkpoint.
{"name": "render_table","description": "Render structured data into a table file","parameters": {"columns": "string[]", "rows": "object[]"},"idempotent": true}
In addition, long tasks should have an overall deadline and token budget; on timeout, produce “partial results plus a to-do list” rather than leaving the user waiting.
5. Evaluation and Observability: No Measurement, No Optimization
A multi-model system must establish two paths: an offline evaluation set and online canary releases. The offline set covers typical office tasks (meeting minutes, weekly reports, contract clause extraction, data reconciliation), with metrics including task success rate, structural validity rate, manual rework rate, and cost per task. On the online side, logging services and monitoring alerts track P95 latency, degradation rate, and tool failure rate, while attributing cost to tenants and task types.
A practical minimal evaluation loop:
- Fix 20–50 real tasks as a regression set;
- After each change to prompts, routing weights, or tool schemas, run the full set;
- Compare success rate and cost; release only if neither metric regresses;
- Canary 5% of traffic, observe for 24 hours, then roll out fully.
6. Security, Compliance, and Cost Control
Office data often contains sensitive information, so the architecture must provide encryption in transit and at rest, per-tenant key isolation, least-privilege tool authorization, masking of sensitive fields before they enter the model, and end-to-end audit trails. If external model services are used, send only the minimal context necessary to complete the task, and specify in the contract that data will not be used for training.
For cost control, use semantic caching to reuse results of high-frequency questions, use small models for intent recognition and initial screening, and reserve large models for steps that genuinely need reasoning and long context; also set timeouts and truncation for streaming output to prevent abnormally long outputs from inflating the bill.
7. Conclusion
The essence of adopting multiple models is turning “model selection” from a one-time decision into a continuous runtime scheduling problem. What developers really need to build is a unified model abstraction, explainable routing, a contract-based tool layer, and a measurable evaluation system. With these four pieces solid, an office agent can deliver results reliably no matter how the underlying models change, while achieving a sustainable balance among cost, latency, and quality.
