Building an Open-Source Device-Cloud Collaborative Agent Platform: A Practical Guide

    This article explains how to build an enterprise-grade AI agent platform using a device-cloud collaborative architecture that combines a controlled desktop agent with a cloud-side agent platform. It covers the limitations of desktop-only and cloud-only approaches, a five-layer architecture, core mechanisms such as session continuity and capability discovery, selection criteria for open-source and self-hostable components, and a typical office scenario used to validate the design. The goal is to address desktop governance gaps and the cloud's "last mile" access problem.

    1. Why Enterprise Agents Need Device-Cloud Collaboration

    When enterprises adopt AI agents, they usually run into the limitations of two extreme approaches.

    The first is the pure desktop agent. It excels at providing a unified natural language entry point, lightweight cross-system orchestration, local context awareness, and human interaction. However, its capabilities depend heavily on the open APIs of downstream systems. When those APIs are missing, it can only fall back to UI-level automation, where stability and security are hard to guarantee. In addition, shared AI assets lack a unified operational standard, making it difficult to close the loop on authorization, usage, versioning, and auditing. Such agents also struggle to support scheduled or event-triggered, always-on tasks.

    The second is the pure cloud agent platform. Centralized compute and governance make unified operations easier, but a large amount of employee documents, tools, and business context still reside on local endpoints that the cloud cannot directly reach. This creates an obvious “last mile” disconnect.

    Combining the strengths of both—a “controlled desktop agent on the device plus an agent platform in the cloud”—results in a device-cloud collaborative architecture that is a more practical choice for enterprises. The cloud handles assets, orchestration, governance, and always-on scheduling, while the device handles controlled execution, local context, and interaction confirmation.

    2. Target Architecture: Layered Decoupling and Clear Responsibilities

    The system can be divided into five layers that interact through standard protocols, avoiding tight end-to-end coupling.

    • Access layer: a unified session entry point that supports multiple input types such as text, voice, and files, and handles identity recognition and tenant isolation.
    • Orchestration layer: responsible for task decomposition, tool selection, workflow orchestration, and session continuation for long-running tasks, with support for human-in-the-loop nodes.
    • Capability layer: encapsulates atomic capabilities such as retrieval, database queries, message notifications, and document processing as tools and plugins.
    • Execution layer: a controlled runtime on the device handles local tool calls and file operations, while a cloud runtime handles always-on and batch tasks.
    • Governance layer: covers identity and permissions, key management, audit trails, usage metering, observability, and version releases.

    The key design principle is that “the cloud manages assets and policies, while the device manages execution and context.” Both sides synchronize state through a task protocol, and any high-risk action must be validated by the policy center.

    3. Core Mechanisms of Device-Cloud Collaboration

    1. Session continuity: maintain persistent context and a state machine for each task. The device and the cloud share the same task identifier, so a session can be resumed after a disconnection, preventing a long workflow from failing the moment it is interrupted.
    2. Capability discovery and invocation: on startup, the device registers its available tool list and parameter schemas with the cloud. The cloud selects tools according to policy and issues invocation instructions, and the device returns structured results.
    3. Policies and permissions: follow the principle of least privilege. Tool calls must carry short-lived credentials, and sensitive operations introduce secondary confirmation and approval flows.
    4. Always-on and triggering: scheduled and event-driven tasks are managed by a cloud scheduler, and the device is only woken up to execute when needed, balancing always-on capability with resource usage.
    5. Observability: collect traces, invocation logs, and metrics in a unified way to form a complete view of “request–decision–tool–result,” which simplifies troubleshooting and auditing.

    The following is an illustrative logic of task dispatch and result reporting (pseudocode that only expresses the structure):

    1. # Cloud scheduler
    2. task = create_task(goal, tenant, policy)
    3. dispatch(task, target="desktop_runtime")
    4. # Controlled runtime on the device
    5. on_receive(task):
    6. tools = registry.list(task.tenant)
    7. plan = planner(task.goal, tools)
    8. for step in plan:
    9. assert policy.allow(step.tool, task.tenant)
    10. result = executor.run(step) # controlled local file/tool execution
    11. report(task.id, step, result)
    12. finish(task.id)

    4. Choosing an Open-Source, Self-Hostable Stack

    To avoid strong ecosystem lock-in and high customization costs, you can adopt a combination of an “enterprise-grade open-source AgentOps platform plus a customizable desktop runtime,” with all components supporting private, self-hosted deployment. When selecting components, focus on four points: whether they support multiple model integrations and canary switching; whether they provide asset-based version management for prompts, tools, and workflows; whether they offer fine-grained permissions and auditing; and whether they support containerized deployment and observability integration. General cloud product capabilities can be used by category—for example, object storage for documents, a message queue to decouple asynchronous tasks, a container platform to host runtimes, and logging, monitoring, and alerting services to support the governance layer.

    5. Scenario Implementation and Capability Validation

    Take a typical office scenario: an employee asks on the device to “summarize this week’s project progress and generate a weekly report.” The cloud orchestrator breaks this down into four steps: retrieval, summarization, generation, and distribution. Retrieval and reading local documents are executed on the device, summarization and generation are completed in the cloud, and distribution is delivered through a controlled messaging capability. Validation dimensions include: whether session continuity is lossless after reconnection; whether unauthorized tool calls are intercepted by policy; whether long tasks are queued by the cloud when the device is offline and resumed after recovery; and whether the full-chain logs can be traced back to every tool invocation.

    6. Current Limitations and Future Directions

    This type of solution still has room for improvement in seamless cross-device session continuity, standardized application and protocol support, observability depth, and low-code application maturity, and these need to be filled in continuously through version iterations. Overall, device-cloud collaboration uses a controllable architectural compromise to mitigate both the desktop governance blind spot and the cloud access disconnect. It is worth a try for technical teams preparing to build an enterprise-grade agent platform.