Get startedGet started for free

What are multi-agent systems?

1. What are multi-agent systems?

Up to now, we’ve been working with a single agent, which is already powerful.

2. Beyond one agent

But sometimes, dividing tasks among specialized agents can be even more effective – this is where multi-agent systems come in. In simple terms, a multi-agent system is like a team of AI agents collaborating to achieve a goal. Each agent can have its own specialty or role, and together they can tackle complex, multifaceted tasks.

3. Why use many agents?

Why might we need many agents instead of one? Think about a project like writing an extensive research report. One approach is a single agent that tries to do everything: search for info, compile it, write the report, check its own work, and return the answer. That can work, but it can also be hard for one agent to juggle all those subtasks.

4. Meet the specialized agents

Alternatively, we could have: A ResearchAgent that’s really good at searching for information. A WriteAgent that excels at taking information and drafting a report. A ReviewAgent that goes over the report and suggests improvements or corrections.

5. How they work together

Each of these agents can focus on its own task. The research agent doesn’t need to worry about prose style, and the WriteAgent doesn’t need to worry about how to find data, because the research agent feeds it notes. The review agent then checks the final product for quality. This divide-and-conquer strategy mirrors how human teams often work.

6. When to scale up

Another scenario is when tasks need to be done in parallel or require different knowledge domains. Instead of overloading one agent with everything, we spin up multiple agents. When should we scale from one agent to many? Usually when the task naturally breaks into parts, or when one agent alone struggles due to prompt length or complexity. If we find ourselves giving one agent a large prompt “first do this, then that, then that…”, it might be a sign to split tasks. LLMs sometimes struggle if you give them too many tools at once, so splitting our tools across multiple agents can help with that, too.

7. Built-in AgentWorkflow

In LlamaIndex, the AgentWorkflow is actually built to handle multiple agents internally. It allows agents to hand off tasks to each other. For example, after our ResearchAgent gathers info, it can hand off to the WriteAgent to produce the report. The framework manages the sequence of events and passing of context between them. However, multi-agent systems also bring complexity. We need to design how they communicate, what each knows or doesn’t know, and how they coordinate. It’s a bit like software architecture but for AI behaviors. Multi-agent systems add a layer of complexity but also open up a new world of possibilities.

8. Let's practice!

Ready to assemble our team of agents? Let’s do it in the next section!

Create Your Free Account

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.