Two Architecture Philosophies for AI Agent Frameworks: Minimal Core vs. Everything-as-a-Plugin

    This article examines two dominant design approaches in AI agent frameworks built on the "core + plugin" pattern. The first, a minimal-core philosophy, keeps the kernel thin and exposes a rich plugin layer via an SDK, favoring product integration and maintainability. The second, an everything-as-a-plugin philosophy, allows even the agent loop to be replaced, targeting researchers who need maximal flexibility for experiments. We compare their trade-offs, discuss typical use cases, and provide practical engineering recommendations for choosing and deploying either style.

    Introduction: Why Agent Frameworks Converge on “Core + Plugin”

    Modern AI agent frameworks have converged on a layered “core + plugin” architecture: a stable kernel handles basic orchestration and runtime, while peripheral capabilities are added through plugins. This pattern has become the de facto standard because agent systems inherently require frequent changes to model providers, tool sets, interaction interfaces, and runtime environments. Isolating the volatile parts from the kernel reduces maintenance overhead significantly.

    However, “core + plugin” is only a coarse consensus. The real differentiator is how much responsibility the kernel keeps and what is delegated to the plugin layer. Around this boundary, two distinct design philosophies have emerged in practice. We examine each below.

    Route 1: Minimal Core + Highly Extensible Plugin Layer (SDK‑Oriented)

    Design Intent

    The core proposition of this route is: the kernel should handle only the parts that are least likely to change, leaving everything else to plugins. The kernel is typically very thin—containing little more than the essential agent loop—and may be only a few thousand lines of code.

    But a common misconception needs clarification: a small kernel does not mean a small framework. What we call an “extensible agent” in practical terms usually means extending a full distribution, not building on a bare kernel. A complete distribution typically includes:

    • The agent loop
    • A command‑line interface (CLI) and terminal UI (TUI)
    • Session management and logging
    • A small set of built‑in tools
    • A plugin registration and loading mechanism

    When you put all these together, the total codebase can easily exceed 100,000 lines. A thin kernel simply indicates clear separation of concerns, not a lack of functionality.

    Extension Approach

    The typical usage pattern for this route is extension at the plugin layer. The official design intent is clear: “No fork required, no need to modify internal implementations.” Most advanced developers can meet their needs entirely at the plugin layer:

    1. # Illustrative code: create a session via the SDK and attach custom plugins
    2. session = create_agent_session(
    3. model_provider=my_provider, # custom model adapter
    4. tools=[search_tool, code_tool], # append tools
    5. plugins=[my_logger, my_guard], # plugin-layer extensions
    6. )
    7. result = session.run(task="Refactor this module")

    Only a minority of heavy‑use cases require pulling out the entire source code for deep customization. But even then, the recommended approach is to call the framework through SDK entry points like create_agent_session() rather than intruding into internals.

    Who Should Use This Route

    The selling points of this type of framework can be summarized as: minimal, highly extensible, easy to extend, and embeddable as an SDK. It suits teams that want to integrate agent capabilities into their own products—teams that need to get started quickly and continue customizing without touching the kernel.

    Route 2: Everything as a Plugin (Research/Experimentation‑Oriented)

    Design Intent

    The other route is more radical: even the agent loop itself can be replaced. It pushes “pluginification” to the extreme, turning the framework into a set of building blocks—the framework provides only the assembly rules, and the concrete shape is up to the user.

    The trade‑off is a steeper learning curve. To write good plugins, developers must understand the underlying dependency injection and lifecycle mechanisms. In other words, it maximizes freedom while shifting complexity to the user.

    Key Mechanisms

    This route typically provides several capabilities designed for experimentation:

    1. Hot‑swapping: Plugins can be loaded and unloaded at runtime, enabling scenarios where the system can “develop itself” or even experiment with self‑evolution at the framework level.
    2. Seam abstraction at the foundation: Even low‑level dependencies like the file system can be replaced, making it easy to plug into sandboxed experimental environments.
    3. Session replay: The full execution trace can be replayed, which greatly simplifies debugging and issue reproduction.

    Who Should Use This Route

    The combination of these features makes it clear that the real target users are researchers conducting AI experiments, not application developers who just want to write a few plugins. In experimental contexts, extreme extensibility is an advantage; in product delivery, it can become a burden—low‑level logic is exposed, and the user must handle stability and constraints themselves.

    It is worth noting that designs that expose the entire foundation often converge in later versions: the kernel becomes heavier but still does not intrude on the upper layers. This is a common evolution path—adding robustness to the kernel while preserving the benefits of a clear layering.

    Comparison of the Two Routes and Selection Guidelines

    Dimension Minimal Core Route Everything‑as‑a‑Plugin Route
    Kernel responsibility Only essential logic like the agent loop Even the agent loop is replaceable
    Extension boundary Primarily at the plugin layer Deep into the underlying runtime
    Learning curve Low, SDK‑friendly High, requires understanding of low‑level mechanisms
    Typical users Product integration teams AI research/experimental teams
    Key risk Limited low‑level flexibility Stability must be handled by the user

    When choosing, work backwards from your goals:

    • If your goal is to embed agent capabilities into an existing business, prioritize delivery speed and maintainability—choose the minimal‑core route and stay at the plugin layer.
    • If your goal is to study the internal mechanics of agents, replace the main loop, or control the underlying environment—consider the everything‑as‑a‑plugin route, and budget sufficient learning time.

    General Engineering Recommendations

    Regardless of the route you choose, the following practices apply:

    • Isolate volatile dependencies in an adapter layer: Model providers, tools, and storage should be accessed through interfaces, avoiding coupling between the kernel and concrete implementations.
    • Make sessions and logs traceable: Complete session records are the foundation for debugging, reproduction, and auditing. Implement this from day one.
    • Prefer official extension entry points: Use the SDK whenever possible instead of forking the source code, to reduce future merge costs during upgrades.
    • Execute high‑risk operations in isolated environments: Tools that touch the file system, network, or command execution should run in a sandbox or controlled runtime, following the principle of least privilege.

    If you need to deploy such agent frameworks to production, you can fill engineering gaps with common cloud infrastructure capabilities—for example, object storage for sessions and artifacts, message queues for decoupled task scheduling, container platforms for hot‑swappable plugin runtimes, and log services with monitoring/alerting for observability. Cloud platforms like Baidu AI Cloud offer such general‑purpose services, allowing teams to focus on agent logic instead of re‑inventing operational wheels.

    Summary

    The “core + plugin” pattern is a shared consensus; the real divergence lies in where the core boundary is drawn. The minimal‑core route prioritizes SDK‑friendly low barriers and maintainability, targeting product integration. The everything‑as‑a‑plugin route prioritizes extreme flexibility for experimental freedom, targeting research exploration. Neither is inherently better—only a matter of matching the right approach to the right scenario. Understanding this boundary is essential for making informed choices in framework selection and subsequent customization.