Four Architectural Boundaries for Building Enterprise-Grade AI Agents
This article explains four static architectural boundaries that keep enterprise AI agent platforms from becoming fragmented as requirements grow. It covers using a single agent entity with capability declarations instead of type enums, separating changes into three version tracks, enforcing six-layer one-way dependencies with a framework-agnostic build gate, and anchoring data on five state identifiers with a dual-aggregate-root design. Engineers will find practical modeling and boundary rules for long-term platform evolution.
Introduction: Agent Platforms Often Fail at the First Table
Many teams build an AI agent by shipping a web chat window in week one. By week three, they are asked to embed alert and ticket context. By week five, they need a zero-intrusion open API for release pipelines. By week seven, someone wants to reuse controlled operations capabilities directly inside a local coding tool. If these requests are split into four independent product lines, and the admin console grows separate, disconnected entity tables for “chat agents,” “retrieval agents,” “orchestration agents,” and “tool services,” then within three months the platform will have three competing permission systems, fragmented canary rules, tool parameters that must be synced in four places after every change, and token costs that cannot be reconciled at month end.
The root cause is not a runtime technique. It is the static skeleton defined on day one: how domain entities are modeled, how versions are separated, how module boundaries are fixed, and how underlying state and the data backbone are partitioned. From a neutral, general engineering perspective, this article presents four hard boundaries that should not be crossed, along with how to implement them.
1. Do Not Invent a “Knowledge-Type Agent”: One Entity for Four Forms
1. Type Enums Move Complexity Instead of Removing It
Adding agent_type = CHAT | RAG | WORKFLOW | MULTI_AGENT to the core table looks clean, but it shifts complexity from the data layer to three other chains: permissions, canary rollout, and metering. Real business assistants are inherently composite. A single troubleshooting session may need dialogue for clarification, retrieval of policy documents, and orchestration of multiple tool calls.
2. Replace Type Classification with Capability Declarations
The correct approach is to keep a single agent domain entity and describe its form through capability switches:
Agent {id, name, owner, lifecycle_statecapabilities: [Dialog, Retrieval, Planning, ToolInvoke, Delegation]policy_ref, model_profile_ref, cost_account_ref}
Form differences come from combinations of capabilities and policy references, not from enum branches. When a new delivery form is added, you only add capability declarations and policy templates. You do not add a new core table or a new permission model.
3. Benefits
There is only one subject-resource-action permission model. Canary rollout is orchestrated uniformly at the entity level. Tool parameters have a single contract. Costs are collected under a unified account dimension and can be reconciled directly at month end.
2. Three Non-Interfering Version Tracks
Enterprise agents have at least three change cadences: high-frequency adjustments to prompts and policies, medium-frequency evolution of tool contracts and retrieval indexes, and low-frequency restructuring of domain models and the data foundation. Sharing one version line means high-frequency changes constantly disrupt low-frequency structures.
Three tracks are recommended:
- Track A (Policy track): prompts, model parameter profiles, and thresholds, rolled out with daily canaries and rollback in seconds;
- Track B (Contract track): tool input and output parameters and index structures, reviewed weekly, backward compatible for at least two versions;
- Track C (Structure track): entities and the data backbone, reviewed monthly, with migration and dual-write plans required.
Only one-way dependencies are allowed between tracks: Track A may reference stable versions of Track B, and Track B may reference stable versions of Track C. Reverse references are strictly prohibited. This way, high-frequency iteration does not pollute the structure, and structural upgrades do not interrupt live policies.
3. Six-Layer One-Way Dependencies and a Framework-Agnostic Compile Gate
Module decay usually starts with a “convenient reference.” Enforce six-layer one-way dependencies at build time:
- Access layer: web window, alert embedding, open API, and local coding tool plugins;
- Orchestration layer: task decomposition, plan execution, and multi-agent collaboration;
- Capability layer: dialogue, retrieval, and tool invocation;
- Policy layer: permission decisions, canary routing, rate limiting, and quotas;
- Domain layer: agent, session, task, and tool contract entities;
- Foundation layer: state storage, object storage, message queues, and logging, monitoring, and alerting.
The gate rule must have “zero framework intrusion”: it does not depend on any specific runtime. A build script statically scans the dependency manifest, and the build fails on any reverse reference or cross-layer direct connection. The access layer must not reach the foundation layer directly, and the capability layer must not be aware of access protocols. Adding a new entry point, such as a local coding tool, then only requires an access-layer adapter without touching the core.
4. Five-Layer State Identifiers and a Dual-Aggregate-Root Data Foundation
State identifiers should be unified into five layers: tenant, agent, session, task, and message. All permissions, canary rules, and metering are anchored to these five layers, avoiding custom identifiers created by individual product lines.
The data foundation uses dual aggregate roots:
- Configuration aggregate root: agent definitions, capability declarations, and policy and model profile references, emphasizing strong consistency and auditability;
- Runtime aggregate root: session and task execution traces, tool invocation records, and token and latency metering, emphasizing high throughput and traceability.
The two are linked by identifiers rather than physical coupling. Configuration changes go through approval and canary rollout. Runtime data is partitioned by time and archived to object storage. Logs and metrics enter a unified monitoring and alerting system.
Conclusion
Whether an agent platform grows thick without becoming messy depends on holding four static boundaries: a single domain model, three version tracks, six-layer one-way dependencies with a compile gate, and five-layer state identifiers with dual aggregate roots. Establish the skeleton first, then discuss forms. Define boundaries first, then discuss expansion. If you need an engineering foundation to support these capabilities, you can evaluate the combination of general-purpose offerings from Baidu AI Cloud, such as container platforms, object storage, message queues, and monitoring and alerting, to support long-term evolution.
