WEBVTT

00:00.200 --> 00:02.240
And welcome back to cursor.

00:02.240 --> 00:07.440
And here we are in week three the crew folder.

00:07.480 --> 00:08.280
How exciting.

00:08.320 --> 00:11.560
Let's open it up to see what treasures I have in store for you.

00:11.920 --> 00:13.760
And it's completely empty.

00:13.800 --> 00:15.640
It won't be empty for you, but it's empty for me.

00:15.640 --> 00:19.040
Because this is starting from nothing.

00:19.080 --> 00:20.680
The way that some of you like me to do it.

00:20.680 --> 00:22.320
Which is, uh, gonna happen this time.

00:22.320 --> 00:23.800
Because that's the way that crew works.

00:24.080 --> 00:31.200
So we will begin then by opening up a command line like this, a terminal in crew, which you'll remember

00:31.200 --> 00:33.520
is control and the tick on a mac.

00:33.560 --> 00:36.200
That is really the control button on the bottom left.

00:36.600 --> 00:41.880
And, uh, then, uh, or it's the view menu and terminal if you're using menus.

00:42.120 --> 00:47.960
So then what I'm going to do is I'm going to first change directory to go into the third directory.

00:47.960 --> 00:56.720
Right now we are in crew and I'm going to create a new crew project, which I do by saying crew I create

00:56.960 --> 00:57.640
crew.

00:58.080 --> 00:59.840
And then the name of the project.

00:59.840 --> 01:06.620
And we are going to call this project debate For reasons that will become obvious, but probably already

01:06.660 --> 01:12.580
are, and it first asks us a question, and to read the question, I'll have to make this a bit larger.

01:12.980 --> 01:18.500
Um, and this is because when you first create a project, it puts in place, as I mentioned, some

01:18.500 --> 01:21.900
scaffolding, some sort of basic project framework.

01:21.940 --> 01:25.980
And in order to set that up, it wants to know which model would you like me to start with.

01:26.020 --> 01:31.700
So we're not necessarily fixing this, but we can start by saying open AI and we can always change it

01:31.700 --> 01:32.340
later.

01:32.860 --> 01:38.500
Select a model to use and we can choose GPT four or mini to keep it nice and cheap.

01:38.900 --> 01:40.460
And then enter your key.

01:40.500 --> 01:45.580
Now at this point we should definitely just press enter because we already have a dot env file.

01:45.580 --> 01:48.180
It's trying to build env files for us.

01:48.180 --> 01:49.140
We don't need that.

01:49.420 --> 01:54.380
We press enter and you'll see right here that it's created a bunch of files.

01:54.660 --> 01:59.660
And I'm going to remove the terminal for a second so that we can take a look at it, because they have

01:59.660 --> 02:02.180
appeared over on the left.

02:02.700 --> 02:08.560
Now one thing to get in mind is that when when you're looking at the explorer in cursor or in VSCode,

02:08.800 --> 02:14.520
if there's a directory like crew that only has one other directory called debate, then it shows like

02:14.520 --> 02:14.720
this.

02:14.720 --> 02:18.720
It doesn't bother showing multiple files, multiple folders under it.

02:18.720 --> 02:20.080
And that can be a little bit confusing.

02:20.080 --> 02:24.080
So we might go back into the terminal and just make a new directory.

02:24.080 --> 02:26.720
Let's let's make a directory and call it other.

02:27.360 --> 02:30.560
And when I do that you see what just happened.

02:30.840 --> 02:35.320
Now if we come in here, you'll see that there's both debate and there's an empty folder called other,

02:35.320 --> 02:37.840
which is going to make it a little bit easier on the eyes.

02:38.400 --> 02:38.920
Okay.

02:39.360 --> 02:44.080
So now let's have a quick look at what has crew created for us.

02:44.400 --> 02:50.320
So under debate, which is the name of our crew that we're about to make a debate crew, as you've probably

02:50.320 --> 02:57.320
guessed, there is a folder called knowledge and that has a file user preference, and that has some

02:57.320 --> 02:59.800
stuff about the person who's the the user.

02:59.800 --> 03:00.960
And you can change this.

