Designing the Static Skeleton of Enterprise AI Agents
Building enterprise AI agents is challenging not because of connecting dialogue APIs, but maintaining a unified identity, permission set, and billing ledger across various scenarios like policy Q&A, alert handling, release evaluation, and local development. This article explores the engineering trade-offs of establishing a robust static architecture from day one. It covers critical boundaries including modeling a single agent entity, separating three version tracks, enforcing unidirectional compile-time dependencies, and implementing dual aggregate roots for state management. By prioritizing this static skeleton, organizations can evolve a sustainable agent platform rather than managing fragmented, disconnected chat interfaces.
Building an enterprise’s “own AI agent” is challenging not because of connecting a dialogue interface, but because of maintaining a consistent identity, permission set, and ledger across policy Q&A, alert handling, release evaluation, and local development assistance. Many platforms start with web chat in week one, require legacy system context (app name, cluster, ticket) in week three, demand zero-intrusion CI/CD pipeline calls in week five, and want developers to reuse the same controlled tools in local programming environments by week seven. If these entry points are fragmented into disconnected product lines, each with its own entity tables based on trending concepts, permissions, gray release configurations, tool parameters, and token costs will quickly fall out of sync.
What determines whether the system scales cleanly or descends into chaos is usually not a runtime trick, but the static skeleton established on day one: how domain entities are modeled, how versions are tracked, how module boundaries are welded shut, and how state and data backbones are partitioned. The following four boundaries represent the engineering trade-offs required to build an evolvable platform rather than four isolated chat windows.
1. A Single Agent Entity Instead of Four Mutually Exclusive Types
When sketching prototypes, adding a type enum to the main table looks clean: pure conversation, knowledge retrieval, workflow, or multi-agent orchestration. However, real business assistants are almost always composites. Querying policies requires retrieval, troubleshooting requires calling tools, releases require step-by-step evaluation, and complex issues need multi-role decomposition. Once this type is encoded into the primary key semantics, querying, authorization, billing, and gray releases fork: the same assistant is treated as different objects across entry points, tool parameter changes require syncing multiple tables, and monthly consumption cannot be aggregated under a single subject.
A more robust approach recognizes only one domain entity: the Agent. Morphological differences belong to capability assembly, not entity fragmentation:
- Conversation capability: Sessions, messages, personas, and output constraints.
- Knowledge capability: Bindable knowledge sets, citation strategies, and permission filters—no separate “knowledge-based agent” needed.
- Tool capability: Callable controlled actions with parameter contracts, timeouts, and audit trails.
- Orchestration capability: Task decomposition, step states, and human confirmation points, as optional behaviors on the same entity.
The four entry points are merely delivery channels: web, embedded components, open APIs or language-side SDKs, and local IDE plugins. They share the same agent identity; context is passed by the caller rather than recreating a new agent for each. When an embedded floating entry is used, auto-attached application, cluster, and ticket context should be modeled as context for that specific invocation, not as a new agent type.
Schematic constraints can be written as:
Agentid, owner, status, policy_refbindings: knowledge[], tools[], workflow?DeliveryChannelchannel_type, agent_id, context_schemaInvocationagent_id, channel, principal, context, trace_id
Acceptance criteria are specific: any invocation from any entry point must be traceable to the same agent identity, the same authorization policy, and the same consumption ledger. “This entry point has its own separate agent master data” is strictly prohibited.
2. Three Non-Interfering Version Tracks
An agent platform has at least three types of artifacts with different change cadences. Squeezing them into a single version line means changing a prompt requires redeploying the tool runtime, and modifying a tool parameter rolls back an already published conversation policy.
It is recommended to split these into three independent tracks:
- Behavior Version: Prompts, personas, knowledge bindings, orchestration steps. Changes are frequent and impact answer quality. They should support gray releases and rollbacks without recompiling the caller.
- Tool Contract Version: Tool names, inputs, outputs, idempotency, and side-effect declarations. Changes must be backward compatible or explicitly upgraded. Callers and release checkpoints depend on the contract, not a specific prompt version.
- Platform Runtime Version: Authentication, quotas, scheduling, auditing, and observability. Changes apply to all agents and must be decoupled from individual agent behavior releases.
These three tracks use different version numbers, and release notes explicitly state “which track is affected.” Behavior gray releases roll out by agent or tenant; contract upgrades go through a compatibility window; runtime upgrades use platform maintenance windows. This ensures a risk assessment call in the CI/CD pipeline isn’t forced to upgrade its SDK due to a knowledge base update.
3. Unidirectional Dependencies and Compile-Time Boundaries
If modules allow arbitrary cross-references, embedded entries will directly touch the database, local plugins will replicate permission checks, and open APIs will embed orchestration details. Dependencies must flow top-down and strictly unidirectional:
- Access Layer: Web, embedded components, open APIs, SDKs, local environment adapters. Handles only protocol adaptation and context collection.
- Application Layer: Use cases for a single invocation, such as Q&A, context-aware troubleshooting, or release risk assessment.
- Domain Layer: Agents, authorization policies, tool bindings, orchestration definitions. Independent of specific UIs.
- Capability Layer: Retrieval, tool execution, model invocation. Exposes stable ports to the domain.
- Infrastructure Layer: Identity, configuration, queues, object storage, logs, and metrics.
- Observability & Ledger: Tracing, auditing, and consumption aggregation across the call chain. Subscribes to events only, without reverse-driving domain rules.
“Zero-framework compile-time gating” means business system integration does not require modifying the host framework. SDKs or open APIs depend only on standard language libraries and a few explicit protocol types; leaking internal platform framework annotations into the caller’s project is prohibited. Architecture tests or dependency rules should fail the build: the access layer cannot reference infrastructure implementations, the capability layer cannot reference the access layer, and caller modules cannot reference internal platform packages.
The local programming environment is just another access adapter. It reuses the same agent, tool inventory, and code repository permissions, rather than implementing a separate “local agent” inside the editor. Controlled company tools are still invoked by the platform’s execution plane; the local environment only passes intent and context.
4. State Identifiers and Dual Aggregate Roots
When conversations, tools, ticket contexts, and asynchronous tasks overlap, a vague “session ID” distorts troubleshooting and billing. It is recommended to fix five layers of identifiers, which are non-reusable once generated:
- Principal Identifier: Who is calling, mapped to enterprise identity.
- Agent Identifier: The domain entity being called.
- Session Identifier: Multi-turn conversation boundary.
- Invocation Identifier: A single request, including sync or async.
- Trace Identifier: Correlation ID across models, retrieval, tools, and external systems.
For data, retain two aggregate roots to avoid a single wide table carrying all state.
The Agent Aggregate Root manages the “definition”: owner, status, policy references, knowledge and tool bindings, behavior version. It answers “what is this agent allowed to do.” The Invocation Aggregate Root manages “what happened”: principal, channel, context summary, steps, tool result references, consumption, trace ID. It answers “what was done, how much it cost, and is it auditable.” Definition changes do not overwrite historical invocations; historical invocations do not reverse-modify agent definitions. The application name, cluster, and ticket number in the context belong to the invocation snapshot. Even if expired, they can still explain past decisions, but they won’t become agent master data.
Consumption aggregation only recognizes the agent identifier and principal identifier on the invocation aggregate root. Whether traffic comes from the web, an embedded entry, a pipeline, or a local environment, the ledger dimensions are identical. Gray release rules are similarly attached only to the agent behavior version; individual channels are not allowed to maintain their own rollout switches.
5. Control Plane and Execution Plane Separation—The Skeleton Must Stand First
Even when management configuration and actual execution are divided into different processes, the static model determines whether both sides speak the same language. The control plane publishes agent definitions and behavior versions; the execution plane consumes immutable snapshots and writes invocation records. The execution plane should not modify binding relationships at runtime, nor should it spawn new entities just because an entry point temporarily adds a field. Tool parameters, timeouts, and permissions are declared in the contract; at runtime, they are only validated and logged.
Implementation should follow this order, rather than starting based on the number of entry points:
- First, define the two models—agent and invocation—and the five layers of identifiers.
- Next, define the three version tracks and release permissions.
- Then, build the web access layer to verify authorization, gray releases, and the ledger.
- Connect embedded components, open APIs, SDKs, and local adapters using the same invocation contract. Adding a channel only adds adaptation, not master data.
- Use dependency rules and a cross-channel reconciliation drill as a gate: four entry points hit the same agent, permissions are consistent, gray releases are consistent, and consumption is aggregable.
6. Common Regression Signals
These signals indicate the skeleton is loosening: mutually exclusive type fields reappear in the master table; agents are duplicated for specific channels; tool parameters are stored separately in API docs, plugin configs, and orchestration canvases; prompt releases force callers to recompile; billing is split by channel and cannot be aggregated by agent; local environments have tool execution permissions outside the platform. The fix is not to add another layer of concepts, but to pull differences back into bindings, versions, and channel adaptation.
Building your own agent should deliver a controlled subject reusable across multiple entry points, paired with independently evolvable behaviors, contracts, and runtimes. Entry points will continue to grow, and tools and knowledge will change, but domain entities, version tracks, dependency directions, and state identifiers should not be redrawn weekly based on demands. Once the skeleton is stable, automated workflows grow on the same set of permissions and audits, rather than requiring manual reconciliation across four different systems.
