Agent System Architecture Evolution: A Practical Guide

    This article traces a three-stage evolution path for agent systems: starting with an open-source agent runtime to make skills and tool calls work, moving to a multi-agent design built around isolated workspaces, and finally building a self-developed Agent Harness for a controllable runtime core. It explains why agent systems are often rebuilt, how to define skill contracts, enforce context budgets, isolate workspaces, and govern a skill and expert marketplace, along with a practical checklist covering observability, evaluation, permissions, cost control, and evolution strategy.

    1. The Starting Point: Why Agent Systems Keep Getting Rebuilt

    In their first year of building an agent system, many teams follow the same curve. They use an off-the-shelf agent runtime to get “skill invocation + tool execution” working quickly. Once stakeholders see the results, demand expands rapidly. The system then starts to suffer from unclear capability boundaries, cross-contaminated context, and upgrades that turn into outages, until a full rewrite becomes unavoidable.

    This curve is not a team capability problem. It is an inevitable outcome of the architecture choices made early on. The fundamental difference between an agent system and a traditional microservice is this: its execution path is not determined at compile time; it is decided by the model at runtime. This means the complexity does not live in the amount of code, but in the “composable space”—the product of the number of skills, the number of workspaces, and the number of model calls. Once this space exceeds a certain threshold, a monolithic runtime becomes the bottleneck.

    This article follows a typical evolution path. Version one was built by adapting an open-source agent runtime to enable skill and tool invocation. Version two borrowed the workspace concept from intelligent coding tools and experimented with multi-agent collaboration. Version three was a self-developed Agent Harness (the agent runtime hosting layer) that consolidated a skill marketplace, an expert marketplace, and unified runtime capabilities.

    2. Stage One: Prioritize Usable Capabilities and Treat Technical Debt as an Asset

    The core goal of the first version was singular: make the model reliably do things, not just talk. The key engineering work came down to three points.

    1. Define skill abstractions before tool abstractions. A tool is an atomic capability (query, write, compute). A skill is a reusable task pattern (generate a quality inspection report, troubleshoot a link timeout). Many teams build a tool registry first, and the model then picks the wrong tool frequently because the tools are too fine-grained and too semantically close. The correct order is to define the input and output contract of a skill first, then let the skill orchestrate tools internally.

    2. Tool invocation must have deterministic failure semantics. Model-generated parameters are inherently unreliable, so the tool layer must handle parameter validation, idempotency control, and timeout isolation. A schematic description:

    1. Skill invocation chain:
    2. user intent -> skill selection (semantic matching) -> parameter slot filling -> validation/completion -> tool execution (idempotency key) -> result trimming -> context write-back

    3. The context budget is a hard constraint. The most commonly overlooked issue in the first version is the token budget. The architecture needs to separate four types of context—system prompt, long-term memory, workspace state, and current-turn observations—and set a limit and eviction policy for each. Otherwise, as skills multiply, model quality drops sharply due to context noise.

    The debt from this stage is clear: a single agent carries all responsibilities, cannot run in parallel, and cannot support quality evaluation by expert dimension. But it buys validation speed for the business. This debt should be repaid proactively in the next stage, not allowed to accumulate passively.

    3. Stage Two: From a Single Agent to Multiple Agents, with the Workspace as the Key Abstraction

    Industrial and complex business scenarios raise the bar for agents from “can answer” to “can make steady progress through a long workflow.” A single agent runs into three problems: context grows too long and dilutes attention; mixed responsibilities make it impossible to locate the source of an error; and serial execution makes latency unacceptable for long tasks.

    Borrowing the “workspace” idea from intelligent coding tools, the system can be restructured into a form of “multiple experts + isolated workspaces”:

    • The workspace is the isolation boundary: each task has its own file view, variable environment, and message channel, preventing intermediate artifacts from different tasks from overwriting one another.
    • An expert is a role-based agent: split by domain (for example, a data diagnosis expert, a workflow orchestration expert, a quality review expert), where each expert has its own skill allowlist and prompting strategy.
    • Collaboration is message passing: experts collaborate through structured messages that must carry a task identifier, source, confidence, and artifact references to support traceability.

    A common failure mode at this stage is adopting multiple agents just for the sake of multiple agents. The criterion for deciding whether to split is clear: splitting pays off only if different stages of a task need different skill sets or different context views; otherwise it only adds communication overhead and error propagation paths.

    4. Stage Three: Build a Self-Developed Agent Harness to Contain the Instability

    After version two was delivered on a certain open-source or commercial agent framework (referred to here as “a monolithic agent framework”), three structural problems surfaced: the monolithic deployment did not match the workspace isolation model; the team depended on the upstream release cadence, and breaking changes directly affected the business; and the framework’s own logic was coupled with business governance logic, making canary releases and rollbacks difficult.

    The team therefore turned to a self-developed Agent Harness, which in essence is separating the runtime from the framework to form a controllable kernel layer. It encapsulates at least four capabilities:

    1. Model invocation layer: a unified wrapper for the call protocols, retries, rate limiting, fallback, and cost accounting of different large models, hiding the differences from the layers above.
    2. Agent Loop kernel: explicit control of the “think—act—observe” loop, including maximum steps, termination conditions, loop detection, and human takeover points.
    3. Skill and workspace management: skill registration, version management, and permission checks; workspace creation, snapshots, and reclamation.
    4. Skill marketplace and expert marketplace: turn capabilities into reusable assets with support for retrieval, evaluation, listing, and delisting.

    The engineering value of a self-developed kernel is that the change cadence is under your own control. The kernel can be split into stable interfaces and replaceable implementations, with the interface layer kept backward compatible and the implementation layer rolled out gradually by version:

    1. Harness layers:
    2. access layer (protocol adaptation) -> kernel layer (loop/context/permissions) -> capability layer (skills/experts/tools) -> infrastructure layer (storage/queue/logging/monitoring)

    5. A Practical Governance Checklist

    • Observability: treat the step count, tool latency, context usage, and termination reason of each loop as first-class metrics, and connect them to logging services and monitoring alerts.
    • Evaluation loop: skills and experts must pass an offline test set and a regression baseline before being listed, so the “marketplace” does not degrade into a “dumping ground.”
    • Permissions and data boundaries: workspaces do not share data by default; cross-domain access requires explicit authorization, and sensitive data is masked in prompts and logs.
    • Cost control: set limits on model calls and steps per task, combined with caching and result reuse, to prevent long tasks from running out of control.
    • Evolution strategy: version the kernel interfaces and make the capability layer pluggable; run any breaking change in parallel on a new version before switching traffic over.

    6. Conclusion

    The architecture evolution of an agent system is essentially about shifting uncertainty from “model capability” to “engineering constraints.” Stage one trades an off-the-shelf runtime for speed. Stage two trades workspaces and multiple experts for capacity. Stage three trades a self-developed kernel for autonomy. The three are not replacements for one another; they stack layer by layer. The earlier you settle on skill contracts, context budgets, isolation boundaries, and an evaluation loop, the lower the cost of subsequent evolution. For teams building enterprise-grade agent platforms, the value of this path far outweighs any conclusion drawn from choosing a single framework.