DEV Community

Cover image for 5 ways AI agents work together, in plain words
Krys for Agentivity

Posted on Edited on Originally published at agentivity.io AI-assisted

5 ways AI agents work together, in plain words

Written with AI assistance and reviewed by a person. First published on the Agentivity blog.

A good AI answers almost any question, one question at a time. But the work of a department is rarely one question. A report, a hiring round or an offer needs several kinds of knowledge, done in the right order and checked before it goes out.

In a company, that kind of work goes to a team. One person knows the numbers, another knows the client, a third checks. AI can work the same way: instead of one assistant that does everything, you set up a team of AI agents. Each has its own role and instructions, and can have its own information and tools: your documents, a data table, a web search. Then you decide how they work together.

There are five common ways, much like the ways human teams work: one after another, all at the same time, by passing the case to the right colleague, by discussing in turns, or under a manager who decides who works next. The pattern you choose matters as much as the agents themselves, because it decides who speaks to whom, in what order, and who has the last word.

This guide explains each of the five, with an everyday comparison, what it is good at, and where it goes wrong.

Why does the way of working matter?

Because a group of capable specialists is not yet a team.

Put five good people in a room without telling them who starts, who checks and who decides, and you get repeated work and contradictory answers. AI agents are no different. The same three agents can produce a clean result or a muddle, depending only on how they are organised.

Creating a team in a visual editor: naming it, choosing the pattern, dragging in the members.
Creating a team in our visual editor, played faster.

The five at a glance

Pattern Like Best for Watch out for
Sequential An assembly line Steps that always come in the same order One weak step spoils everything after it
Concurrent Colleagues each taking a file Independent tasks, when speed matters Results that do not fit together
Handoff A reception desk Requests that must find the right specialist Cases passed around without an owner
Group chat A meeting Questions that gain from being challenged Long discussions that cost a lot
Manager-led A project lead and a crew Jobs where the steps depend on the request A manager with a vague brief

1. Sequential: one after another

In a line: a researcher, a writer and a reviewer, each building on the one before.

Each agent finishes its part and passes the result to the next. Research, then draft, then review.

In code: a pipeline. Each agent's output is the next agent's input.

Like: an assembly line. Each station does one thing to what the previous one produced.

Good at: processes where the order never changes. It is predictable, and when the result is wrong you can see at which step it went wrong. It is the simplest way, and a good first choice.

Watch out for: a mistake early in the chain travels all the way down. Put a checking step where an error would be expensive.

Example: a researcher gathers facts on a competitor, a writer turns them into a one-page note, a reviewer checks the note against the facts.

A sequential team running, each agent working in turn.
A sequential team: each member works in turn and passes its result on.

2. Concurrent: all at the same time

All at once: the brief goes to a legal, a costs and a risks agent at the same time, and their views are gathered in one report.

All the agents start together, each on its own part or from its own angle, and the results are gathered at the end.

In code: fan-out, fan-in. The same input goes to every agent in parallel, and a final step merges the results.

Like: five colleagues who each take one file from the pile and meet again when they are done.

Good at: tasks that do not depend on each other. Reading five sources, checking a document against five rules, looking at one question from five angles. It is the fastest way to cover ground.

Watch out for: nobody sees what the others are doing while they work. If the parts need to agree with each other, add a step after them that puts them together and resolves the differences.

Example: three agents study the same contract, one for the legal side, one for the costs, one for the risks. Or one agent per store reads that store's pages at the same moment, then the offers are compared.

3. Handoff: passing the case to the right colleague

Passing the case on: a front desk sends the request to billing rather than to technical support.

One agent is active at a time. An agent that receives a request it should not handle passes it to the colleague who should. You can decide in advance who is allowed to pass a case to whom.

In code: a transfer of control. The active agent transfers control to another agent, along with the case so far.

Like: a reception desk. You explain why you came, and you are sent to the right department, which may send you on if needed.

Good at: requests that arrive mixed. A customer message could be about a delivery, an invoice or a technical fault, and each needs a different specialist.

Watch out for: a case that keeps being passed along. Give every case a clear owner, and limit who can hand over to whom.

