Beyond Solo Agents: How To Build AI Teams That Handle Complex Tasks

Introduction

I'm Robert. I'm co-founding a company called Chatforce based here in Toronto. And Chatforce gives you a virtual office where you can build, test, and export a workforce of AI agents.

Defining an Agent

So first, I'd like to just define what an agent is in very simple terms. We all know what a large language model is, like GPT. It generates a text output.

Meanwhile, an agent thinks in text, but generates an action instead of a text output. An action is something that the agent can do in the real world, including web browsing, calling an API, calling our own custom code, writing something to our computer, et cetera.

Use Case: Background Actor Agencies

Who here has been a background actor before? OK, a few people, myself included.

Today I'll be showing you a more complicated use case of agents, where we will be serving background actor agencies. With current agent tools, we find that they're great at building two or three agents that interact with one another.

Complex Use Cases

An example could be agents that look at your website and generate marketing material for you, or agents that act as co-pilots for lawyers, pharmacists, doctors, et cetera, whatever. 1But there are a lot of these use cases with multiple layers of complexity, and they require the building of seven agents, 25 agents, 100 agents that all work together to accomplish this task with multiple layers of complexity.

Unfortunately, with current tools, you're not able to build agents that are this complex. 1When you have this many agents, they have a hard time talking to one another. You also have to set up your agents purely in code in a multi-thousand line Python file, which is not a great visualization of what the heck is going on in your agent workforce.

Building the Agent Workforce

So I'll be showing you what it looks like to build a more complicated agent workforce within Chatforce. This agent workforce will be serving background actor agencies.

The idea being that, let's say that Sony Pictures or Amazon Prime Video is filming a new TV show or a movie somewhere in the GTA, and they need a couple of extra background actors in their set. So what they'll do is they will call up a background actor agency, one that's local here to Toronto, And they will say, here are our requirements for the background actors. They need to look like this. Maybe they need brown hair. Maybe they need to be clean-shaven. Maybe they need to look like they're in their 30s, their 40s, their 50s. And possibly, they also need to be able to act in a certain way.

Then the agency will look at all of the actors that have signed up for their agency and send back to the studio a list of actors that they think match the requirements. And this is a very human process. There is no automation involved here.

And so this is actually a great startup idea. Why not automate this process for background actor agencies?

So we'll be building a workforce today that does exactly this.

Setting up the Agents

Here is my database that I'll be accessing of a background actor agency. We've got two folders here. And I apologize if this is a bit small.

So log into Chatforce. and I will create a new workforce. And this is our virtual office environment where we can set up our agents.

So what I want to do first is add a human checkpoint here. A human checkpoint, what it's going to do is when we actually run our workforce, it's going to ask the user which role are we processing for here.

And I have the instructions copied here. I'll do it with one hand.

So our human checkpoint is going to ask, which role are we finding actors for today? And we're going to save the answer into a memory of the workforce called role folder.

Great. So what we're going to do is connect our starting point to this role asker agent.

We can also customize the role asker agent. This is actually my favorite part.

We can give them a fun name, like Query Quinn, and also give them a fun design as well. This guy looks particularly interesting.

So now let's set up our first agent in our workforce here. So I click the button here to add an agent, and I'm going to place them here. This is the agent that is going to read some more information about the role.

So I have the prompt for this agent here. Just gonna copy it over. And in the prompt for this agent, we tell them to read the requirements, which are stored in this location, and format them, and finally save them.

It's a pretty simple task. And let's give this one a fun design, too. We're also going to need to give this agent a skill.

So a skill is something that an agent can do in the real world. I will give them the pre-made skill for reading a file. Just with a click of a button, I gave them that skill.

Processing Actors

What we're going to do next is process the different actors and split them up into groups and then have agents run for each group and rate all the actors in each group and they're going to be running in parallel. So our next agent here is going to be the actor splitter. We're going to read the database of actors and split it up into groups. And let's give this agent also the ability to read the file with the actors.

Now it's time to set up our readers. So the instructions for the rate are going to be a little bit more complicated here. We're going to tell them which group that they're in charge of. We're going to ask them to load the group's info and then also read the available requirements for the movie or the show. And for each actor, they are going to look at the headshot of that actor. They're also going to look at that actor's info and finally give that actor a rating. And they're going to do this for each actor that they are assigned.

We're also going to have to give them the skill of reading an image so that they can look at the headshot. And one additional thing we're going to add to this agent is some more clarification on their expertise. We haven't set up this expertise section for the other agents because it's usually not mandatory. But for this agent, we're going to want to tell the agent what kind of taste they have. For example, what do they focus on in the rating? In this case, when it comes to background actors, what studios look for is an actor that at the very least matches the visual look that they are going for, then they can worry about the additional characteristics of the background actor later. So that's what we wrote in our expertise section here. We said, you are an actor rater who picks actors on roles based on mainly if they look right for the role first, then based on their other characteristics.

