How to use "Multi-agents mode" in Coze

Coze
12 Feb 202409:11

Summary

TLDRThe video explains how to use multi-agent mode in Anthropic's conversational AI assistant Claude to break down complex tasks between multiple bots. It starts with a single personal assistant bot, then adds an email bot and calendar bot connected via "jump conditions" that trigger when certain keywords are mentioned. More bots like a Google Sheets bot are added, all glued together by the main menu assistant bot. This allows separating responsibilities so no one bot handles everything, enabling teamwork between bots to accomplish users' requests.

Takeaways

  • ๐Ÿ˜Š Multi-agent mode allows you to create multiple bots that collaborate to complete complex tasks
  • ๐Ÿ‘ฅ You can offload responsibilities across bots instead of overloading a single bot
  • ๐Ÿšฆ Jump conditions allow you to switch between bots based on triggers like keywords
  • ๐Ÿค Bots can be connected using jump conditions to create a workflow
  • ๐Ÿ“ You can reuse existing single agent bots in multi-agent mode
  • ๐Ÿ”Œ Plugins, workflows and knowledge bases provide bots with additional skills
  • โž• You can keep adding more nodes and functionality to handle complex scenarios
  • ๐ŸŒ Global jump conditions let you route users back to a main menu bot
  • ๐Ÿ“‹ The my assistant bot serves as a main menu to guide users
  • โ“ Check the documentation and community forums if you need help with multi-agent mode

Q & A

  • What is multi-agent mode?

    -Multi-agent mode is the ability to make multiple agents or bots work together and collaborate to complete complex tasks. It allows you to distribute responsibilities across bots with different skills.

  • How is multi-agent mode different from single agent mode?

    -In single agent mode, you would write one long prompt and persona to complete multiple tasks. In multi-agent mode, you can split up the tasks across specialized bots, with each playing their own role.

  • What are nodes in multi-agent mode?

    -Nodes are agents or bots that operate based on a prompt, skills like plugins/workflows/knowledge, and jump conditions to switch between bots.

  • How do you connect bots in multi-agent mode?

    -Bots are connected using jump conditions that allow passing between bots based on certain trigger keywords a user says.

  • What was the first bot created in the example?

    -The first bot was an email bot that could check, read, and send emails using the Microsoft Outlook plugin.

  • What was the second bot created?

    -The second bot was a calendar bot that could create, update, and list calendar events using the Outlook calendar plugin.

  • How can you return back to the main menu bot?

    -A global jump condition was created that would pass back to the main menu assistant bot if the user said "main menu".

  • What other bots were created?

    -A Google Sheets bot was created to allow managing spreadsheets. More bots connecting other services could also be added.

  • Why use multiple bots versus just one bot?

    -Using multiple bots allows you to separate concerns and responsibilities, avoiding overloading a single bot. It allows completing more complex workflows.

  • Where can you get more information on multi-agent mode?

    -Check the Anthropic documentation and look for the section on multi-agent mode. Additional help is also available on Discord and Telegram.

Outlines

00:00

๐Ÿ˜€ Introducing multi-agent mode for coordinating multiple bots

Josh explains multi-agent mode which allows multiple bots to collaborate and complete complex tasks, unlike single agent mode where one bot handles everything. He demonstrates creating a 'system bot' and 'email bot', connecting them with a jump condition to pass control when the user wants to check email. The bots can have different skills and switch based on keywords to divide responsibilities.

05:01

๐Ÿ˜ƒ Adding a calendar bot and connecting it to the system

Josh adds a calendar bot to create, update, and list calendar events. He connects it to the system so when the user asks to create a calendar event, control passes to the calendar bot which then uses the Outlook calendar plugin to add the event. He can keep adding more bots for different services and connect them with jump conditions to create a workflow for complex tasks.

Mindmap

Keywords

๐Ÿ’กmulti-agent mode

Multi-agent mode allows you to create multiple chatbot agents that can collaborate to complete complex tasks. Instead of having one bot try to handle everything, you can break down responsibilities between different specialized bots. For example, Josh creates separate email, calendar, and Google Sheets bots that each focus on specific functions but can pass tasks between each other.

