WEBVTT

00:00.280 --> 00:02.720
Well, this is a bittersweet moment for sure.

00:02.760 --> 00:05.720
It is the final day of our journey with crew.

00:06.000 --> 00:07.720
Fifth day of week three.

00:07.760 --> 00:12.440
While we complete the work we've got with crew, and it's going to be a great one.

00:12.880 --> 00:14.000
We're going to end on a high.

00:14.040 --> 00:17.440
We are going to build on the project we did last time.

00:17.480 --> 00:21.880
On day four, we're going to turn our coda into an engineering team.

00:21.920 --> 00:28.120
We're going to have an engineering lead depicted here by this person chilling out because, you know,

00:28.160 --> 00:29.640
that's what what leads do.

00:29.880 --> 00:32.280
Uh, we're going to have a back end engineer.

00:32.280 --> 00:38.840
We're going to have a front end engineer, and we're going to have a test engineer seen here as someone

00:38.840 --> 00:44.600
that's jumping on top, trying to trying to destroy, trying to break everything that they are given.

00:44.920 --> 00:46.440
So this is going to be our team.

00:46.440 --> 00:48.840
We're going to really use the crew and crew.

00:48.880 --> 00:51.400
I let's get to it.

00:51.640 --> 00:53.200
And welcome back to cursor.

00:53.240 --> 00:56.560
Welcome to our final project for crew.

00:57.000 --> 01:01.080
Let's bring up a terminal with control and the back tick.

01:01.360 --> 01:04.080
Let's go into that third directory.

01:04.080 --> 01:06.880
And now, of course, it is time to do crew.

01:06.920 --> 01:11.000
I create crew and it is engineering.

01:11.160 --> 01:14.760
Underscore team is the name of our project.

01:15.200 --> 01:15.880
Let's do it.

01:15.880 --> 01:17.880
Let's choose the options that it tells us.

01:17.880 --> 01:18.920
We want OpenAI.

01:19.320 --> 01:20.800
We want GPT four or mini.

01:20.800 --> 01:23.560
And then we skip making a token.

01:23.560 --> 01:26.720
And then there we have our directory structure.

01:26.920 --> 01:29.880
And now of course we go into engineering team.

01:29.920 --> 01:35.800
We go into source, we go into config and we open our agents YAML file.

01:35.800 --> 01:41.280
As usual we see the boilerplate ones there the researcher and the reporting analyst.

01:41.880 --> 01:43.960
So what are we going to do.

01:43.960 --> 01:46.840
Well we're going to first of all delete what we have here.

01:47.000 --> 01:49.200
And we're going to put in our first agent.

01:49.360 --> 01:54.520
And our first agent is going to be an engineering lead, the engineering lead for the engineering team

01:55.040 --> 01:57.640
directing the work of the engineers.

01:57.680 --> 02:05.480
Let's make that plural, take the high level requirements described here and prepare a detailed design

02:05.480 --> 02:06.920
for the back end developer.

02:06.960 --> 02:08.520
Maybe we'll leave this singular for now.

02:08.560 --> 02:12.600
If it's just one developer, everything should be in one Python module.

02:12.600 --> 02:15.640
Describe the function the method signatures in the module.

02:15.680 --> 02:21.000
The Python module must be completely self-contained and ready so that it can be tested or have a simple

02:21.000 --> 02:22.160
UI built.

02:22.280 --> 02:23.480
Here are the requirements.

02:23.480 --> 02:27.800
So this is going to be one of our input attributes that we can pass in.

02:28.200 --> 02:30.680
The module should be named module name.

02:30.680 --> 02:33.320
And the class should be named class name.

02:33.320 --> 02:36.400
So we are going to bring in those as well.

02:36.400 --> 02:38.720
So we're going to have this be a little bit configurable.

02:39.080 --> 02:43.920
And the backstory you're a seasoned engineering lead with a knack for writing clear and concise designs

02:43.960 --> 02:44.920
okay there we go.

02:44.920 --> 02:50.000
So so look, I'm going to put on an LM now and let's have something different to usual.

02:50.000 --> 02:51.680
I think we're going to go with Gpt4.

02:51.720 --> 02:53.440
We're going to have the big guy you.

02:53.480 --> 02:56.720
I've also run this with Gpt4 on many and it runs just fine.

02:56.720 --> 02:58.280
So you can do that too if you wish.

02:58.480 --> 03:03.560
And you get, you know, you get a bit more comprehensive, extensive solutions if you use its bigger

03:03.560 --> 03:04.840
cousin GPT four.

03:04.880 --> 03:06.280
Oh okay.

03:06.600 --> 03:06.960
so.

03:07.000 --> 03:12.520
And whilst that will work, of course the full way to do it is to show this is OpenAI slash like that

03:12.520 --> 03:13.440
with the provider.

03:14.240 --> 03:16.920
That is the first of our agents.

03:17.600 --> 03:17.960
Okay.

03:18.000 --> 03:22.120
So the next agent is going to be called a backend engineer.

