AI Agent Architecture: Terminal Execution Workbenches vs. Gateway Assistants
This article compares two open-source AI agent forms—gateway-based personal assistants and terminal execution workbenches—from an architectural perspective. Instead of asking which one is stronger, it breaks down their core positioning, key design points, trade-offs, and differences across six dimensions such as interaction focus, state storage, capability extension, and feedback sources. It also offers a three-question selection framework, a combined deployment pattern, and a practical implementation checklist covering permissions, isolation, observability, cost control, and skill governance.
1. Background: Why “Which One Is Better” Is the Wrong Question
Two categories of open-source agent frameworks have recently gained traction, and the most common community debate is which one will replace the other. From an engineering perspective, this side-by-side comparison lacks verifiable criteria: the two are optimized for different goals and evaluated on different dimensions—like comparing a toolbox with a control panel. A more reasonable approach is to break down their architectural essence vertically, clarify which class of problems each one solves, and then make a selection accordingly.
It is worth emphasizing that their capability sets overlap heavily, and the differences mainly come down to prioritization. A capability that ranks lower in one does not mean it is impossible to implement; it simply reflects a different product roadmap. Therefore, this article does not judge which is superior. It only distinguishes the two forms and explains how to make a decision.
2. Form A: The Gateway Personal Assistant
Core positioning: A resident assistant process running on the user’s own device, whose value lies in being “always available within the chat entry points you already use.”
Key design points:
- Channel adaptation layer: converges the differences across instant messaging platforms (message formats, authentication methods, session models, rich text and attachment handling) into a unified internal message abstraction.
- Session and context mapping: maps chat-side session identifiers to internal contexts, handling group-chat and private-chat isolation, context compression, and summarization.
- Permissions and minimal exposure: only low-risk capabilities are enabled by default; sensitive operations require explicit confirmation.
A schematic internal message abstraction:
@dataclassclass InboundMessage:channel: str # Channel type identifiersession_id: str # Session isolation keysender: strtext: strattachments: list # Unified attachment descriptionis_group: boolclass ChannelAdapter(Protocol):def normalize(self, raw) -> InboundMessage: ...def reply(self, session_id: str, payload) -> None: ...
Advantages: broad integration coverage, low barrier to use, short response path.
Costs: capability boundaries are constrained by chat interaction; intermediate states of long-running tasks are hard to present; the return experience for complex artifacts (multi-file changes, test reports) is limited.
3. Form B: The Terminal Execution Workbench
Core positioning: An executor oriented toward “getting the work done,” advancing tasks over multiple rounds until it produces verifiable results.
Key design points:
- Execution loop: observe—plan—invoke tools—verify—correct, forming a continuously iterable cycle rather than one-question-one-answer.
- Tool and file system operations: read and write files, search code, run commands and tests, using the real environment as a feedback source.
- Skill accumulation: abstracts successful operation sequences into reusable skills, enabling self-evolution and experience accumulation.
- Long-term memory: retains project conventions, historical decisions, and lessons from failures across sessions.
- Gateway capabilities as an add-on: it can also connect to multiple messaging platforms, but this is not its main source of value.
A simplified execution loop:
for step in range(max_steps):obs = workspace.observe() # Collect environment and artifact stateplan = planner.decide(obs, goal) # Decide the next actionresult = executor.run(plan) # Invoke tools/commandsif verifier.passed(result, goal): # Objective verificationbreakmemory.record(plan, result) # Record experience for skill accumulation
Advantages: can complete end-to-end complex tasks with verifiable and reusable results.
Costs: requires clearer permission and sandbox design; higher costs for runtime environment and dependency management.
4. Essential Differences Across Six Dimensions
| Dimension | Gateway Assistant | Terminal Execution Workbench |
|---|---|---|
| Interaction focus | Chat entry and reach | Task progress and output |
| State carrier | Session context | Workspace and long-term memory |
| Capability extension | Adding channel adapters | Adding skills and tools |
| Feedback source | User confirmation | Tests, compilation, verification results |
| Typical artifacts | Answers, summaries, reminders | Code changes, documents, automation workflows |
| Main risks | Context bloat, accidental triggering | Unauthorized operations, environment pollution |
5. Selection Decision Framework
Three questions are enough to locate the need:
- Does the task require feedback from a real environment? If yes, lean toward the execution type.
- Must the entry point stay fixed within a chat tool? If yes, lean toward the gateway type.
- Is cross-session accumulation of project knowledge needed? A strong need leans toward the execution type.
In engineering practice, the two can be combined: use the gateway type as the unified entry and notification channel, push heavy tasks down to the execution workbench, decouple them through a message queue, store artifacts in object storage, use a container platform to provide isolated runtime environments, and rely on logging services and monitoring alerts for observability. Baidu AI Cloud typically plays a supporting role at the infrastructure and observability layers in this kind of architecture.
6. Implementation Checklist
- Permissions: read-only by default; write operations and command execution go through whitelists and manual confirmation.
- Isolation: task-level sandboxes to avoid dependency conflicts and environment pollution.
- Observability: record tool invocations and artifact changes across the full chain for traceability.
- Cost control: apply layered summarization to context; persist long tasks in segments.
- Skill governance: skills must be versioned and rollback-capable to prevent incorrect experience from becoming entrenched.
7. Conclusion
The two forms are not substitutes but products of different optimization goals: one optimizes for “reach and convenience,” the other for “completion and accumulation.” Understanding the differences in context carriers, feedback sources, and extension methods is more valuable from an engineering standpoint than debating which is stronger.
