Breaking Down Four Agent Framework Design Approaches

    This article breaks down the common structure of an AI agent into model weights and a surrounding harness, then compares four harness design approaches: minimal educational, shared-service multi-client, memory-and-skill accumulation, and broad channel integration. It includes a selection comparison table, five observable metrics for evaluating a harness, and practical guidance for choosing and deploying an architecture as requirements grow.

    1. Why the Same Model Can Produce Four Different Agents

    A large language model is essentially a machine that takes text in and puts text out: it reads tokens, then predicts and generates tokens. It is stateless by itself. It does not remember what happened in the previous turn, and it cannot proactively read files, send requests, or call external systems. To make it complete real tasks, you need to wrap an engineering structure around the model that adds capabilities such as memory, tool calling, session management, and permission guardrails.

    The industry often calls this layer a harness: just as a horse needs a harness to pull a cart, a model needs a harness to do work. As a result, any agent can be broken into two parts:

    1. Agent = model weights (reasoning capability) + harness (everything that turns tokens into actions)

    The harness is responsible for tasks that roughly include assembling the system prompt and context, parsing model output and triggering tools, maintaining multi-turn session state, trimming overly long context, performing security checks and retries, and recording logs and traces. The way these capabilities are combined differs, and the resulting differences in agent behavior are often no smaller than the differences caused by switching to a different model.

    One frequently underestimated conclusion is that when model capabilities converge, the quality of the harness is often the main variable that determines product usability. If tool granularity is too coarse, the model cannot express intent precisely; if guardrails are too strict, tasks are interrupted frequently; if memory is poorly designed, long sessions will inevitably degrade.

    2. Design Orientations of the Four Framework Types

    To avoid pointing to any specific product, the following uses four typical design orientations, each of which has corresponding forms in real open-source implementations.

    The first type is the minimal educational type. The code size is deliberately reduced to the minimum, keeping only the main loop of prompt assembly, model invocation, tool dispatch, and result write-back. The goal is to let readers see the minimal complete set of a harness. Its value lies not in features but in readability: once you can run a closed loop in two or three hundred lines, you will not get lost when reading more complex frameworks.

    The second type is the shared-service, multi-client type. A service process stays resident inside the framework, holding sessions, the tool registry, and context. Multiple clients (terminal, desktop, mobile) connect to the same state through a protocol. The benefit is centralized state and the ability to continue across device switches; the cost is that you must handle concurrency, authentication, session isolation, and consistency.

    The third type is the memory-and-skill accumulation type. In addition to saving conversations, it abstracts successfully executed operation paths into reusable skills and retrieves them into context in later tasks. This essentially turns experience into searchable assets and uses retrieval augmentation to reduce repeated trial and error.

    The fourth type is the broad channel integration type. The focus is on the connector layer, adapting a unified core to a large number of chat and collaboration channels so that the agent appears in the communication interfaces users already use. The engineering difficulty shifts from reasoning to adapter management, message deduplication, rate limiting, and identity mapping.

    3. Build Selection Intuition with One Table

    Dimension Minimal Shared Service Memory & Skills Multi-Channel
    Primary goal Readable and modifiable Centralized state Gets stronger with use Reach users
    Typical bottleneck Limited capability Concurrency and isolation Retrieval quality Adaptation and rate limiting
    Suitable scenarios Learning and prototyping Shared team use Long-cycle tasks Customer service and operations

    When selecting a type, it helps to ask three questions first: does state need to be shared across devices? Do tasks need to reuse experience across sessions? Are users already working in a fixed chat tool? The answers will narrow the scope directly to one or two types.

    4. Five Observable Metrics for Evaluating a Harness

    1. Task completion rate: with a fixed evaluation set, measure the end-to-end success rate rather than single-step accuracy.
    2. Context efficiency: the average tokens and turns consumed to complete the same task, reflecting the quality of trimming and retrieval strategies.
    3. Tool failure recovery: whether the agent can self-correct, retry, or switch paths after a tool error.
    4. Guardrail precision: both the false-block rate and the miss rate need to be considered together; looking at only one can be misleading.
    5. Observability: whether traces are recorded completely for review and regression.

    An illustrative evaluation loop can be written as:

    1. for case in eval_set:
    2. trace = run(agent, case.input, max_steps=8)
    3. record(success=trace.done, tokens=trace.tokens,
    4. tool_errors=trace.errors, blocked=trace.blocked)

    5. Implementation Recommendations

    In the starting phase, use a minimal core to run a closed loop and define tool interfaces clearly. When moving to team use, introduce shared services, authentication, and session isolation. For long-cycle scenarios, add skill accumulation and retrieval. When facing end users, do channel adaptation last. If deploying on the cloud, you can put sessions and traces in object storage, use a message queue to decouple tasks, use a container platform to host resident services, and connect logging services and monitoring alerts to form a closed loop. Baidu AI Cloud has corresponding product categories for these general capabilities and they can be combined as needed, but the architecture principles are vendor-independent: define the boundaries of the harness clearly before discussing model selection.