03:00.960 --> 03:05.200
This would be background information that would be given to the model if we made it use of it, which

03:05.200 --> 03:05.960
we will not.

03:06.000 --> 03:11.780
So this is a sort of an example of some of the scaffolding that's created in case we need to use it.

03:12.340 --> 03:15.020
Then there is a folder called debate.

03:15.300 --> 03:15.500
Sorry.

03:15.500 --> 03:17.220
There's a folder called source.

03:17.220 --> 03:20.340
And under that folder there is a single folder called debate.

03:20.340 --> 03:25.300
And again you're seeing it in this way in the explorer because there are no other folders other than

03:25.340 --> 03:26.940
debate under source.

03:27.220 --> 03:33.300
So sorry to recap, under crew we have a folder called debate, which is the name of of the project

03:33.700 --> 03:40.100
that has a sub folder subdirectory source SLC and that has a subdirectory also with the project's name

03:40.140 --> 03:40.820
debate.

03:41.260 --> 03:42.980
And that is where we are right now.

03:43.180 --> 03:46.060
And this is the this is the most important directory of them all.

03:46.100 --> 03:49.940
This this directory named the project underneath source.

03:49.980 --> 03:52.020
And that has a few things in it.

03:52.060 --> 03:54.460
It has a config directory.

03:54.460 --> 03:59.620
The config directory has two YAML files agents and tasks.

03:59.740 --> 04:00.500
And here they are.

04:00.540 --> 04:05.540
And they're set up with some default example code in there that we will come back and look at in just

04:05.540 --> 04:06.260
a second.

04:07.260 --> 04:13.160
There is a tools folder that has just, again, some scaffolding, some some, some basic stuff here

04:13.160 --> 04:15.720
that we might want to fill in later that we won't do this time.

04:16.280 --> 04:23.480
And then if we come into the root folder of debate, you'll see that there is a file, a module called

04:23.480 --> 04:29.160
crew dot Pi which has a bunch of scaffolding again, and then a main dot pi.

04:29.680 --> 04:35.160
So there we have it crew, the module, which is actually the one which brings together our crew, and

04:35.160 --> 04:38.400
it has the decorators that I mentioned to you, main.

04:38.560 --> 04:45.080
And then the two YAML files under config that has all been set up for us, ready for us to build our

04:45.080 --> 04:46.080
first crew.

04:46.760 --> 04:47.440
All right.

04:47.440 --> 04:54.320
So we are now going to go and define our YAML, our configuration for our agents and our tasks, starting

04:54.320 --> 04:57.600
over here with the agents YAML file.

04:58.000 --> 05:01.960
And this contains some default some sort of scaffolding.

05:01.960 --> 05:08.360
Some example agents that are called the researcher and the reporting analyst are the two examples that's

05:08.360 --> 05:08.840
given.

05:08.840 --> 05:11.620
And we're going to change these to being what we're looking to build.

05:11.620 --> 05:14.220
And of course, we're looking to build a debate team.

05:14.420 --> 05:17.300
And in fact, we only need two agents for what we're looking to do.

05:17.300 --> 05:19.220
We want an agent that will be the debater.

05:19.460 --> 05:24.340
Our one agent is going to play both roles of being for and against the the motion.

05:24.660 --> 05:28.380
And then we will have a judge and those will be our, our two agents.

05:28.380 --> 05:30.260
And now we need to describe what they are.

05:30.460 --> 05:33.420
And so the, the role is the first thing that we say here.

05:33.420 --> 05:37.460
And we're going to say a compelling debater right there.

05:37.660 --> 05:37.980
Okay.

05:38.020 --> 05:43.380
And now the goal is what what it's it's looking to achieve the objectives.

05:43.580 --> 05:49.540
And so let's see I'm going to actually copy across one that I did earlier.

05:49.540 --> 05:51.260
So you don't have to watch me typing everything.

05:51.260 --> 05:56.020
But we're going to present a clear argument either in favor of or against the motion.

05:56.020 --> 06:02.100
And the motion is and this is important, this little thing in in curly braces.

06:02.100 --> 06:05.780
Here is where you can effectively make this a template.

