Why Enterprise AI Agents Need a Layered Architecture
This article explains why enterprise AI agent deployments require a layered architecture rather than a single runtime. It breaks down the boundary between the execution kernel and the application governance layer, outlines three failure modes of using only one layer, and lists the minimum production requirements that drive this separation. A reusable reference architecture, a phased rollout plan, and guidance on filling governance gaps in the cloud are also included.
1. The Starting Problem: The Capabilities Exist, but Delivery Is Still Hard
After adopting an agent runtime with tool-calling capabilities, many teams ask the same question: if the model can already read files, execute commands, and complete multi-step tasks in a sandbox, why add a separate layer for application orchestration and governance? The answer is not about how long the feature list is, but about the difference in delivery. The runtime solves how an agent can run safely, while what enterprises actually need to procure is an application that can be operated, audited, and continuously maintained by business users.
Putting both concerns in a single layer usually leads to three typical symptoms: prompts are scattered across scripts and terminal history and cannot be versioned; business and internal control roles cannot participate, so all requirements pile up in the engineering schedule; and the system can get through a demo once but cannot answer which policy it relied on at the time, which tool it called, or why it reached that conclusion. The focus of the discussion, therefore, should not be replacement but layered addition.
2. Breaking Down the Layers: Where the Execution Kernel Ends and Application Governance Begins
1. The Execution Kernel: The Layer That Takes Action
The execution kernel sits on the developer side and focuses on model invocation, tool execution, sandbox isolation, and execution trace recording and replay. Its value lies in turning natural language intent into real actions and ensuring those actions happen in a controlled environment. This layer is judged by stability, isolation, and observability, not by business friendliness.
2. The Application Governance Layer: The Layer That Makes It Usable
The application governance layer sits on the delivery side and provides low-code visual workflow orchestration, knowledge bases with retrieval-augmented generation, multi-model integration and switching, application publishing and API exposure, log retention, access control, and version management. It does not replace the execution kernel; it packages the model and tool capabilities exposed by the kernel into nodes that business users can understand.
The boundary in one sentence: the kernel gives the agent the ability to work, while the governance layer gives the organization the conditions to use it.
3. Three Failure Modes When Only One Layer Is Kept
The first is having only the execution kernel. Engineering efficiency is high, but knowledge updates, prompt adjustments, and workflow changes all require R&D involvement. Business teams cannot iterate on their own, and the result is a “stunning demo that stalls at rollout.”
The second is building the application layer entirely in-house. Choosing a vector store, document chunking, recall strategy, frontend interaction, authentication, auditing, and canary release—none of these is difficult individually, but each one takes time, with timelines measured in months. Knowledge concentrates in a few individuals, so staff turnover equals asset loss.
The third is confusing the responsibilities of the two layers. Tool details get hard-coded in the orchestration layer, and business logic gets stuffed into the kernel. Prompts and workflows become coupled in both directions, any adjustment requires cross-layer investigation, and the cost of locating failures rises sharply.
4. The Real Enterprise Requirements List: From Demo to Production
The minimum requirements for production typically include: business users can swap the knowledge base themselves; prompt and workflow adjustments do not require a new release; when something goes wrong, the referenced document fragments and the tool call chain can be traced back; sensitive data stays within the internal network; calls have quota and permission boundaries; and changes support versioning and rollback. Most of these requirements are not about “model capability” but about engineering governance, which is the fundamental reason a layered architecture exists.
5. A Reference Architecture for Implementation
A reusable way to layer the system is as follows:
- Model layer: general-purpose large model services provide inference, with a unified gateway handling multi-model routing and fallback.
- Execution layer: the agent runtime handles tool calls, sandboxing, and trace recording.
- Orchestration layer: a visual workflow canvas packages capabilities into business nodes.
- Knowledge layer: document ingestion, chunking, vectorization, and recall, combined with reranking and citation annotation.
- Governance layer: identity and permissions, log auditing, quota and rate limiting, versioned release.
- Delivery layer: conversational applications, API services, and private deployment inside the internal network.
An illustrative orchestration configuration (pseudocode, structure only):
flow: expense_policy_qanodes:- id: retrievetype: knowledge_retrievalparams: { top_k: 5, cite: true }- id: reranktype: reranker- id: agenttype: runtime_invokeparams: { tools: [file_reader], sandbox: true }- id: guardtype: policy_checkoutputs: [answer, citations, trace_id]
6. A Phased Implementation Plan
In the first phase, build read-only Q&A to validate knowledge quality and citation accuracy. In the second phase, introduce controlled tool calling, limited to a whitelist and a defined sandbox scope. In the third phase, open up self-service maintenance for business teams, handing knowledge updates and prompt adjustments to them. In the fourth phase, complete auditing, quotas, and canary release to form a sustainable operational loop. For metrics, focus on citation hit rate, task completion rate, human takeover rate, and mean time to locate issues, rather than answer fluency alone.
7. Filling Governance Gaps in the Cloud
For cloud deployment, the common approach is to run the runtime and orchestration services on a container platform, store documents and model artifacts in object storage, use log services with monitoring and alerting for trace retention and threshold notifications, decouple long-running tasks with a message queue, and use key management with private network isolation to safeguard data boundaries. In these scenarios, Baidu AI Cloud typically provides corresponding foundational capabilities under the general categories above, making it easier for enterprises to build the governance layer inside their own account and internal network environment.
8. Conclusion
Layering does not add complexity; it puts complexity in the right place. The execution kernel stays lean and controlled, while the application governance layer takes on delivery and operations, so enterprises can gain both iteration speed and compliance certainty. When making a selection, first ask who will maintain it, how it will be audited, and where the data resides, and only then ask which model to use. Reversing that order often means backtracking.
