Why AI Engineers Are Building Multi-Agent Systems From the Wrong Direction — and What Great Engineers Do Differently

Why AI Engineers Are Building Multi-Agent Systems From the Wrong Direction — and What Great Engineers Do Differently

One mental model I had to unlearn while building multi-agent systems is the idea of AI workflows. Most frameworks put the workflow in the middle:

Which agent works first?
Which agent calls the next one?
Where do they branch?
When do they merge?

But this starts from the wrong abstraction. When we enter any serious domain, the first question shouldn't be who works when. It should be:

What process are we trying to automate? What rules and constraints make that process valid?

Those constraints usually have nothing to do with agents. And putting them inside prompts is dangerous. Imagine an insurance agent that receives this instruction:

Never approve a claim above €10,000 without human review.

That is a business rule disguised as natural language. Eventually the model will misunderstand it, ignore it, or behave unexpectedly around an edge case. Now imagine the rule exists in the domain model instead:

claim.ts
claim.approve()
// DomainError:
// Claims above 10,000 require human review.

The agent doesn't need to perfectly remember the rule. It tries to perform an action. The domain rejects an invalid state transition. That error goes back into the model context. Now the agent has something extremely important: a feedback loop.

It can reason about what happened, choose another tool, request human approval, or change its plan. This is where autonomy actually comes from. Not from giving the model more freedom, but from giving it a well-defined environment it can act inside and receive feedback from.

Without this separation, we usually end up with one of two systems: risky autonomous agents where important rules live in prompts, or heavily constrained agents where developers reduce autonomy because they don't trust the system.

The better architecture is to model the domain first.

Model the process.
Model the state.
Model the invariants.
Model what is allowed and what is impossible.

Then give agents tools for interacting with that model. This changes the architecture of multi-agent systems completely. Agents don't need to be the workflow. They can work concurrently and independently against a shared domain model.

This is the direction we're taking with the next version of Mozaik. Instead of asking developers to draw another agent workflow, Mozaik introduces shared runtime state that agents can interact with concurrently while the domain model remains responsible for enforcing the rules.

The more I work on multi-agent systems, the more convinced I become that developers building them need to become obsessed with the domain. The breakthrough won't come from modeling increasingly complicated AI workflows. It will come from modeling the real world correctly — and letting agents operate inside it.

Miodrag Vilotijević

Miodrag Vilotijević

Co-founder @ JigJoy

Building the future of agentic systems

With tools and technology we already have, we can build much more valuable systems than most projects today. We can write software that is a pleasure to use and a pleasure to work on; software that doesn't box us in as it grows, but creates new opportunities and continues to add value for its owners.
Eric Evans

Newsletter

For developers who want to learn how to build self-organizing agents.

We're organizing a hackathon