06:05.780 --> 06:10.820
That is something that's going to get defined when you run this agent framework.

06:10.820 --> 06:17.240
When we end up saying, Q I run, we are going to specify what we want motion to be, and we're actually

06:17.240 --> 06:19.640
going to specify that in Main.py.

06:19.880 --> 06:21.120
So keep that in mind.

06:21.120 --> 06:25.600
In Main.py we're going to have to set what is motion, the motion of the debate.

06:25.640 --> 06:28.840
The thing that we're putting forward the proposal that they will debate.

06:29.080 --> 06:29.560
Okay.

06:29.600 --> 06:37.440
And so now we have a back story, which is where we set the the it's really we know that this is the

06:37.440 --> 06:39.520
system prompt or a big part of it.

06:39.520 --> 06:46.040
But in crew land, we want to think of this as the, as the sort of framing of this, of this agent,

06:46.040 --> 06:46.960
the back story.

06:47.160 --> 06:52.320
You're an experienced debater with a knack for giving concise but convincing arguments.

06:52.320 --> 06:54.000
The motion is so on.

06:54.480 --> 06:58.080
So that is the definition of our agent, our debater agent.

06:58.080 --> 07:02.800
And that will apply both for one that is presenting for an argument and against it.

07:02.800 --> 07:06.400
And of course we'll be using tasks to distinguish between them.

07:06.960 --> 07:09.320
But now let's define our judge.

07:09.520 --> 07:12.520
So we are going to give the judge a role.

07:12.520 --> 07:17.060
And the role we will say is decide the winner of the debate.

07:17.060 --> 07:19.420
Look at how cursor even suggests what this should be.

07:19.660 --> 07:24.580
Let's say based on the arguments presented, let's keep it short.

07:25.420 --> 07:30.740
And then the goal I will take one that I wrote earlier because it's a couple of sentences.

07:30.740 --> 07:34.740
You can see that that amazingly cursor comes up with natural language.

07:34.780 --> 07:36.460
It's just great for these things already.

07:36.460 --> 07:40.900
So you can even define your agents just by letting cursor describe them.

07:41.180 --> 07:47.220
And the back story here I'm going to copy and paste in a nice juicy back story.

07:47.500 --> 07:48.660
And here it is.

07:48.820 --> 07:54.940
You're a fair judge with a reputation for weighing up arguments without factoring in your own views

07:54.980 --> 07:58.100
and making a decision based purely on the merits of the argument.

07:58.100 --> 07:59.220
The motion is blah.

07:59.420 --> 08:03.220
So that's the sort of good way to set things like the backstory.

08:03.380 --> 08:09.340
And again, on the one hand, one way of thinking about this is that this is the kind of backstory that

08:09.340 --> 08:14.180
an LLM is going to take into account in setting the context for this role.

08:14.580 --> 08:21.320
The other, more scientific way is just to always keep in mind that what Llms are doing is predicting

08:21.320 --> 08:24.760
the most likely next token to follow an input.

08:25.000 --> 08:31.440
And the point is that if this backstory is part of the input, then you are increasing the probability

08:31.440 --> 08:37.080
that the output tokens will be consistent with this, because things that are seen at training time

08:37.080 --> 08:43.880
that have that kind of backstory often predict tokens consistent with that backstory.

08:43.880 --> 08:48.760
So that's the the more scientific way of thinking about why this tends to work really well.

08:49.040 --> 08:49.680
All right.

08:49.840 --> 08:55.800
And then the final thing I'm going to add in here is you can also specify what model to use.

08:55.840 --> 08:58.600
And you can actually you can just have GPT four or mini.

08:58.640 --> 09:06.720
Or if you want to really spell it out then you say OpenAI GPT four mini, but it assumes OpenAI by default

09:06.720 --> 09:07.760
for that model.

09:07.800 --> 09:08.560
What am I doing here?

09:08.640 --> 09:09.600
Model colon.

09:09.800 --> 09:10.280
There we go.

09:10.320 --> 09:11.920
Luckily, cursor to the rescue.

09:12.440 --> 09:18.040
And this then is our YAML definition of the agents.

09:18.280 --> 09:19.680
Next up is tasks.