๐Ÿ’กnode

A node represents an individual chatbot agent within a multi-agent environment. You create new nodes and connect them using jump conditions to route conversations between the different bots.

๐Ÿ’กjump condition

A jump condition is a predefined trigger phrase that passes the conversation from one bot to another when activated. For example, Josh sets up a jump condition so that saying "check my email" will shift the chat from the main assistant bot to the specialized email bot.

๐Ÿ’กplugin

Plugins allow you to connect bots to external platforms and services like Microsoft Outlook or Google Sheets. Plugins give bots the skills they need to complete specialized tasks within those services, like sending calendar invites.

๐Ÿ’กprompt

The prompt provides a bot with its persona, knowledge, and responsibilities. For example, Josh creates an email bot prompt that establishes it as an assistant focused on managing his email account.

๐Ÿ’กsingle agent mode

Single agent mode has just one main bot that tries to handle all tasks through a long, complex prompt. Multi-agent mode is better for complex tasks because it divides responsibilities between multiple collaborative bots.

๐Ÿ’กskills

Skills enhance what a bot can do, such as plugins that connect to external platforms, workflows that automate processes, or knowledge bases that provide information to pull from.

๐Ÿ’กglobal jump condition

A global jump condition lets you return to a main menu bot from any other bot with a trigger phrase. Josh sets up "bring me to the main menu" so users can navigate back from the email, calendar, etc. bots.

๐Ÿ’กbot

A bot is an individual chat agent created in single or multi-agent mode. Bots have responsibilities and capabilities defined by their prompts, skills, and integrations.

๐Ÿ’กcomplex task

A complex task is something that would be difficult for one bot to handle on its own. Multi-agent mode helps break complex tasks down into pieces that specialized bots can collaborate on.

Highlights

Multi-agent mode allows multiple bots to collaborate on complex tasks

Bots can play different roles based on skills like plugins, workflows and knowledge bases

Nodes represent agents or bots that operate on a prompt and can have skills applied

Jump conditions allow switching between bots based on trigger keywords

Assistant bot acts as main menu, prompts user on bot capabilities

Email bot handles email responsibilities exclusively through Outlook plugin

Calendar bot creates, updates, lists calendar events via Outlook calendar plugin

Can connect more nodes and functionality through additional jump conditions

Added Google Sheets bot that connects via new jump conditions

Global jump condition added to return to main menu assistant bot

Jump conditions connect bots and trigger based on keywords

Team of bots divides workload instead of overwhelming single bot

Can expand complexity by adding more nodes, plugins, jump conditions

Documentation has more details on implementing multi-agent mode

Join Discord or Telegram groups for additional questions

Transcripts

play00:00

what's up y'all it's Josh MOS and I'm

play00:01

here to tell you about multi-agent mode

play00:03

now multi-agent mode is the ability to

play00:05

make multiple agents or Bots work

play00:08

together and collaborate to complete

play00:09

complex task now it's a bit different

play00:12

from single agent mode usually you're

play00:14

used to writing a really long prompt and

play00:16

a Persona in order to complete multiple

play00:17

tasks but now you can offload that to

play00:19

multiple Bots and they can all play

play00:21

their own role and in this video I'm

play00:23

going to show you how to do that all

play00:24

right so I'm here in the co workspace

play00:26

and I'm in single agent bot mode and

play00:28

that just means that my bot is able to

play00:29

take take a prompt get some skills and

play00:32

it's able to complete some simple task

play00:34

right now this is a personal assistant

play00:36

bot that's able to send emails and check

play00:38

my emails from using the Microsoft

play00:40

Outlook email plugin however I want to

play00:43

step it up a notch I want my bot to have

play00:45

the ability to create calendar

play00:46

invitations and update my calendar or

play00:48

even create Google Sheets or update

play00:51

Google Sheets and read them back to me

play00:54

so what I'll need to do is create a

play00:56

multi-agent bot so that my bot doesn't

play00:58

have to feel like it has to complete all

play01:00

those responsibilities inside of one

play01:02

prompt now this helps separate concerns

play01:05

and this also helps complete complex

play01:07

tasks and I'll show you how to do this

play01:09

right now so the way to do this is by