03:22.280 --> 03:29.960
So the backend engineer is going to be a Python engineer who can write code to achieve the design described

03:29.960 --> 03:31.200
by the engineering lead.

03:31.200 --> 03:36.160
So the engineering lead will do the design will lay out the sort of foundations, and the back end engineer

03:36.160 --> 03:42.480
will do the coding write Python module that implements the design described by the engineering lead,

03:42.480 --> 03:44.560
but will also pass in the requirements again.

03:44.560 --> 03:49.480
So it's going to get the requirements along with the design and the module name and class name again.

03:49.720 --> 03:56.000
And it's given a decent backstory saying that it's a Python engineer with a knack for writing clean,

03:56.040 --> 03:57.480
efficient code.

03:57.880 --> 04:00.000
Follow the design instructions carefully.

04:00.400 --> 04:01.760
So again, we'll use a different model.

04:01.760 --> 04:06.480
We'll mix things up, and this time I suggest we use Claude 3.7 sonnet latest.

04:06.520 --> 04:10.240
Now sometimes we get an overload error from Claude?

04:10.280 --> 04:11.080
At least I do.

04:11.120 --> 04:11.880
As of now.

04:12.040 --> 04:17.200
So it's a little bit less stable, but nonetheless, it's a great coding model.

04:17.240 --> 04:18.400
Particularly so.

04:18.400 --> 04:21.160
I think it's a good one to use in this case.

04:21.600 --> 04:22.080
All right.

04:22.080 --> 04:24.880
Let's also add a front end engineer.

04:25.360 --> 04:26.600
And I say front end engineer.

04:26.600 --> 04:32.560
But it's going to be a gradio engineer a gradio expert who can write a simple front end to demonstrate

04:32.560 --> 04:39.360
a back end writer gradio UI that demonstrates the given back end all in one file to be in the same directory

04:39.680 --> 04:43.440
as the back end module, giving the requirements.

04:43.480 --> 04:45.040
Giving the back story.

04:45.200 --> 04:50.520
A seasoned engineer highly skilled at writing simple gradio UIs for a back end class.

04:51.000 --> 04:52.400
So there we have it.

04:53.280 --> 05:00.360
We, uh, explained that the UI needs to be in one module, and we'll use again Claude for this too.

05:00.960 --> 05:01.320
Okay.

05:01.360 --> 05:02.320
And one more agent.

05:02.360 --> 05:08.320
Our final agent is going to be a test engineer, but I'm slightly abusing the word there.

05:08.320 --> 05:08.600
It's not.

05:08.600 --> 05:10.000
It's not like a QA engineer.

05:10.000 --> 05:16.360
This is going to be a Python coder who knows how to write unit tests for a given backend module, because

05:16.360 --> 05:20.000
I want to see unit tests being built out here.

05:20.200 --> 05:22.000
So that's what the test engineer is going to do.

05:22.040 --> 05:26.800
They're going to create a test which is going to be called test underscore.

05:26.800 --> 05:30.800
And the name of the module which will be the backend module.

05:30.960 --> 05:35.720
And they're a seasoned QA engineer and software developer who writes great unit tests for Python.

05:35.720 --> 05:38.000
Code is the backstory.

05:38.160 --> 05:42.600
And you know, for for all of the coding part, we'll use anthropic.

05:42.840 --> 05:43.880
Maybe we should shake it up.

05:43.880 --> 05:44.320
Why don't we?

05:44.360 --> 05:45.760
Why don't we take a risk?

05:45.760 --> 05:47.480
We'll use deep seek instead.

05:47.520 --> 05:48.240
Deep seek.

05:48.480 --> 05:54.600
I'm just going to stick with deep seek chat because deep seek chat is has is also able to write terrific

05:54.600 --> 05:55.440
code as well.

05:55.440 --> 05:59.680
So we'll we'll stick with that model and that will be our test engineer.

05:59.720 --> 06:01.640
Now it's time for us to go on to the tasks.

06:02.440 --> 06:03.680
So look it's a bit repetitive.

06:03.720 --> 06:05.200
We're going to let me get rid of the gunk.

06:05.240 --> 06:08.200
We're going to have a task for each agent.

06:08.200 --> 06:08.680
And it's funny.

06:08.680 --> 06:14.720
This is one of those times when it feels like OpenAI's agents SDK is sort of more straightforward that

06:14.720 --> 06:20.480
they don't have this extra indirection, this idea of a task being a separate first class object, because

06:20.480 --> 06:24.840
there's a lot of times that you will have this 1 to 1 mapping between a task and an agent.

06:24.880 --> 06:29.240
Obviously, crew has built this up because they really want you to think in terms of situations where

06:29.240 --> 06:33.280
you will have series of tasks that will be given to the same agent.

06:33.280 --> 06:35.720
And we did see that and at least one of our examples.

06:35.720 --> 06:41.120
But in this case, we are again going to have the case that there's going to be a task for each of our

