AutoGen Studio (4/4): Multi Agent Teams and More Powerful Agents

Welcome back to part 3, where we’ll explore both the group chat features and how to level up our agents to make them more powerful. We’ll start with the group chat which involves more than 2 agents as a team.

👉 Go Back to the Full Course: Next Level Prompt Engineering with AutoGen Studio

Let’s take a quick look at how this works using the example that AutoGen has already pre-setup for us to get started.

Group chats and the group chat manager

First head over to the Build tab and then the Workflows section. You will see that a Travel Agent Group Chat Workflow has already been created for us. Click on this workflow and let’s see how it works first.

So we have the name, description, a ‘summary method’ of last, and the sender is a userproxy type agent. This is the same userproxy that we have seen before, and if you open it up you’ll see that most fields are empty as its job is just to pass on our message and act as a code executor if needed.

On the right side we have the Receiver just like before, but this time instead of having an assistant here we have the group_chat_manager. Click it and let’s check it out:

So we can see that this special agent type has a Group chat agents field, and this is where we can add multiple agents to our group chat, in this case, it has three different agents in the group chat.

If we scroll down we can see that the group_chat_manager has a name but no description, no meaningful system message, and no models or skills. It’s more of a special agent type as an empty shell that contains other agents to form the group but doesn’t necessarily contribute to the group or its conversations itself.

Like the [brackets] in a Python list, it serves as a container for the contents. There might be a model declared under Model by the way, but you can delete it from the list just like I did before taking the screenshot.

The agents in the group chat

So as the group_chat_manager is basically just a container for the agents in the group chat, let’s take a look at the agents themselves. First, let’s open the primary_assistant:

As we can see from the prompt message, this is the agent that will actually lead and coordinate the group chat. This can seem surprising at first as you’d probably have expected the group_chat_manager to be the one coordinating the group.

We can see it has instructions to coordinate with the two other agents in the group chat and the instructions for the final response being the complete plan + the word TERMINATE again.

If we close this and open up the local_assistant we can see all settings are basically the same except for the prompt, which basically tells the agent that it is a travel agent:

Notice two things here:

  • It also has instructions that if a plan is already satisfactory that is ok, so as not to force it to rebuild an already perfectly fine travel plan.
  • It doesn’t have the ending and TERMINATE instructions here, as we deliberately want this decision responsibility to lie with the primary_assistant alone.

Finally, we have the language_assistant:

This one has the same basic structure and idea as the other agent, providing its part on the language and communication challenges to the plan but leaving the main responsibility with the primary assistant.

The group chat in action

Ok so close up this workflow and let’s give it a spin! Head over to the Playground tab and click on +New, and choose the Travel Agent Group Chat Workflow from the dropdown menu:

Now I’m going to ask it a simple question and let’s see:

I won’t show the entire output here, as it is a bit long and not really the topic we’re dealing with, plus you can obviously try this for yourself. But here is what happened for me:

  1. userproxy (to group_chat_manager): Just passes our query along about wanting to visit Paris for 3 days.
  2. primary_assistant (to group_chat_manager): Some intro talk and then asks the local_assistant for a list of must-see attractions and the language_assistant for basic phrases or language tips.
  3. local_assistant (to group_chat_manager): Provides a full three-day itinerary for Paris.
  4. language_assistant (to group_chat_manager): Provides some basic phrases and language tips.
  5. primary_assistant (to group_chat_manager): Based on the valuable input from the local_assistant and language_assistant, here is your complete travel itinerary for a 3-day visit to Paris, including local attractions and language tips: [gives the whole travel plan with tips here] and wishes you a great trip before using the keyword TERMINATE.

Now what you should see pop up in the user interface is message number 5 from above, which contains the full resulting plan. But you may actually see message number 4 pop up in the user interface instead and it will claim there are only 4 messages in the total chat and not 5, just like it did for me here where the non-final answer of the language tips is showing as the final output in the user interface:

So what gives?

Bugs – AutoGen Studio is a work in progress

AutoGen actually did a good job under the hood. If you go to the terminal window (the one you used to start up the docker container) you will be able to read through all of AutoGen’s output. AutoGen Studio