All right, so if you notice in the prompt, I said that this agent is in charge of actor group number four. I'm going to click the clone button here so that we can have more agents running in parallel. And so this agent, they're going to be in charge of group three, this agent in charge of group two, and this agent in charge of group one. And we're going to connect the agents like so. They're all going to be running in parallel. So we have to connect each of them to the actor's splitter.

Whoops. It's pretty hard to do this with one hand, to be honest with you.

Generating Reports

And we're going to have one final agent. This final agent is going to just take everything that the other agents have done and generate a PDF report.

They're going to sort all of the actors that have been rated by their rating and then choose the top ones and add them to the report. Let's call them the PDF reporter.

And we're going to make sure that they have the skill for generating a PDF file. Perfect. And we're going to connect them like so.

All right, let me just go through everything really quickly to make sure that we didn't miss a detail here. This looks correct. This also looks correct. This looks correct. This looks correct. Each of the raters will probably also be correct. And our PDF reader at the end also looks correct.

Perfect.

Testing the Workforce

Now let me just save this workforce, and then we're going to run it in test mode and see what happens. All right, let's open the file that we just saved. And let's click on Test.

And fingers crossed this works the first time. So this is Chatforce in test mode. We can use the Auto Play button to run everything all at once.

But instead, I'll show what it looks like to play this agent workforce one agent at a time. So I'm going to press Play. And our role asker asks, What role are we finding actors for today?

And I'm going to use the Gen V show. This is a show that's a spinoff of The Boys, which is a popular Amazon Prime show that was filmed at U of T Mississauga campus. All right. Submit.

And let's move on to the next agent. The next agent is the role reader. Looks like they actually already finished. That was quick. Let's click on Watch to see what they did.

We can see that they accessed the value of the role folder to figure out what folder that role information is in. Then they read the information about the role here. We can see that the role's about show Gen V. Here are the descriptions of the roles that we looked at before. And finally, they saved the cleanly formatted role requirements into the workforce's memory.

They saw that the next agents are going to need a memory where they're going to have to access the different role requirements. So this agent said, oh, I just generated that. Let me save that to the memory. Now let's run the next agent here.

This is the info finder. And hopefully this works. There we go. There's the web browsing.

I'm not touching the computer here, and the agent is going to perform a Google search. It just searched up Gen V show information, and now it's looking at the links from the Google search, and it's going to choose the link that I think will have the most information about the show. It looks like it tried Wikipedia, but maybe that didn't have enough, so it's also trying IMDB now.

Let's go back to the chat for us and click on watch to see what's going on. Right, so read the initial role requirements and then started performing web browsing. We can see the list of steps it performed here. First, we can see that it accessed google.com.

We have a little icon of the Google homepage here. Then it performed some web browsing where it typed into the search bar. It extracted all of the links from its Google search and then started choosing some of the links to visit.

It looks like it tried visiting IMDB, but found some information from there, luckily, and then saved the final information to the workforce's memory. Great. So now it's time to run the actor splitter. This usually takes a little bit of time.

If we click on Watch, we can see that the actor splitter read the entire database of actors. And now it's going to just split them into groups. Here we go, group one, two, three, and four, perfect.

Now it's time to run the raters. And all of them are running in parallel right now. If I click on this rater, then I can click on watch step and see what this rater is doing. So they read the information about their group, that's good.

They read the requirements for the rule. It looks like they were unable to find the headshot images. That is a little bit weird. Didn't expect that to happen.

But that's OK. We'll run the reporter last anyways and see what happens. Maybe the reporter will generate some imaginary ratings. Let's click on Watch to see what they do.

All right, so they read the ratings for each of the different groups. And now they're complaining that there are no ratings. So it looks like we need to debug our prompts here a little bit more. 1So what I would typically do is go back to the home page, go back, edit the workforce, play around with the prompts a little bit to make sure that the rater knows how to access those image headshots.

Exporting to Code

And assuming that we had tested the rest of this workforce, what we could then do is go into edit mode and press the Python button here. And this will allow us to export our agents into code.

So I could do something like this. And if you look at the actual code of the agents that I just saved to my desktop, we can see that we have the code for it.

What we can do now is copy this code into our product, or we can also open a terminal instance. and run the code just by running Python main.py.

But you're going to want to create a virtual environment first and install the additional libraries that are listed in your requirements.txt. If you've used Python before, you probably know what I'm talking about.

If you haven't, then sorry.

Debugging and Results

But I know that since our agent workforce failed to read the headshots and give the final ratings, I don't want things to be a little anticlimactic here. But I did run this exact same workforce with the same prompts earlier today.

And this is the PDF file that I got at the end. We can see that the agents ended up choosing the top five actors. And if you look at their images, you can see that they look like people that could pass off as high schoolers in a Hollywood-type movie.

And yeah, that's a workforce.

Conclusion

If you're interested in building a startup related to this idea, then the idea is yours. And if you would like to use Chatforce for yourself,

I had the website up a moment ago. It looks like it closed. But feel free to visit chatforceai.com.

You can sign up for a wait list, but also we're running a pilot program. So if you're interested in signing up and using Chatforce to build agentic products of your own, feel free to chat during the networking portion of this event.

Thanks.

Finished reading?