One agent, too many hats

When it pays to split a task across several agents, and what holds them together: a contract, a fixed sequence, and a check at the end.

A single agent builds one feature reliably. Hand it a whole product with API, interface, database, and tests, and the same thing tends to happen: the API endpoints are named differently from the calls in the frontend, the schema lacks fields the interface expects, and during the repairs the original requirement gets lost.

The reason is not a lack of skill. An agent works inside one context window. The more areas it has to hold in there at once, the less room is left for each.

Splitting like a team

Several agents get one area each: one the API, one the interface, one the tests. Each has a context window of its own and does not see the conversations of the others. That is intended. In a team, not everyone reads every message either. People agree on an interface and deliver to it.

What holds them together

  1. The whole brief for everyone. Each agent gets the complete requirement, not just its slice. Whoever builds the API then knows what the interface is meant to show.
  2. A written contract. Endpoints, fields, and error cases are in a file before anyone writes code. Agents coordinate through that file and through the code, not through conversation.
  3. A fixed sequence. Who starts, who waits, when the check runs: a script decides that, not a model. A script does not forget where it is.

The check at the end

That each part runs on its own does not mean the parts fit together. So after the parallel work comes a step of its own: a reviewer reads all results against the requirement and against the contract, and the tests run across the whole.

If the check fails, the findings go back to the agent responsible. The number of repair rounds is limited, to three for example. After that a person decides. Without that limit the system repairs in circles.

When it does not pay

  • Small tasks. One agent with full context is faster than four with coordination.
  • The same files. Two agents changing the same file at the same time overwrite each other. Writing in parallel only works in separate areas. Reading in parallel, meaning searching, researching, and reviewing, almost always works.
  • An unclear requirement. More agents then only build the wrong thing faster.

Then there is the cost: every agent uses tokens of its own. Several agents are faster, but not cheaper.

Our order

First settle the requirement and the contract, then split, and check together at the end. The technology behind it is simple. Florian Zeba built and described an orchestration of this kind as a Bash script, with the full brief for every agent, a check at the end, and at most three repair rounds: Implementing a SubAgent Orchestration System in my Dev Container.

Discuss a project

Send us the project goal, current state, and main bottleneck. We will respond with a clear assessment.

office@sftwrk.at
Phone
+43 699 172 948 71
Address
Stefan-Fadinger-Straße 20, 4600 Wels, Österreich