Static Skeleton Design for an Enterprise Agent Platform
Enterprise agents quickly outgrow a chat page: they must look up policy, troubleshoot with context, sit inside existing systems, judge release risk, and reuse controlled tools and repos. This article argues that the platform stays coherent by modeling one agent entity, three version tracks, strict module boundaries, and a clear state/data backbone—not by inventing a new product line per channel or capability.
Enterprise agents rarely stay a chat webpage. They are soon asked to look up policy, troubleshoot with context, embed in existing systems, judge risk at release gates, and reuse controlled tools and code repositories in local development. Treating every entry point as its own product line, then building disconnected entities for Q&A, RAG, workflows, multi-agent setups, and tool services, quickly yields forked permissions, independent rollouts, duplicated tool-parameter sync, and usage bills that do not match logs. Making the platform thick without making it chaotic depends less on a runtime trick than on a static skeleton: how the domain is modeled, how versions are split, how modules are welded, and how state and data trunks are cut.
One agent entity, not a type per shape
Many teams put a type enum on the first main table: chat, retrieval, workflow, multi-agent. That looks tidy in a prototype and fails in production. A troubleshooting assistant often understands the question in natural language, retrieves documents and logs under permission, calls diagnostic tools in steps, confirms with a human when information is missing, and writes the conclusion back to a ticket. It is not a “pure type”; it is one entity combining capabilities by scenario.
A more stable approach is a single agent domain model. Shape differences become composable capabilities, not new primary entities:
- Dialogue policy: system instruction, reply style, whether follow-up questions are allowed.
- Knowledge binding: searchable knowledge spaces, update strategy, whether citations must link back.
- Tool authorization: allowed tool set, parameter constraints, whether sensitive operations need human confirmation.
- Orchestration: single turn, multi-step plans, or a coordinator splitting work to specialist capabilities—specialists remain instances of the same model, not another table.
- Runtime channel: web, embed, open API, local coding tools. The channel only decides where context comes from and where results go; it does not decide “this is another kind of agent.”
The four common delivery shapes then share identity, permission, rollout, and metering. A new interaction shell is an adapter, not a new Agent.
Illustrative domain invariants:
Agentid, owner, visibility, statusinstruction_ref # points to versioned instruction, not a long text welded on the main tablecapability_set # refs for knowledge, tools, orchestration switchespolicy_ref # permission, quota, confirmation policyChannelAdapterchannel_type # web | embed | api | idecontext_mapping # how external context fields map to unified contextagent_id # always the same agent
The main table has no “type is destiny” enum. Capabilities can be rolled out gradually; identity stays the same.
Four asks on the same entity
Week one, the business wants internal Q&A: bind a policy document space, channel is web, tool set empty. Week three, alerts and tickets want an assistant in a corner of a legacy system, automatically carrying app name, cluster, and ticket id. That is not a new agent; it is embed-channel context mapping: the page writes controlled fields into unified context; the agent decides by policy whether to retrieve logs or call read-only diagnostics. Week five, the release pipeline wants change-risk assessment with zero framework intrusion: a language-agnostic open API or thin SDK; the caller sends a change-ticket id and a diff summary and gets a structured risk conclusion. Agent, policy, and tool authorization remain the same. Week seven, engineers want to troubleshoot in the local IDE: the client only does identity passthrough and context collection; the server still decides by the same policy which repos are visible and which ops tools can run. The local environment is not a second permission center.
Differences collapse to: where context is collected, what protocol returns results, and which capabilities policy turns on. Permission, rollout, and token metering stay one copy.
Three non-interfering version tracks
Putting “change a sentence of instruction” and “change a tool parameter contract” on the same release train is how later mud starts. Split three tracks, each with its own version, approver, and rollback point.
Instruction and knowledge change often; they affect answer tone and citation scope. Default to fast gradual rollout, but every request must replay the version in force at that time. Tool and interface contracts change slower: once inputs, outputs, idempotency, and timeouts are incompatible, pipelines and embed pages break together. Changes need a compatibility window; keep the old contract until callers migrate. Policy evolves separately: who can see the agent, which tools need human confirmation, quotas and data-exfiltration rules. Policy is often more sensitive than features and should not ride along with a prompt tweak.
At runtime, a request binds a triple, not a vague “latest”:
resolve(agent_id, channel, user) ->instruction_versioncontract_versionpolicy_version
A rollout can switch only one track. On failure, roll back that track so you do not revert a validated tool contract to undo one instruction.
Unidirectional dependencies and compile-time boundaries
Fix six layers, top-down only: access (web, embed, open API, local channel); application orchestration (plan, retry, human confirmation); domain (agent, capabilities, policy); capability adapters (retrieval, tools, code and change context); state and metering; infrastructure (object storage, queues, containers, logs and monitoring). The domain layer must not depend on a page component or a private type from a local coding tool. Tool adapters must not write metering tables directly; they go through explicit state-layer interfaces.
“Zero-framework compile gates” means: integrating systems do not replace their application framework; they depend on a stable interface package. Inside the platform, module-boundary checks block cross-layer references. Orchestration assembling storage statements, or access privately loosening tool parameters, is an architecture defect, not an implementation detail.
Five layers of identifiers and two aggregate roots
Requests travel across entries, tools, and retries. Without stable ids you cannot reconcile, audit, or debug. Keep at least five layers, correlatable from the outside in:
- Principal: user or service account—the permission subject.
- Agent: the domain entity being invoked.
- Session: boundary of multi-turn context; do not mix embed and local sessions.
- Task: a retryable goal, e.g. “assess this change” or “explain this alert.”
- Call: a single model, retrieval, or external-tool invocation—for metering, timeouts, and idempotency.
Keep two aggregate roots so one wide table does not absorb every change. The agent aggregate owns definition: instruction refs, capability set, policy refs, channel adapters. The runtime aggregate owns facts: sessions, tasks, calls, confirmation records, usage. Definitions can be versioned and published; facts are append-only and never rewrite history. Cost rolls up by call id to task, session, and agent so month-end bills match logs. Permission reads policy version and principal; it does not re-interpret a “tool-service-only” table.
Pits that are easy to fall back into
Do not copy agent config per channel. If embed and local tools each store a tool allowlist, they will diverge in months. Do not promote RAG or multi-agent orchestration to new master data; they are capability switches and runtime topology; the master remains the agent. Do not let callers hold tool secrets. The open API takes business context and task intent; credentials stay on the platform and are injected by policy. Do not use a frontend session id as the audit primary key. Audit must reach task and call, or retries double-bill or miss bill. Confirmation operations (restart, change approval, write ticket) must be declared on the policy track, and the runtime aggregate must record who confirmed and the call id before confirmation.
How to know the skeleton is standing
Four self-checks: Can you add a channel without a new agent table? If you roll out only instruction, do tool contracts and permissions stay still? Can any tool call be traced along the five ids to principal, policy version, and usage? If retrieval, orchestration, and tools are all on, is permission and billing still one set? If all four answers are yes, the platform can thicken: more knowledge spaces, more read-only or controlled write tools, finer human confirmation grow on the same skeleton instead of splitting another product line.
For a personal agent, conversation plus a few tools can come first. In the enterprise, weld these boundaries first, then UI and model quality. Runtime prompt work can happen anytime. If the static skeleton is welded wrong, every later request is a patch on the wrong entity.