play01:11

going over here next to develop and

play01:13

clicking single agent mode and then over

play01:16

here to multi-agent mode multi-agent

play01:18

mode and single agent mode have a few

play01:20

similarities we still have Persona impr

play01:22

prompt on the side here our variable

play01:25

scheduled task and opening

play01:27

dialogue however when we look to the

play01:29

middle section section we have this

play01:30

starting point and a node here this node

play01:33

is an agent or a bot that operates off

play01:35

this prompt it can also have skills

play01:38

applied to it like plugins workflows and

play01:43

knowledge and it can also operate off of

play01:45

jump conditions in order to get pass

play01:47

from one bot to the next and switch

play01:50

whenever you trigger off of keywords so

play01:52

I'll write a jump condition here so that

play01:54

when a user wants to send an email we'll

play01:56

get passed to the email bot so these

play01:58

Bots work collaboratively in order to

play02:00

get complex task done so let's start

play02:02

putting the pieces together in order to

play02:04

do that we're going to need a node and a

play02:06

node can either be a new agent a bot

play02:08

that you already created in single bot

play02:10

mode right so these are some past Bots

play02:12

that I've created and then also a global

play02:15

jump condition which is a jump condition

play02:17

that will apply to all the agents that

play02:19

you have here on the board now what I'm

play02:22

going to do is just add a new agent and

play02:24

I'm going to make this agent into a bot

play02:26

for our mail so let's go here and we'll

play02:30

call this

play02:31

email

play02:34

bot right and we can

play02:37

say you are a bot that

play02:42

helps check

play02:45

emails so from here what we're going to

play02:47

do is add a new plugin for our Outlook

play02:53

email right and we're going to choose

play02:55

both of these options to get the mail

play02:58

and also be able to send mail just like

play03:00

how we had before in our single bot

play03:02

mode now what I'll do is I'll take this

play03:05

jump condition that I have here to

play03:07

respond if a user wants to send emails

play03:09

or check their emails and I'm going to

play03:11

pass it over here to this email bot so

play03:14

now I have both of these Bots here

play03:16

connected to one another this my

play03:18

assistant bot acts as my main menu and

play03:20

it will start to prompt my user and ask

play03:22

what responsibilities or what do we want

play03:24

this bot to do and when I say something

play03:27

along the lines of check my email it's

play03:28

going to actually p pass me from this my

play03:30

system bot to my email bot so let's take

play03:33

a

play03:36

look so it says here system next step

play03:39

and it passed it to our email bot right

play03:41

so let's check my email and now that I'm

play03:43

here um signing in for the first time

play03:46

with Microsoft Outlook email I just have

play03:48

to click here to authorize my email

play03:50

address authorization only takes a few

play03:52

steps so let's actually just run this

play03:55

again and see what it

play03:58

outputs

play04:02

so it's using system next step and now

play04:04

the plugin and it's looking at my email

play04:06

address and it seems that I have two new

play04:07

emails

play04:09

here great so these are the two emails

play04:12

that I have in my Microsoft Outlook

play04:14

email address now if I want to enhance

play04:16

the email agent I can always come back

play04:18

and add more to the prompt and give it

play04:19

some skills like plugins workflows and

play04:21

knowledge bases however I need a bot

play04:24

that's going to solely handle the

play04:25

responsibility of managing my calendar

play04:28

and that can consist of SK like adding

play04:30

events to my calendar inviting folks to

play04:33

my calendar updating my calendar or even

play04:36

listing what's on my calendar for the

play04:37

day so in order to do that I need to add

play04:40

another node and connect it to another

play04:43

plugin so I'll create a node here and

play04:46

I'll rename this node calendar bot

play04:48

because this is going to represent our

play04:49

calendar

play04:53

agent and I'm going to give it a prompt

play04:56

and I have a prompt here that I already

play04:57

wrote and I'm stating that this is a bot

play04:59

that that creates calendar events

play05:00

updates calendar events and lists the

play05:02

calendar events so what I'll do now is

play05:06

I'll connect this jump condition that

play05:07

I've already created that responds if a

play05:09

user wants to send a calendar invitation

play05:11

update a calendar invitation or list

