How many AI agents do you need? As many as there are bounded contexts: each meaning boundary gets its own agent. Below: why, how it scales, what sits between agents and where to start.
One agent per context
There are as many agents as bounded contexts. That way an agent has enough context.
One for all or one per context
Takeaway
In this example"Order" means different things in sales, delivery and payment. One agent mixes the meanings, three agents each keep their own.
In generalA context boundary already shows where the meaning changes. It is a handy place to cut both specs and the agents' work.
What to doList the project contexts and write next to each one who works inside its boundaries.
How it scales
Load and number of agents
Takeaway
In this exampleEight contexts: one agent drowns in meanings, while eight agents each work within their own borders.
In generalThe number of agents grows linearly with the number of contexts while each one's load stays flat. In our experience. The numbers in the charts are illustrative.
What to doAdd an agent together with a new context instead of growing one agent's context.
What sits between agents
Agents talk through contracts: events and APIs. A foreign context is not under our control, so the agent reaches it only through the contract and with your confirmation. More on judging complexity: where the complexity is real.
Context map
Takeaway
In this exampleThe sales agent reads the "order paid" event from payment and writes to the partner system only through an approved contract.
In generalA contract replaces shared context: agents do not need to know the inside of someone else's boundary, and a mistake does not spread.
What to doFor each link between contexts write the contract in one line: what it gives, what it takes, who owns it.
Where to start
Takeaway
In this exampleStart with two neighbouring contexts and one contract between them.
In generalOne context, one agent, one contract: that tests the scheme before you stretch it across the whole project.
What to doPick two contexts where words get mixed up most often and start one agent for each.