Composable AI Systems: Architecture That Can Change Without Losing Control

- Published on

Composable AI Systems: Architecture That Can Change Without Losing Control
The first version of an AI product is often deceptively simple.
A model receives a prompt, retrieves a few documents, calls a tool, and returns an answer. The demo works. Then the system meets production. One team needs a different model. Security wants narrower permissions. A customer needs regional data handling. The retrieval strategy has to change. A long-running task needs to survive a failed process. Someone asks why the agent took an action, and the only answer is a transcript nobody has time to read.
At that point, the problem is no longer prompting. It is architecture.
I think composability is the most useful way to approach that architecture. Not because every AI system needs a swarm of agents, and not because breaking a system into smaller pieces automatically makes it better. Composability matters because AI is still changing too quickly for tightly coupled systems to age well. Models change. Tools change. Policies change. The quality of a retrieval method that looked excellent six months ago can suddenly become the bottleneck.
A composable AI system is designed to absorb those changes without surrendering control.
Its capabilities have clear contracts. State lives outside any single model invocation. Permissions follow the task instead of the agent's ambition. Outputs carry evidence. Verification is an explicit stage. A model, tool, or workflow can be replaced without asking the entire system to become something else.
That is a higher bar than calling several APIs. It is also what turns an AI feature into dependable infrastructure.
The Unit of Composition Is a Capability
The phrase composable AI can conjure an image of a box full of interchangeable models. That is too narrow. Models are important components, but users do not ask a model to exist. They ask the system to perform a capability.
“Investigate this incident” is a capability. So is “draft a refund decision,” “compare these contracts,” or “prepare a safe code change.” Each one may use a model, retrieval, deterministic code, business rules, external tools, and human judgment.
This distinction matters because an agent is often a poor architectural boundary. Agents accumulate responsibility easily. Give one access to a search tool today, a database tomorrow, and a deployment API next month, and the convenient assistant becomes a small monolith with a personality.
A capability is more disciplined. It says what can be requested, what context is accepted, what authority is available, what output must be returned, and what evidence proves the work was done. The implementation behind that contract may be one prompt or a multi-agent workflow. The rest of the system should not have to care.
That leads to the first principle:
Compose around stable responsibilities, not around whichever model or agent framework happens to implement them today.
A Contract Needs More Than an Input and an Output
Traditional service contracts mostly describe data. AI capability contracts need to describe responsibility as well.
For a production capability, I want five things to be explicit:
- Request: What may the caller ask for, and what must be supplied?
- Authority: Which data and tools may this invocation access?
- Result: What structured output must it produce?
- Evidence: Which sources, tool results, tests, or policy checks support that result?
- Failure: How does the capability report uncertainty, refusal, partial completion, or the need for approval?
The last two are where many prototypes fall apart. A natural-language answer looks complete even when the underlying work is not. If the contract only requires a string, the system has no reliable way to distinguish a grounded result from a polished guess.
Imagine a capability that proposes a production configuration change. Its result should not merely be an explanation. It should include the proposed patch, the scope of affected services, validation output, a risk classification, and whether human approval is required. The prose is useful. The evidence is what makes the result actionable.
Contracts also protect the capability from callers. If the task is approved only for read access, a prompt cannot quietly expand that authority. If the result requires two independent sources, the capability cannot call one source “close enough” and mark itself complete. Composition becomes reliable when the seams carry policy, not just data.
The Model Belongs Behind the Boundary
Model choice should be an implementation decision whenever possible.
That does not mean all models are equivalent. They differ meaningfully in reasoning, latency, cost, tool use, context behavior, and data policy. It means those differences should be handled by routing and evaluation rather than leaking into every product surface.
A routine classification step may use a small, inexpensive model. An ambiguous investigation may escalate to a stronger one. A final review may use a different model family to reduce correlated errors. A regulated workload may be routed to a deployment that satisfies its data boundary even when another model scores higher on a benchmark.
If the rest of the application is coupled directly to one provider's message format, tool schema, and refusal behavior, changing that routing becomes a rewrite. A capability boundary gives the system room to adapt.
The model is still central to the implementation. It just does not get to define the architecture around itself.
Orchestration Is the Control Plane
Once a task involves more than one capability, something has to decide how work moves. That is orchestration.
The orchestrator accepts the request, selects the next bounded capability, records state, enforces policy, and evaluates whether the returned evidence is sufficient to continue. It may choose a simple fixed sequence. It may build a task graph. It may let a planner propose the path. What matters is that the path becomes explicit before consequential actions occur.
This is where composable systems differ from one giant agent loop. In a giant loop, planning, execution, memory, and authorization blur together inside the current context. In a composable workflow, those responsibilities can disagree with one another.
The planner can propose a database write. The policy boundary can deny it. The executor can report that a prerequisite is missing. The verifier can reject an apparently successful result because the evidence is incomplete. A human can approve a scope change without granting the entire agent permanent authority.
That friction is not waste. It is how the system keeps intelligence from becoming unchecked agency.
The planner-executor-reviewer pattern is a good starting point because it creates three understandable products: a plan, a change, and a judgment backed by evidence. More elaborate orchestration should earn its complexity by solving a real coordination problem.
State Must Outlive the Conversation
An AI system becomes fragile when the transcript is its database.
Conversations are useful interaction records, but they are a poor source of operational truth. They mix instructions, hypotheses, tool results, corrections, and abandoned plans in one long stream. Context compaction can remove detail. A process can fail. A task can pause for approval and resume days later under a different worker.
Durable work needs durable state.
The exact storage depends on the problem: a workflow engine, task ledger, database, object store, event stream, or versioned files may all be reasonable. The important part is that the system records facts in forms other components can inspect without replaying the model's internal journey.
At minimum, a long-running task should preserve:
- the original request and accepted scope
- the current plan and completed steps
- tool calls and their relevant outputs
- artifacts produced by each capability
- approvals, denials, and policy decisions
- unresolved uncertainty and retry history
- the evidence used to declare completion
This external state creates another useful property: resumability. A replacement worker can continue from an explicit checkpoint rather than trying to imitate the missing context of the previous worker. That is composition across time, not just across components.
Least Privilege Has to Be Dynamic
Giving an agent every tool it might eventually need is convenient in development and reckless in production.
The safer pattern is to grant authority to a bounded step. A research capability may read approved documents but cannot send email. A drafting capability may prepare a customer response but cannot publish it. A deployment capability may write to a staging environment only after tests pass and a human approves the release.
This is more precise than giving an agent a permanent role such as “operator.” The same agent implementation can run under different capability grants, and those grants can expire when the step ends.
The tool layer should enforce this independently of the prompt. Prompt instructions are behavioral guidance; they are not a security boundary. If a task is not permitted to reach a production database, the database credential should not be present. If a connector exposes twenty actions and the capability needs two, the other eighteen should not be callable.
Composable tool access also makes incidents easier to contain. A compromised retrieval result may influence the model, but the available blast radius is limited by the current capability contract. The architecture assumes that model behavior can be manipulated and ensures that manipulation does not automatically become authority.
Verification Is a Separate Capability
AI systems are often asked to review their own work in the same prompt that produced it. That is better than no review, but it is not a strong control.
Verification should have independent inputs, explicit criteria, and the ability to stop the workflow. For a code change, verification may include tests, static analysis, a diff review, and checks against the original acceptance criteria. For a research result, it may check source quality, citation coverage, contradictions, and whether important claims are actually supported. For an operational action, it may validate policy, scope, and expected side effects before execution.
Some checks should be deterministic. Use a schema validator for structure, a policy engine for policy, and a test runner for behavior. Do not ask a model to approximate a check that software can perform exactly.
Models are useful where judgment is unavoidable: whether evidence answers the real question, whether a proposed change creates a subtle architectural regression, or whether uncertainty has been communicated honestly. Even then, the verifier should return a structured decision with reasons and evidence, not a reassuring paragraph.
A system is not trustworthy because it usually produces good answers. It is trustworthy when it can recognize the conditions under which an answer is not good enough to act on.
Observability Should Explain the Decision
Infrastructure metrics tell us whether a request was fast, expensive, or unsuccessful. AI systems also need semantic observability: what the system believed it was doing and why it was allowed to continue.
A useful trace connects the original request to the capabilities invoked, the model and policy versions used, the context retrieved, the tools called, the evidence returned, and the gate that approved the next step. It should be possible to answer:
- Why was this capability selected?
- What authority did it have?
- Which evidence influenced the result?
- Where did the system express uncertainty?
- Why did verification pass?
- What changed between a successful run and a failed one?
That does not require storing every hidden reasoning token. In many cases, doing so would create noise, cost, or unnecessary exposure. What matters is preserving the operational decisions and artifacts needed to understand behavior.
Observability is also what makes replaceability practical. If a team swaps its retrieval implementation but cannot compare grounding quality, latency, and downstream verification failures, the component is replaceable only in a diagram. Real composability requires feedback that crosses the boundary.
A Concrete Example: Customer Refunds
Consider a customer-support system that can recommend and issue refunds.
A monolithic agent might read the conversation, search account history, interpret policy, decide on a refund, update the payment system, and send the response. It is easy to build and difficult to govern. Its prompt contains product behavior, policy, tool instructions, and tone. Its credential can do everything. A mistake at any point can flow directly into a financial action.
A composable design separates the work:
- An intake capability converts the conversation into a structured case without gaining payment access.
- A retrieval capability gathers the relevant order history and current refund policy under customer-scoped permissions.
- A decision capability proposes an outcome and cites the policy clauses and account facts that support it.
- A policy gate checks amount limits, fraud signals, regional rules, and whether human review is mandatory.
- An execution capability receives a short-lived, case-specific grant to issue the approved amount.
- A communication capability drafts the response from the recorded decision and transaction result.
This system is not valuable because it has six boxes. It is valuable because each boundary limits what a failure can become.
The language model used for intake can change without touching payment execution. The refund policy can move from prompt text into a versioned policy service. High-value cases can add human approval without changing routine cases. A new verifier can shadow the existing decision capability and gather evidence before taking over. If the communication step fails, the completed refund remains a durable fact rather than a memory buried in a session.
That is composability doing operational work.
What Not to Compose
There is a real danger in turning composability into fragmentation.
Every boundary adds latency, state transitions, failure modes, and something else to observe. Splitting a five-second task among seven agents does not make it architectural. It may only make it expensive.
Keep work together when it shares one authority boundary, one coherent context, and one verification condition. Separate it when responsibilities change, permissions change, state must persist, implementations need to evolve independently, or failure requires a different recovery path.
The best boundary is not the smallest possible component. It is the smallest component that owns a meaningful responsibility.
I use three practical questions:
- Can this part fail without invalidating the whole task? If yes, a boundary may create useful containment.
- Does this part need different authority? If yes, it should almost certainly be isolated.
- Will we want to evaluate or replace it independently? If yes, give it a contract and its own telemetry.
If the answer to all three is no, another component may be ceremony.
A Migration Path From the Giant Prompt
Most teams do not need to rebuild their AI stack to start.
Begin by tracing one production workflow from request to consequence. Mark where the system retrieves information, makes a judgment, calls a tool, changes state, and claims success. Then identify the most consequential seam—usually the transition from reasoning to action—and put a contract around it.
Move durable facts out of the transcript. Narrow the tool grant for that step. Require evidence in the result. Add one independent verification gate before the action becomes irreversible. Instrument enough of the path to compare behavior before and after the change.
Only then look for the next seam.
This incremental approach matters because architecture should be proven by behavior. A clean diagram cannot tell you whether a capability contract is useful, whether the verifier catches real failures, or whether the boundary creates more latency than value. Production traces can.
Over time, the giant prompt becomes a set of capabilities because the system has discovered stable responsibilities—not because someone decided that more boxes looked mature.
The Test of Composability
The simplest test is not how many components the system contains. It is what happens when one of them changes.
Can you replace the model used for one capability without rewriting the product? Can you revoke a tool without editing a dozen prompts? Can a task resume after the worker disappears? Can you add a human approval gate without inventing a parallel workflow? Can you explain why an action occurred using durable evidence? Can a verifier stop a confident but unsupported result?
If the answer is yes, the architecture is doing its job.
Composable AI is not a promise that every component will be correct. It is a way to keep one component's uncertainty from becoming the whole system's failure. It gives intelligence boundaries, authority a lifetime, state a durable home, and decisions a path to verification.
The model will keep changing. The architecture should be built for that fact.