WEBVTT

00:00.160 --> 00:03.880
And a very warm welcome to day two of week three.

00:03.920 --> 00:11.360
Our second day playing with crew, this time continuing doing some building and exploring the crew framework.

00:11.760 --> 00:15.440
To quickly recap what we did last time we learned about an agent.

00:15.480 --> 00:18.040
The agent being the smallest autonomous unit.

00:18.080 --> 00:20.040
It has an LM associated with it.

00:20.080 --> 00:21.120
It doesn't actually need to.

00:21.160 --> 00:23.720
You can have an agent with that name, but they typically do.

00:23.880 --> 00:25.840
It has a role, a goal, a backstory.

00:25.840 --> 00:28.800
And it also has memory and tools.

00:28.840 --> 00:30.960
Not that we've looked at either of them just yet.

00:31.560 --> 00:33.320
And then a task.

00:33.520 --> 00:37.600
This is the concept which doesn't have an analog in OpenAI agents SDK.

00:37.880 --> 00:44.440
A task is an assignment to be carried out with a description, expected output, perhaps an output file.

00:44.720 --> 00:47.120
And it's assigned to an agent.

00:47.320 --> 00:53.320
And then a crew, which is a team of agents and tasks together assigned to those agents.

00:53.320 --> 01:00.080
And they can run sequentially or hierarchically, in which case you'd have to assign a manager LM to

01:00.200 --> 01:03.480
figure out which task is assigned to which agent.

01:04.360 --> 01:09.360
So that's the overall structure of crew, which now should be pretty familiar to you.

01:09.360 --> 01:15.520
And you'll remember that there are five steps that we went through when we set up our first crew project.

01:15.520 --> 01:17.160
First of all, we created a project.

01:17.160 --> 01:23.320
We did create Create Crew, my project, or we did debate, but it could be whatever we want and it

01:23.320 --> 01:26.960
will set up that whole file system structure for us.

01:27.280 --> 01:31.200
We then go into source and then the name of the project and then config.

01:31.200 --> 01:35.360
And that is where we find the YAML files, which we can call them whatever we want.

01:35.360 --> 01:39.840
But by by by default there are two there one for the agents, one for the tasks.

01:39.840 --> 01:42.040
And we fill them in with the details.

01:42.320 --> 01:51.760
We then go to the crew.py module in our source project folder, and we create the agents, the tasks

01:51.760 --> 01:57.240
and the crew using the functions that are already set up there for us and using the decorators.

01:57.240 --> 02:03.890
And we reference the YAML config, although we don't need to, we could actually manually create a pass

02:03.890 --> 02:06.170
in those fields when we create each of those objects.

02:06.170 --> 02:12.570
But the config file makes that easy for us and keeps some of this prompting text separate from our code,

02:12.570 --> 02:14.490
which is a nice separation.

02:15.130 --> 02:24.010
Then fourth, we update the Main.py module to set the config to set up the run parameters that we did

02:24.210 --> 02:25.810
when we specify the inputs.

02:25.850 --> 02:33.010
The fact in our case that the topic of debate the motion was, as it happens, about AI regulation,

02:33.010 --> 02:36.890
and then we can run and the way we run is we type crew.

02:36.930 --> 02:44.490
I run from within the project folder, which behind the scenes does a run, and then it's off to the

02:44.490 --> 02:46.330
races with our crew framework.

02:47.290 --> 02:47.730
Okay.

02:47.730 --> 02:49.970
So we're going to go a little bit deeper in two ways.

02:49.970 --> 02:52.210
And we're going to set up another project today.

02:52.250 --> 02:57.890
And one of those ways is with tools, something that we're very familiar with already equipping agents

02:57.890 --> 02:58.850
with capabilities.

02:58.850 --> 03:04.530
We will see how to do that crew AI style And then the other one is about context.

03:04.530 --> 03:10.170
And this is how you tell crew what information is to be passed from one task to another.

03:10.170 --> 03:15.170
So these are the two extra details we're going to get into today when we build our second crew.

03:15.490 --> 03:17.650
And let's go and do that right now.

03:18.330 --> 03:23.370
So just before we go into crew, there's another of these APIs that I need you to sign up for, but

03:23.370 --> 03:25.650
you'll be pleased to hear it's another free one.

03:25.650 --> 03:29.970
And this is going to be quite a contrast with our experience with OpenAI agents SDK.

03:30.130 --> 03:38.770
We're going to use something called Serpa, which is a fast way to run Google queries from code.

03:38.810 --> 03:46.170
It's an API to run lightning fast Google search at an unbeatable price, and indeed it is unbeatable.

03:46.370 --> 03:52.370
So you go to Serpa Dev and you sign up by pressing that button there, and I've already done so and

03:52.370 --> 03:54.850
so I can sign in with my account.

03:54.850 --> 03:56.530
And here I am.

03:56.850 --> 04:03.460
And the thing is that you get 2500 free credits, which is more than enough for this course, and this

04:03.460 --> 04:08.300
will allow us to do plenty of searches quite happily indeed.

04:08.500 --> 04:11.020
And you will go to API key, which I won't do.

04:11.020 --> 04:16.980
Now you'll get my API key, but you go there to create your API key and as usual, copy it into your

04:16.980 --> 04:21.460
clipboard because that is something that you will need for your env file.

04:21.740 --> 04:28.780
And in your env file, you should have entered that in as Serpa underscore API underscore key cursor

04:28.780 --> 04:31.260
will actually prompt you for that if you start typing it.

04:31.580 --> 04:33.180
Serpa API key.

04:33.620 --> 04:36.140
And if you're interested Serp where that comes from.

04:36.140 --> 04:41.860
Serp stands for Search Engine results page, which is the common name for these kinds of services.

04:41.860 --> 04:44.500
And there is another one that's called something similar to Serpa.

04:44.500 --> 04:47.420
So be sure that you use Serpa API key.

04:47.620 --> 04:51.180
Not I think there's one called Serp API or something which is different.

04:51.180 --> 04:54.060
So be sure to have the right key there.

04:54.340 --> 04:58.260
Okay, so with that we are we are still in the debate folder.

04:58.260 --> 04:59.460
We will close that.

04:59.500 --> 05:07.620
Here we are in our crew folder in cursor for week three, and we are going to go into bringing up a

05:07.620 --> 05:08.820
new terminal.

05:08.860 --> 05:10.180
It's still got what we had before.

05:10.220 --> 05:12.260
Let's let's clear this let's exit that.

05:12.420 --> 05:14.620
Let's start a fresh terminal.

05:14.700 --> 05:15.660
Here it is.

05:15.780 --> 05:19.620
We're going to go into the third folder crew.

05:19.860 --> 05:23.380
And it's time for us again to create a new project.

05:23.420 --> 05:25.260
Do you remember how to create a crew project?

05:25.540 --> 05:26.620
Well here you do it.

05:26.660 --> 05:27.380
It's crew.

05:27.380 --> 05:33.020
I create crew again, as opposed to a flow, which is different.

05:33.260 --> 05:39.700
And then we're going to make one that's called financial researcher, somewhat inspired by the default

05:39.700 --> 05:40.940
one that's already there.

05:40.980 --> 05:43.460
Let's have a financial researcher.

05:43.620 --> 05:45.860
Let's create that right now.

05:47.060 --> 05:52.460
So we as before, we just choose OpenAI and GPT four or many.

05:52.500 --> 05:54.300
And we skip setting up the key.

05:54.300 --> 06:01.540
And it has created the financial Researcher project and a bunch of scaffolding for us, which is great.

06:01.540 --> 06:03.820
And this is where we will get started.