Example: a first agent reads each incoming request and sends it to billing, delivery or technical support.

4. Group chat: a discussion in turns

One conversation: a writer, a critic and an editor take turns and each reads what the others said.

The agents speak in turns in one shared conversation, and every one of them sees everything that was said. Each reacts to the others.

In code: shared conversation state. A selector or a fixed order picks the next speaker, until a turn limit or a stop condition.

Like: a meeting where everyone hears everyone.

Good at: questions with no single right answer, where being challenged improves the result. Reviewing a plan, weighing a decision, improving a piece of writing. Not for work with a clear sequence, or with one precise thing to deliver.

Watch out for: meetings can run long. More turns mean more calls to AI models, so more time and cost. Set the maximum number of turns.

Example: a writer and a critic improve a text over a few turns. Or a strategist proposes a campaign, a finance specialist challenges the budget, and a brand specialist checks the tone, until the plan holds.

5. Manager-led: a manager decides who works next

Under a manager: the manager sends the hotel agent to work, while the flights and transfers agents wait their turn.

A manager supervises the work. It sends the request to one specialist at a time, reads the result, then decides who works next or gives the final answer.

In code: an orchestrator or supervisor. One agent calls the others and loops until it can give the final answer.

Like: a project lead with a crew. The lead does not do the work, but knows who should.

Good at: jobs with many parts, where no two requests need exactly the same steps. The manager adapts the plan to each request, and calls only on the specialists it needs.

Watch out for: everything rests on the manager's brief. If its role is vague, it will hand out work badly. Describe carefully what each specialist is for.

Example: a trip-planning team has a manager and twelve specialists: flights, hotel, transfers and more. A weekend away and a month abroad do not call on the same ones.

A manager-led team running, the manager handing out work.
A manager-led team: the manager hands out the work and collects the answers.

How do you choose?

Match the shape to the work. Answer three questions about the job.

Do the steps always come in the same order? If yes, go sequential. If the order depends on the request, look at manager-led or handoff.

Do the parts depend on each other? If not, run them concurrently and save time. If they do, they must happen in order, or be discussed.

Is there one right answer, or does the answer gain from debate? If debate helps, use a group chat, with a maximum number of turns.

When two ways seem to fit, pick the simpler one. You can change later: the members keep their roles, and only the organisation changes.

Can you combine them? A small AI company

A small AI company: a director sends work to a marketing team, a sales team and an operations team, each with its own agents.

Yes, and real teams often do. A member of a team does not have to be an agent: it can be another team.

A director can send the work to a marketing team, a sales team or an operations team, and each of them has its own agents and its own way of working. A manager can hand "write the report" to a small sequential team of writer and reviewer, and "check the sources" to three agents working concurrently. You build large solutions from small parts you have already tested.

Start simple all the same. A team of three working sequentially teaches you more about your job than a large structure you cannot follow.

Where do people fit in?

The team prepares, a person says yes, and only then does the work go further.

In all five. A team of AI agents does not have to work alone: the team prepares, your people review and decide. Whatever the way of working, the work should stop and ask when a decision belongs to a person: approving a rejection, choosing between two options, confirming a payment. You decide where those stops go, and make sure you can see what each agent received and produced. More on this in where a person should stay in charge.

In short

Choose sequential for a fixed chain, concurrent for independent tasks, handoff to route requests, group chat when debate helps, and manager-led when each request needs its own plan.

Going further:

Questions and answers

Which way of working should I start with?

Sequential. One agent after another is the easiest to follow and to correct. Move to another way of working when you can name what sequential does badly for your job.

Can I change the way of working later?

Yes. The members keep their roles. You change how they collaborate, then run the team again on the same cases and compare.

Can a team contain another team?

Yes. A member of a team can itself be a team, so a manager can hand a part of the job to a small group that works sequentially, for example.

Which way of working costs the least?

Usually sequential, because each member works once and nobody discusses. Group chat and manager-led involve more exchanges between members, so more calls to AI models. The right choice is the cheapest one that does the job well.

Top comments (0)