Multi-Model Aggregation Assistant Architecture: Design and Production Practices

    This article explains how to build an aggregated AI assistant that puts multiple models and tools behind a single interface. It covers capability boundaries between model and tool responsibilities, a six-layer reference architecture, routing and context control, tool orchestration for retrieval, summarization, image and slide generation, video tasks and data analysis, plus security, cost accounting, observability and a staged rollout plan.

    Where the Problem Comes From

    When enterprises adopt large models, the common pattern is to connect separate models per scenario: chat, code, multimodal, or long context. Once the entry points are scattered, accounts, quotas, prompts, audit trails, and knowledge bases become hard to manage centrally, and the business side struggles to decide which class of model a given request should go to.

    An aggregation assistant is not meant to build another universal model. It puts model selection, tool invocation, access control, and cost visibility behind one interaction surface, as a system that can actually be operated.

    Such a system typically covers a set of high-frequency capabilities: web or knowledge base retrieval, summarization of files and audio/video, image generation, presentation drafts, orchestration of text- or image-to-video generation, and data analysis over tables or logs. They share one identity, session, and audit layer, while the underlying execution units can be split per task. The following sections describe general engineering practice and are not tied to any specific product model or API.

    How to Draw Capability Boundaries

    Start by separating model capability from tool capability. The model understands intent, plans steps, and produces text or descriptions. Retrieval, object storage reads and writes, table computation, image and video rendering, and document layout belong to independent tools. Pushing everything into a single generation call is neither controllable nor reproducible.

    Recommended boundaries by task type:

    • Q&A and rewriting: prefer a general chat model with low latency and stable instruction following.
    • Long document understanding: choose a model with a larger context window and more reliable citations, and require source snippets in the output.
    • Multimodal understanding: route to a multimodal model only when the input contains images, audio, or video, to avoid unnecessary cost.
    • Structured analysis: the model only explains metric definitions and drafts queries or code; computation runs in a controlled runtime.
    • Creative generation: treat images, slides, and video as asynchronous tasks that return a job ID and a previewable result instead of blocking the conversation.

    Writing these boundaries into the product description and the system prompt works better than patching things up manually afterward. Users accept that “the current entry point does not execute arbitrary code”; they do not accept silent failure.

    Reference Architecture

    An operable aggregation assistant can be split into six layers.

    1. Access layer: web, desktop, or chat bot clients share one session protocol and carry tenant, user, and trace identifiers.
    2. Orchestration layer: breaks a natural language request into a plan and decides whether to retrieve, whether to call a tool, and whether to switch models.
    3. Model gateway: unified authentication, rate limiting, timeouts, retries, and usage metering, exposing only a stable message interface upward.
    4. Tool layer: retrieval, file parsing, object storage, table engine, image and video task queues, presentation rendering.
    5. Data layer: sessions, document chunks, vector or keyword indexes, job state, audit logs.
    6. Governance layer: content safety, permissions, sensitive data masking, cost budgets, monitoring and alerting.

    On a cloud deployment, files and generated artifacts fit naturally in object storage, long jobs go into a message queue, the services themselves run on a container platform, and call traces go to a logging service with monitoring and alerting configured. General-purpose cloud platforms such as Baidu AI Cloud typically offer these categories; when selecting one, look at isolation, encryption, region, and compliance rather than hard-coding business logic into a vendor-specific API.

    Orchestration should not become an untestable, extremely long prompt. Log the plan, the tool results, and the final answer in separate stages so runs can be replayed.

    Routing and Context

    Routing can start with rules plus a lightweight classifier; there is no need for a complex learning system on day one. Rule examples: if the attachment is a table, enter the analysis flow; if the question contains “based on the latest public information,” retrieve first and then answer; if the user explicitly asks for “more careful long-form reasoning,” switch to the corresponding model tier. The classifier outputs only a label and a confidence score; on low confidence, fall back to the default model and ask whether to switch.

    Context must be budgeted. Summarize history by turn, keep only structured fields and short excerpts from tool returns, inject only the document chunks relevant to the question, and label each with its document ID and position. Keep the system prompt stable and keep user-variable content separate from retrieved snippets, which reduces the chance of prompt injection overriding the instruction section.

    Vendor-neutral pseudocode for routing and invocation looks like this:

    1. def handle(req):
    2. intent = classify(req.text, req.attachments)
    3. if intent.needs_retrieval:
    4. chunks = search(req.tenant, req.text, top_k=5)
    5. else:
    6. chunks = []
    7. model = pick_model(intent, req.preference, budget(req.tenant))
    8. messages = build_messages(req.history_summary, chunks, req.text)
    9. if intent.tool in {"analyze_table", "render_slides", "gen_image"}:
    10. job = tools.enqueue(intent.tool, messages, req.attachments)
    11. return {"type": "job", "id": job.id}
    12. answer = gateway.chat(model, messages, timeout_s=30)
    13. audit(req, model, answer.usage)
    14. return {"type": "text", "content": answer.text, "citations": chunks}

    Use internal tier names for model identifiers, for example “fast-chat”, “long-context”, and “multimodal”, with the mapping kept in a configuration center. When the underlying provider changes, business code and prompt templates do not have to be renamed.

    Tool Orchestration Essentials

    Retrieval: when running both keyword and vector recall, deduplicate, filter by permission, and return verifiable snippets in the answer. If nothing matches, state plainly that the material was not found in the authorized sources; never fill the gap with common knowledge and pretend to cite a source.

    File and video summarization: parse first, summarize second. Keep the heading hierarchy for documents with complex layouts; for video, transcribe and build a timeline first, then compress by section. Keep the original file in object storage, store only derived data for the summary, and record the parser version so results stay reproducible later.

    Image generation: the chat model produces a controlled scene description and negative constraints, then hands them to the generation service. Save the random seed, size, and description text so the user can ask to “change one thing from the previous image.” Block trademarks, real people’s likenesses, and prohibited content by policy before submission.

    Presentations: do not let the model emit an unverifiable binary. The safer path is to generate structured data first (outline, per-slide title, bullet points) and then render through a template engine. The user edits the outline, not an unreadable internal file format.

    Text or image to video: treat it as a long job. Validate copyright and license markers on input assets, cap duration and resolution tiers, and call back into the session asynchronously. Failures should return an understandable reason, such as non-compliant material, queue congestion, or generation timeout, rather than a generic “system error.”

    Data analysis: prefer read-only data sources. Queries or scripts generated by the model must execute in a sandbox with limits on accessible tables, runtime, and output row count. Echo the definitions back to the user (filter conditions, time range, metric definitions) before showing charts. Mask personal data by default.

    Security, Cost, and Observability

    The risk of an aggregated entry point is that convenience amplifies permissions. Every tool call uses the caller’s tenant identity, not a super account belonging to the assistant service. Retrieval indexes are isolated per tenant or knowledge base. Uploaded files go through virus and type checks, and parsing is resource-limited.

    Assume prompt injection will happen: treat retrieved snippets and file content as untrusted data that cannot be promoted to system instructions. Validate tool arguments against a server-side allowlist, and never concatenate raw model output directly into a command.

    Account cost per tenant, model tier, and tool type. Set a daily budget for expensive models, and downgrade automatically to a faster, cheaper tier once exceeded, explaining the downgrade in the UI. Cache only repeatable, non-personalized sub-results, such as the parsed text of the same public document, and set an expiry.

    Observability should include at least end-to-end latency, time to first token, tool success and timeout rates, citation hit rate, user interruption rate, and cost per session. Alert on abnormal spikes, not just averages. Strip sensitive fields when sampling sessions for replay.

    Rollout Sequence

    Roll out in four steps rather than shipping every creative capability at once.

    1. Single-model chat plus a unified gateway, wiring up identity, rate limiting, and audit.
    2. Add authorized knowledge retrieval and file summarization, with mandatory citations in answers.
    3. Add asynchronous image and presentation generation, using templates and job state to keep the experience stable.
    4. Then open controlled data analysis; put video generation after policy and queues have matured.

    Use the same evaluation set at every step: factual Q&A, refusals, permission isolation, long-document citations, retry on failure, and cost regression. Without an evaluation set, routing rules quietly degrade across iterations.

    Team ownership must also be clear: the platform team owns the gateway, permissions, and observability; the business teams own scenario prompts, knowledge base scope, and acceptance criteria. Do not let each business line connect directly to model providers on its own, or aggregation becomes nothing but a shell.

    Summary

    The value of an aggregation assistant lies in converging multiple models and tools into a governable entry point: clear routing, traceable context, least-privilege tool permissions, asynchronous long jobs, and explainable cost. In implementation, stick to generic interfaces and internal tier names, and keep retrieval, parsing, rendering, and computation in a replaceable tool layer. That way, no matter how the underlying models change, the user-facing workflow, audit trail, and data boundaries stay stable, and the system keeps evolving inside an enterprise environment.