AI Agent Framework Selection: From Gateway-First to Experience-First
\nThis article compares two common architectures for personal AI agents: a gateway-first, heavyweight orchestration engine and an experience-first, lightweight execution kernel. It explains why the gateway-first approach impresses in demos but struggles at scale, then outlines practical engineering improvements, including unified skill specifications, declarative permissions and sandboxing, idempotent tasks with checkpoint recovery, structured observability, and human-in-the-loop fallbacks. It also provides sample skill configuration and task state machine code, plus a selection checklist for capacity and cost planning on common cloud capabilities.
\nWhen “cyber avatar” agents move from niche experiments to mainstream tools, the debate is shifting from “can we build it” to “how should we architect it.” This article uses two representative architectures as samples. The first is a gateway-first, heavyweight orchestration engine built on a long-running resident service, with plugin ecosystems and message routing as its core strengths. The second is an experience-first, lightweight execution kernel that emphasizes natural language driving, on-demand skill loading, and failure self-healing.\n\nWe first review why the gateway-first approach looks impressive in demos but exposes weaknesses at scale: when a plugin fails or the network fluctuates, users are left facing a wall of command-line output and unreadable logs. Skills hardcoded as description files also create governance problems, such as “a colleague being reduced to a single skill.” We then present a verifiable engineering improvement path: a unified skill description and registration specification, declarative permissions with sandbox isolation, idempotent tasks with checkpoint recovery, structured observability, and human-in-the-loop fallback mechanisms. Sample skill description and task state machine code are included.\n\nFinally, we discuss capacity and cost planning on top of common cloud capabilities such as container platforms, object storage, message queues, logging services, and monitoring and alerting. The goal is to help readers build their own evaluation checklist instead of chasing the next viral project.\n\n## 1. Why “Cyber Avatar” Agents Suddenly Went Viral\n\nRecently, the personal agent space has shown clear signs of accelerated iteration. An agent that uses a messaging app as its entry point, operates a browser in the background, calls APIs, reads and writes local files, periodically fetches information, and proactively reports results had just gained community traction when a new wave of similar projects began attracting users with even lower onboarding barriers. A typical community comment was: “I had just fixed the previous generation’s errors when I decided to migrate.”\n\nThere are three reasons behind this phenomenon, and developers should break them down calmly:\n\n1. A shift in interaction paradigm. Users no longer learn “command syntax.” They describe intent in natural language, and the agent compiles that intent into a sequence of tool calls. Lower barriers lead to order-of-magnitude changes in user scale.\n2. Direct value perception. Tasks such as clearing an inbox, summarizing competitor prices, and periodically checking web pages produce verifiable and quantifiable results. For the first time, users feel that a “digital avatar” is genuinely working for them.\n3. A change in propagation structure. Demo videos spread at a much lower cost than documentation, so “demoability” is over-optimized while “operability” is systematically underestimated.\n\nIt is important to emphasize that going viral does not mean the architecture wins. The demo stage focuses on first-screen surprise, while the scaling stage focuses on failure rate, recovery time, and cost per task. These two objective functions are not aligned.\n\n## 2. Two Architectural Paths: Gateway-First vs. Experience-First\n\n### 2.1 Gateway-First Heavyweight Orchestration Engine\n\nThis type of architecture typically centers on a long-running resident service that handles message ingestion, session routing, plugin scheduling, and multi-agent collaboration. Its advantages are clear:\n\n- Strong ecosystem extensibility. Capabilities scale horizontally as plugins, and the community can contribute new connectors.\n- Strong orchestration capability. It supports multi-agent division of labor, such as one agent for retrieval, one for execution, and one for validation.\n- Broad integration coverage. It can connect to multiple messaging channels simultaneously and treat the chat window as a unified entry point.\n\nBut the costs are equally clear: the control plane and data plane are coupled inside the resident process, so any plugin exception can pollute the main execution path. Capabilities are registered through static description files, with no concept of versioning or canary rollout. Troubleshooting relies on terminals and logs, which is extremely unfriendly to ordinary users.\n\n### 2.2 Experience-First Lightweight Execution Kernel\n\nAnother approach decouples “understanding intent” from “executing actions.” The kernel retains only session and planning capabilities. Specific capabilities are loaded on demand. When failures occur, the priority is to keep the conversation uninterrupted and break complex actions into retryable small steps. Its advantages are fast onboarding, good failure visibility, and low migration cost. The challenge is that the ecosystem needs time to mature, and orchestration for complex long-running workflows must be improved.\n\nThe conclusion is not a binary choice. A more pragmatic approach is to keep the control plane lightweight and stateless, connect the ecosystem through standard protocols, and push the “heavy” parts down to a replaceable execution layer.\n\n## 3. Four Real Pain Points Exposed at Scale\n\n1. Lack of observability. Users see a chat window, but when something goes wrong, they see a terminal and stack traces. Without structured logs, trace identifiers, and task snapshots, issues cannot be reproduced.\n2. Weak failure recovery. When a long task fails midway, the entire process rolls back. Without checkpoints and idempotency, repeated execution causes side effects, such as sending duplicate emails.\n3. Chaotic skill governance. Capabilities are hardcoded in description files, lacking semantic versioning, permission declarations, and conflict detection. This leads to problems such as “same-name skill overrides” and “unauthorized access to local files.”\n4. Uncontrollable costs. Resident services plus multi-agent collaboration amplify resource usage. Without quotas and degradation strategies, both bills and latency rise.\n\n## 4. Practical Engineering Improvements\n\n### 4.1 Unified Skill Description and Registration Specification\n\nAbstract capabilities into a four-part tuple: description, input schema, permission declaration, and version. The registry is responsible for validation and canary rollout. Example:\n\nyaml\n# skill.yaml example: declarative skill description\nname: price_monitor\nversion: 1.2.0\ndescription: Periodically fetch prices from specified sites and generate a comparison summary\ninput_schema:\n targets: array<string> # list of target URLs\n cron: string # scheduling expression\npermissions:\n network: [allowlist]\n storage: [read:./data, write:./out]\n notify: [email]\nidempotency_key: "{{targets_hash}}-{{date}}"\nfailure_policy: retry_then_notify\n\n\nThe key points are: least-privilege permissions, validatable inputs, explicit failure policies, and idempotency keys for repeated execution.\n\n### 4.2 Sandboxing and Declarative Permissions\n\nThe execution layer should run in an isolated environment where the file system and network are denied by default and allowed item by item according to skill declarations. For high-risk actions such as deletion, transfers, and external sending, introduce secondary confirmation and quota limits. This turns “what it can do” into “what it is allowed to do.”\n\n### 4.3 State Persistence and Checkpoint Recovery\n\nModel long-running workflows as a state machine, persist a snapshot at each step, and resume from the most recent checkpoint on failure:\n\ntext\nCollect -> Clean -> Summarize -> Validate -> Deliver\n | | | |\ncheckpoint idempotency retry limit dead letter queue\n\n\nCombined with message queues for peak shaving and retries, object storage for intermediate artifacts, and logging services plus monitoring and alerting for dashboards, the system can provide a definitive answer of “which step, why, and how to continue” when failures occur.\n\n### 4.4 Human-in-the-Loop Fallback\n\nWhen confidence falls below a threshold or tools fail repeatedly, proactively degrade to “provide suggestions and request confirmation” instead of continuing blind retries. This reduces the risk of incorrect operations and spares ordinary users from facing a terminal.\n\n## 5. Selection Evaluation Checklist\n\n- Is the control plane stateless and horizontally scalable?\n- Do skills have versions, permissions, and canary rollout?\n- Are idempotency and checkpoints supported?\n- Are failures presented in a way users can understand?\n- Are quotas, rate limiting, and degradation supported?\n- Can the system be quickly built on common cloud capabilities such as container platforms, object storage, message queues, logging services, and monitoring and alerting, with capacity planning?\n\n## 6. Conclusion\n\nCompetition among personal agents depends on interaction creativity in the short term and engineering maturity in the long term. Instead of chasing the next viral project, make skill governance, sandbox permissions, state recovery, and observability solid. Based on the common cloud product capabilities provided by Baidu AI Cloud, developers can build a cyber avatar that is both easy to use and operable at relatively low cost, moving agents from “impressive demos” to “reliable production.”
