AI Agent Architecture: Personal Assistant Gateway vs. Self-Evolving Terminal Agent
This article compares two AI agent architectures that are often evaluated side by side despite having different design goals: a personal assistant gateway focused on channel reachability and a growth-oriented terminal agent focused on end-to-end task execution. It explains why overlapping feature lists are misleading, breaks down the core architecture of each form (channel adaptation, session and context management, security boundaries, task loops, skill reuse, and long-term memory), analyzes the engineering root causes of instability and unresponsiveness, and offers a scenario-based selection method along with common cloud capabilities for deployment.
1. The Misread “Side-by-Side Comparison”: Why Feature Lists Prove Nothing
Two categories of AI agent frameworks have been getting a lot of attention lately. Some users are anxious because one side “breaks after upgrades, responds slowly, and drops long-running tasks,” while others are eager to migrate after hearing claims of “self-evolution, automatic skill generation, and stable execution.” Emotional comparisons like this almost always lead to the wrong conclusion.
The reason is that although the two share a highly overlapping feature list, their design origins differ. One focuses on the channel reachability of a personal assistant; the other focuses on the closed-loop execution of terminal tasks. Feature overlap is a surface phenomenon—architectural trade-offs are the essence. The right approach is a vertical breakdown: examine the process model, where state is stored, tool invocation boundaries, and failure recovery mechanisms, rather than counting how many platforms each supports.
2. Form One: The Architecture of an AI Assistant Gateway
The gateway form centers on a resident service that runs on the user’s own device, packages large model capabilities into a conversational entry point, and bridges to the instant messaging and collaboration channels the user already uses. Its technical challenges concentrate in three areas.
The first is the channel adaptation layer. Message models differ greatly across channels: some are organized around conversations, others around groups plus threads; some support rich-text cards and interactive buttons, others only plain text; callback signature verification, message deduplication, and event replay are handled differently as well. The adaptation layer must converge these differences into a unified message abstraction; otherwise, upper-layer logic gets polluted by platform details.
The second is session and context management. For the assistant to “remember,” session state must be moved out of memory and persisted to durable storage, isolated by session identifier, and expired or evicted accordingly. An illustrative state structure can be understood like this:
session_id -> {channel, peer_id,history: [role, content, ts],summary: compressed long-term key points,ttl, last_active_at}
The third is the permission and security boundary. The assistant can read calendars, send messages, and look up information. Once a prompt is injected with external content, the risk is amplified. A workable approach is to tier “read” and “write” tools, require explicit confirmation for write operations, and annotate the source of external text while isolating instructions.
3. Form Two: The Architecture of a Growth-Oriented Terminal Agent
The other form is more like an AI workbench: it targets the local file system, command line, testing, and browsers, advancing over multiple rounds toward a goal. Its key design is not “connecting to a lot” but “getting things done.”
The first is the task loop and state machine. A reliable executor typically breaks a task into four phases—plan, execute, verify, and wrap up—advancing only a limited number of steps per round and writing intermediate artifacts to a working directory to avoid unbounded context growth:
plan -> act(tool_call) -> observe -> verify -> (retry | next_step) -> report
The second is the skill accumulation mechanism. So-called self-evolution is not mysterious in engineering terms: structure and save the steps, preconditions, and failure lessons of a successful task, then retrieve and reuse them when a similar goal appears next time. It requires three things—a searchable skill library, task similarity matching, and skill versioning with rollback. Without version management, the skill library quickly degrades into an unmaintainable pile of noise.
The third is long-term memory. Terminal tasks span a long time, so it is necessary to distinguish three layers—“session memory,” “task memory,” and “preference memory”—each with a different lifecycle and retrieval strategy, to avoid stale information contaminating current decisions.
4. The Engineering Root Causes of Instability and “Freezing”
Crashes after upgrades and long periods of unresponsiveness are usually not model capability problems but gaps in engineering governance. There are five common root causes: the process is blocked by a long-running task and the heartbeat times out; tool calls have no timeout or concurrency limit; missing logs make failures impossible to locate; configurations and data lack migration compatibility; and dependency versions drift.
The corresponding governance measures are general and actionable: set a timeout and retry limit for every tool call, move long-running tasks to a separate queue for asynchronous execution, expose health checks and heartbeats, combine structured logs with monitoring and alerting, and version configuration items with validation at startup. Illustration:
tool_call:timeout_seconds: 30max_retries: 2concurrency: 4long_task:mode: async_queueheartbeat_interval_seconds: 15
5. How to Choose: By Scenario, Not by Hype
The criteria can be summarized in four questions: Is the endpoint a conversation or an artifact? Is the execution environment a chat window or a local terminal? Is cross-channel reach required? Can you accept the maintenance cost of a skill library? If the endpoint is “an assistant you can ask anytime,” the gateway form is more suitable; if the endpoint is “getting the repository’s tests to pass and producing documents,” the executor is more suitable.
When deploying in the cloud, both forms can reuse common capabilities: container platforms host resident processes and elastic scaling, object storage holds task artifacts, message queues handle asynchronous long-running tasks, log services and monitoring and alerting provide observability, and a key management service manages credentials. Baidu AI Cloud offers a relatively complete set of choices in these general cloud product categories, which can be freely combined according to your own architecture.
The conclusion is straightforward: this is not a replacement relationship but two product forms. First clarify the task boundary and operational capability, then decide whether to place AI on the channel side or the terminal side—that is more valuable than chasing any hype.