play05:13

them so I'll take this here and I'll

play05:16

pass it over to our calendar bot and now

play05:19

what I'll need to do with this calendar

play05:20

bot is give us some

play05:22

skills I'll go here to our plug-in list

play05:25

and I'll also add Outlook calendar now

play05:28

if you have another EMA email that you

play05:30

have uh managing on another service you

play05:33

can always create a plugin here with the

play05:35

API but for now I'm going to use Outlook

play05:38

calendar so I go here and I'll add all

play05:41

the skills create event list event and

play05:44

update

play05:45

event so I'll go here and I'll click out

play05:48

and I'll see that my skills are already

play05:50

here ready to go so my bot is currently

play05:53

chatting with our email bot so if I say

play05:56

to my bot now create a account

play06:00

calendar event on Feb

play06:04

12th at 11

play06:07

a.m. Pacific

play06:09

Time title the event

play06:14

webinar so I'll send this over to our

play06:16

bot and we'll see how it system steps

play06:20

and changes it from our email agent to

play06:22

our calendar agent now and you'll see

play06:25

that it's using the plugin and it's

play06:26

stating that the calendar event was

play06:28

created and we can view it here here so

play06:30

let's wait for the response to finish

play06:32

and we'll take a look at our calendar

play06:33

and we'll see the changes so if we click

play06:35

here we'll go straight to our calendar

play06:38

and we'll see we have a webinar here at

play06:40

11:00 a.m. on February 12th we're also

play06:43

going to need to be able to connect more

play06:45

functionality so we can continue to add

play06:47

more nodes and connect nodes to each

play06:49

other with jump conditions and it can

play06:51

get even more complex so I can add

play06:54

another node here to connect to a Google

play06:56

sheet or another service that I need to

play06:58

work with it could be notion you name it

play07:01

or you can even create your own plugin

play07:02

as well so these jump conditions is

play07:05

what's really going to help put all this

play07:07

together it's the glue and what we'll

play07:09

use is these jump conditions in order to

play07:11

create this flow of work that our Bots

play07:14

our team need to accomplish in order to

play07:16

execute the task that we're asking for

play07:19

so this really helps take off the load

play07:21

of one bot handling everything and this

play07:24

team of bots can work together to give

play07:26

you what you need I've gone ahead and

play07:28

created some new addition to my

play07:29

multi-agent bot so you can see here that

play07:32

I have some new Jump conditions as well

play07:35

and this jump condition that I have is

play07:36

to connect to my new Google Sheets agent

play07:39

that I have here now if you see I have

play07:43

this jump condition and I can

play07:45

disconnected to this Google sheet spot

play07:46

and it will respond anytime a user talks

play07:48

about Google Sheets so I have all these

play07:50

different jump conditions and vice versa

play07:53

on each of these agents that connect to

play07:55

one another and they respond and Trigger

play07:58

when any of these Bots are mentioned now

play08:02

I also want to add one last thing here

play08:04

to make this all kind of glued

play08:06

together since I'm using this my

play08:08

assistant as a main menu I want to be

play08:11

able to come back to this main menu

play08:13

anytime a user says something along the

play08:15

lines of main menu so what I can do is

play08:18

add a new node for a global jump

play08:20

condition and in this Global jump

play08:23

condition I'll just add a prompt here so

play08:25

if the user wants to visit the main menu

play08:28

so what I'll do is just put right here

play08:29

above our my assistant bot and I'll drag

play08:32

it over here and I'll connect it right

play08:36

now we're chatting with our calendar bot

play08:38

and I'll just say to

play08:39

it bring me to the main

play08:45

menu so now you'll start to see that

play08:47

it's going to switch over to our my

play08:50

assistant bot because we have this

play08:51

Global jump condition so it's pretty

play08:53

cool now it's listing out all the things

play08:55

that I can do with this bot based on the

play08:57

prompt that I have and that's it from

play08:58

multi mode for now if you want more

play09:01

information make sure you check out the

play09:02

co documentation and look for

play09:04

multi-agent mode if you have any

play09:06

questions make sure to join us on

play09:08

Discord and on Telegram and we'll see

play09:10

you in the next video