Agent Runtime Framework Design: A Deep Dive into Plugin-Based Architecture and the "Everything Is a Plugin" Philosophy

    This article explores why agent runtime frameworks are needed, explaining the "model + runtime framework = agent" paradigm. It examines a plugin-based architecture built on a mature dependency injection system, four preset operation modes balancing autonomy and context budget, a model-agnostic integration strategy with protocol adaptation and capability negotiation, ecosystem governance challenges for plugin marketplaces, and future directions toward more autonomous agents. Developers will learn the three key decoupling layers for building stable agent infrastructure.

    1. Why Agent Runtime Frameworks Are Needed

    Large language models can only generate text. They cannot directly read or write files, call APIs, execute commands, or observe execution results. To make a model actually do things, an intermediate layer is required to accomplish three tasks: injecting real-world environment state into the model’s context, translating the model’s decisions into tool calls, and feeding execution results back to the model to close the loop. This layer is the agent runtime, often summarized by the industry as a formula: Model + Runtime Framework = Agent.

    Under this formula, the model is a replaceable “brain,” while the runtime is the stable “body.” The direct benefit of this separation is that when upgrading the model or switching providers, the upper-layer toolchain, plugins, and workflows can be fully reused. A recently open-sourced agent runtime framework is a typical implementation of this philosophy, with the core slogan “everything is a plugin.” Within just over two months of release, it gained hundreds of thousands of stars, and community plugin counts quickly climbed into the tens of thousands—validating strong market demand for this architectural direction.

    2. Core Architecture: Everything Is a Plugin

    2.1 The Plugin System as the Skeleton

    Rather than building a custom plugin mechanism, the framework reuses the plugin system of a mature frontend dependency injection framework as its underlying skeleton. This brings several architectural advantages:

    • Unified lifecycle management: Each plugin has well-defined initialization, activation, and destruction phases. The framework loads plugins in topological order based on their dependencies at startup.
    • Service registration and discovery: Plugins communicate through a service container rather than direct references, reducing coupling.
    • Capabilities as plugins: Tool invocation, context management, permission control, session storage, UI rendering—even core functionality itself—are all implemented as plugins.

    Here is a pseudocode illustration of a plugin structure:

    1. // A typical tool-type plugin
    2. export default definePlugin({
    3. name: 'file-reader',
    4. provides: ['tool.file.read'],
    5. setup(ctx) {
    6. ctx.registerTool({
    7. name: 'read_file',
    8. schema: { path: 'string' },
    9. execute: async ({ path }) => fs.readFile(path, 'utf-8'),
    10. });
    11. },
    12. });

    2.2 Four Preset Operation Modes

    Tasks of varying complexity demand very different levels of context overhead and autonomy. The framework provides four preset modes, which essentially represent different trade-offs among three factors: model autonomy, tool invocation style, and context budget:

    1. Standard mode: Full system prompts and the complete toolset, suitable for complex multi-step tasks.
    2. Programmatic Tool Calling (PTC) mode: The model generates a program that orchestrates multiple tool calls in bulk, reducing round trips between the model and the runtime. This significantly lowers token consumption and latency, making it well suited for batch data processing tasks.
    3. Minimal mode: Trims system prompts and tool descriptions, suitable for lightweight tasks or for embedding as an underlying engine in other products.
    4. Creative mode: Oriented toward generative tasks, de-emphasizing the tool loop and strengthening content output.

    This “mode layering” design is worth emulating: it acknowledges that no single agent configuration fits all scenarios and returns flexibility to the caller.

    3. A Model-Agnostic Integration Strategy

    The vitality of a runtime framework depends on the breadth of its ecosystem, and the first gate to ecosystem breadth is model integration. The framework adopts an open strategy, supporting dozens of model providers through a unified abstraction layer, including services compatible with mainstream chat completion protocols. The abstraction design typically consists of three layers:

    • Protocol adaptation layer: Smooths over differences between vendors’ APIs in message formats, tool-calling semantics, and streaming output.
    • Capability negotiation layer: Declares the features a model supports (such as multimodality, long context, and function calling), allowing the framework to dynamically adjust its behavior accordingly.
    • Degradation and retry layer: Uniformly handles rate limiting, timeouts, and failover.

    The takeaway for developers: when building your own agent platform, the model abstraction layer should be designed early, so that business code is not bound to a specific model’s proprietary features.

    4. Ecosystem Governance: From Plugins to Marketplace

    Within days of going open source, the community produced thousands of plugins, and roughly 60% of active users had built or installed one. The team subsequently announced plans for an official plugin marketplace. This shows that plugin-based architecture has a natural network effect, but it also introduces governance challenges:

    • Quality and security: Plugins have execution capabilities, so they require permission declarations, sandbox isolation, and review mechanisms.
    • Version compatibility: During the preview phase, session formats are not guaranteed to be compatible, so plugins must evolve alongside framework versions.
    • Discovery and distribution: A marketplace addresses three problems—plugins must be findable, installable, and trustworthy.

    5. Evolution: Toward More Autonomous Agents

    Subsequent releases of the project have introduced multimodal capabilities, desktop support, and cross-platform compatibility, along with a “Super-agent” architectural exploration. The core idea is to give a single agent stronger autonomous planning and subtask decomposition capabilities, with the runtime responsible for scheduling and resource isolation. It is foreseeable that agent runtimes will continue evolving along three directions: finer-grained permission models, more efficient context management, and more complete observability.

    6. Conclusion

    “Everything is a plugin” and “model-agnostic” are not new concepts, but rigorously implementing them as a high-throughput, extensible agent runtime validates the feasibility of plugin-based architecture in the agent infrastructure domain. For developers, whether using an agent platform service provided by a cloud vendor or building a runtime in-house, three layers of decoupling deserve attention: model abstraction, tool orchestration, and plugin governance. Focusing on these three points allows you to keep your architecture stable and forward-looking amid rapid model iteration.