Agent Runtime Frameworks Explained: The "Everything Is a Plugin" Architecture
As large language models grow more capable, the industry focus has shifted from simple text generation to AI agents that can solve real-world problems. Yet an LLM alone offers only reasoning and cognition — without a reliable runtime to handle scheduling, state management, and tool coordination, its potential can't translate into real productivity. This article takes a vendor-neutral look at a recently open-sourced agent runtime framework, breaking down its "everything is a plugin" architecture, its core design philosophy, the four execution modes it offers, and how such frameworks can be engineered for enterprise-grade workflows on cloud-native infrastructure. A working plugin code example is included.
As large language models continue to advance, industry attention has shifted from single-turn text generation toward AI agents capable of solving complex, real-world problems. However, an LLM by itself only provides cognition and reasoning. Without a dependable runtime environment to handle orchestration, state management, and tool coordination, that capability is hard to convert into actual productivity. Recently, a research team released a developer preview of an agent runtime framework under an open-source license. Rather than focusing on the specific product, this article examines such agent runtime frameworks from a general technical perspective: their core architecture, design philosophy, and practical value in enterprise workflows.
1. Core Design Philosophy: “Everything Is a Plugin”
In traditional AI application development, model invocation, external tool integration, business logic, and user interfaces are often tightly coupled, making systems difficult to scale and maintain. This agent runtime framework proposes a bold architectural paradigm — “everything is a plugin.” Built on a mainstream plugin system, the framework abstracts every key element of an agent into independent plugin entities.
- Model pluggability: The LLM is no longer a hard-coded dependency but a replaceable plugin. Developers can seamlessly switch between models of different sizes or underlying architectures based on cost, latency, and accuracy requirements.
- Tool and skill pluggability: Whether it’s calling an external API to check the weather, operating a database, or running a code interpreter, these capabilities are all encapsulated as standard plugins. Adding, removing, or updating tools becomes trivial, with no changes to the framework core.
- UI pluggability: Even interface rendering and event handling are pluginized, so a single backend agent can easily adapt to multiple frontends — a CLI, a web UI, or an instant-messaging bot.
This “everything is a plugin” architecture achieves true high cohesion and low coupling, giving the system extreme flexibility. Developers can mix and match components like building blocks to create customized agents for different business scenarios.
2. The Core Formula: Model + Harness = Agent
The framework distills its philosophy into a simple but profound formula: Model + Harness = Agent. It clearly defines the boundary and division of labor between the model and the runtime framework.
The LLM provides foundational semantic understanding, logical reasoning, and instruction generation; the Harness (runtime framework) provides the engineering infrastructure — context management, memory persistence, tool-calling loops, and exception handling. Only when the two are combined does a model that can “talk” become an agent that can “do.” The Harness parses the model’s output intent, translates it into concrete function calls, captures the execution results, and feeds them back to the model for the next round of reasoning, forming a complete closed loop.
3. A Closer Look at the Four Execution Modes
To accommodate tasks of varying complexity, the framework offers four distinct execution modes, reflecting careful design at the task-scheduling layer.
1. Standard Mode
Standard Mode is the default choice for most general-purpose scenarios. In this mode, the framework maintains full conversation history and a state machine, and the model interacts with external tools through standard function-calling interfaces. It suits routine Q&A, information retrieval, and simple workflow orchestration.
2. PTC Mode (Programmatic Tool Calling)
PTC Mode is optimized for high-certainty, high-complexity tool chains. In the traditional ReAct (Reasoning + Acting) pattern, the model often needs multiple rounds of dialogue to nail down tool parameters, which invites hallucinations or formatting errors. PTC Mode lets the model generate call chains in a more structured, programmatic way, cutting out redundant intermediate reasoning steps. This is critical for enterprise workflows that demand precise control over execution flow, such as CI/CD pipeline triggers or complex database transactions.
3. Minimal Mode
Minimal Mode pursues maximum response speed and low latency. It strips away heavy context management and complex tool-calling loops, keeping only the core input-to-output mapping. It’s well suited to high-concurrency, lightweight API backends such as text classification, intent recognition, or simple summarization.
4. Creative Mode
Creative Mode targets open-ended exploration and complex problem solving. Here, the framework relaxes strict constraints on tool calls, allowing the model to think more divergently and plan across multiple steps — even supporting the dispatch and parallel execution of sub-agents. It fits scenarios that demand high creativity, such as code generation, long-form writing, or research assistance.
4. Architecture in Practice: Cloud-Native Integration
In real enterprise deployments, an agent runtime framework must integrate deeply with the underlying cloud infrastructure. Let’s walk through best practices using a cloud-native stack such as the one offered by Baidu AI Cloud.
1. Containerized Deployment and Elastic Scaling
Thanks to its “everything is a plugin” design, the framework is naturally suited to containerized deployment. Developers can package the runtime framework as a microservice on a container platform (such as a managed container engine). Because different execution modes have vastly different resource profiles — Minimal Mode is lightweight while Creative Mode is compute-intensive — combining Kubernetes HPA (Horizontal Pod Autoscaler) policies with QPS or CPU/memory metrics enables dynamic, elastic scaling of agents.
2. Persistent Memory and State
When agents run long-lived tasks, they need reliable state storage. The framework can seamlessly connect context memory, plugin state, and execution logs to cloud object storage or distributed databases. By decoupling tool calls from the main reasoning loop via message queues, the system can resume from the last checkpoint after a failure, ensuring the reliability of enterprise workflows.
3. Observability and Security Auditing
In enterprise environments, every tool call an agent makes must be traceable. The framework can export complete reasoning traces, tool call parameters, and return values to centralized logging and monitoring/alerting systems. Meanwhile, for plugins involving file operations or network requests, cloud IAM (Identity and Access Management) can enforce the principle of least privilege, preventing agents from overstepping their permissions.
5. Example Code: Building a Simple Plugin
To make the plugin architecture more concrete, here is a generic plugin definition example:
from typing import Any, Dictfrom harness import Plugin, PluginContextclass WeatherQueryPlugin(Plugin):"""A simple weather query plugin"""@propertydef name(self) -> str:return "weather_query"@propertydef description(self) -> str:return "Query real-time weather conditions for a given city"def get_schema(self) -> Dict[str, Any]:return {"type": "object","properties": {"city": {"type": "string", "description": "The name of the city to query"}},"required": ["city"]}def execute(self, context: PluginContext, params: Dict[str, Any]) -> Dict[str, Any]:city = params.get("city")# Simulate calling an external APIweather_data = self._fetch_weather_api(city)return {"status": "success", "data": weather_data}def _fetch_weather_api(self, city: str):# In production, this would call a real weather APIreturn {"city": city, "temp": "25C", "condition": "Sunny"}
As shown above, developers simply inherit from the base plugin class and implement the required interfaces to plug any external capability into the runtime framework.
6. Conclusion
Extending from being a pure model provider toward full AI workflow solutions is a natural trend in the adoption of AI technology. Agent runtime frameworks — through the “everything is a plugin” design philosophy and their layered execution modes — effectively bridge the gap between an LLM’s cognitive abilities and real-world task execution. For developers, mastering the architectural principles of such frameworks, and combining them with mature cloud-native infrastructure, will be a key competitive advantage in building the next generation of enterprise-grade AI applications.