06:41.120 --> 06:45.640
agents, and it gives us an opportunity to spell out very clearly what's required.

06:46.360 --> 06:54.120
So the description of the task is to take the high level requirements described and prepare a detailed

06:54.120 --> 06:55.440
design for the engineer.

06:55.440 --> 07:00.520
This is the design task that, of course, is going to be assigned to our engineering lead.

07:00.840 --> 07:03.800
And the output is a detailed design for the engineer.

07:04.320 --> 07:09.280
You'll notice that I make it important that it should only output the design in markdown format.

07:09.320 --> 07:14.120
Otherwise it just wants to start writing the code, which is not exactly what we want.

07:14.360 --> 07:19.440
And here we specify the the output as the module name underscore design.

07:19.440 --> 07:25.440
And it's worth noting that you can have these templated tags in the output file name as well.

07:25.440 --> 07:31.480
You can have it anywhere in this YAML, and it will get substituted in for the actual name of the the

07:31.640 --> 07:33.120
module that we're building here.

07:33.960 --> 07:36.480
So that is the design task.

07:36.520 --> 07:39.120
My next one cursor wants it to be called coding task.

07:39.120 --> 07:41.760
But when I wrote it I wrote code task.

07:41.800 --> 07:42.320
There we go.

07:42.600 --> 07:44.280
Uh, I'd like to be unpredictable.

07:44.520 --> 07:51.280
Uh, so the description is write a Python module that implements the design as described by the engineering

07:51.280 --> 07:53.560
lead in order to achieve the requirements.

07:53.800 --> 07:59.920
And then here I'm saying important output only the Python code without any markdown formatting or code

07:59.960 --> 08:02.080
block delimiters or backticks.

08:02.280 --> 08:05.560
And that's important because these models love to output markdown.

08:05.560 --> 08:09.680
And if you don't put that note in there, it's going to put that tick, tick, tick python at the top

08:09.680 --> 08:12.320
of the file, which means it won't be a valid Python file.

08:12.440 --> 08:14.080
And it just loves doing that.

08:14.080 --> 08:17.240
So unless you really highlight this is important, it's going to do it.

08:17.600 --> 08:19.400
And so that is the task.

08:19.400 --> 08:25.120
And we're saying context design task, which you remember is going to make sure that that information

08:25.120 --> 08:27.000
is made available to it.

08:27.320 --> 08:32.360
And generally speaking you can think of the tasks as being the user prompts and the agents as defining

08:32.360 --> 08:35.520
the system prompts, and that that's kind of how it all comes together.

08:35.520 --> 08:40.400
And this context is showing us what kind of information is going to be included in that prompt from

08:40.440 --> 08:41.040
others.

08:41.720 --> 08:42.200
Okay.

08:42.240 --> 08:44.560
So that is the code task.

08:44.560 --> 08:47.080
How about the front end task.

08:47.480 --> 08:49.560
So this is where the plot thickens.

08:50.000 --> 08:58.360
The front end has got to write a Gradio UI in a module App.py that demonstrates the given back end class.

08:58.400 --> 09:03.280
Assume there's only one user and keep the UI very simple indeed.

09:03.320 --> 09:05.000
Just a prototype or demo.

09:05.160 --> 09:06.520
Here are the requirements.

09:06.680 --> 09:08.720
And so yeah, we keep it.

09:08.760 --> 09:10.200
Keep it nice and simple.

09:10.840 --> 09:12.800
Maybe I'm going to take out the very simple indeed.

09:12.800 --> 09:16.280
Let's just say keep the UI simple and keep the UI clean.

09:17.040 --> 09:18.080
Let's leave it at that.

09:18.960 --> 09:21.120
So, um, important.

09:21.120 --> 09:23.400
Only output the raw Python code again.

09:23.440 --> 09:26.720
The agent is the front end engineer agent, obviously.

09:26.920 --> 09:32.720
And of course, for its context, it needs to get the output from the code task because it's going to

09:32.760 --> 09:38.240
write a user interface, which is going to directly use what the code task has written.

09:38.360 --> 09:43.440
So that's going to be very interesting to see how how it's able to keep that context so well that it's

09:43.480 --> 09:44.840
actually able to do this.

09:45.200 --> 09:51.680
And then cursor is correct that the last one is indeed called test task, but it's got a little bit

09:51.680 --> 09:53.680
more detail than cursor was suggesting.

09:53.880 --> 09:58.560
Write unit tests for the given back end module and create a test in the same directory.

09:58.880 --> 10:00.400
And this is.

10:00.440 --> 10:07.080
Got more information one more time about outputting raw Python without clever tags.

10:07.120 --> 10:09.640
And of course it also depends on the code task.

10:09.680 --> 10:12.960
The unit tests are not going to test the user interface, it's going to test the code.

10:13.200 --> 10:15.280
And that will be the output file.

10:15.280 --> 10:20.800
And that is it for our tasks our 1 to 1 again between the task and the agent.
