WEBVTT

00:00.720 --> 00:01.080
Okay.

00:01.200 --> 00:01.720
Okay.

00:01.760 --> 00:05.760
It's time for us to go to the crew module as well, you know?

00:05.800 --> 00:07.400
You know that that's the next step.

00:07.400 --> 00:10.560
And of course, you also know that I like to get rid of all of the gunk.

00:11.080 --> 00:18.120
No more gunk for us, but we'll keep in, of course, the hooking up to the YAML files.

00:18.160 --> 00:25.400
Let's get rid of everything else from here, and we will do our work to define the agents.

00:25.680 --> 00:29.800
So agents, the first agent is called the engineering lead.

00:29.960 --> 00:36.600
And good old cursor is giving us some good suggestions here, but not perfect because we don't need

00:36.600 --> 00:39.200
the engineering lead to be able to execute code.

00:39.200 --> 00:42.960
That's not its idea, it's just meant to be designing stuff.

00:43.520 --> 00:44.360
All right.

00:44.600 --> 00:46.880
But now the back end engineer.

00:47.120 --> 00:49.080
So thank you cursor for that.

00:49.080 --> 00:52.360
But you have missed this time what we really need here.

00:52.360 --> 00:57.560
So we do indeed want it to be able to have code execution.

00:57.560 --> 01:01.160
We want the code execution to be safe in a Docker container.

01:01.420 --> 01:02.300
Absolutely.

01:02.860 --> 01:05.260
The, uh, max execution time.

01:05.820 --> 01:07.020
We probably want to give it a bit more.

01:07.020 --> 01:08.380
Well, not not that long.

01:08.380 --> 01:09.500
That's rather too long.

01:09.700 --> 01:11.780
Let's give it a few minutes to work on this.

01:11.780 --> 01:12.500
Why not?

01:12.820 --> 01:14.300
And then Max retries.

01:14.300 --> 01:17.420
We'll give it five times before we are upset.

01:17.740 --> 01:19.460
That seems pretty good.

01:19.940 --> 01:20.540
Okay.

01:20.820 --> 01:22.580
The front end engineer.

01:22.620 --> 01:23.100
Oops.

01:23.140 --> 01:24.780
Need to remember my decorator.

01:25.340 --> 01:27.020
The the front end engineer.

01:27.060 --> 01:28.020
Let's have a look.

01:28.020 --> 01:30.060
So actually we're going to have it right front end.

01:30.060 --> 01:34.780
But we're not going to have it try and execute because that would bring up a gradio UI in the Docker

01:34.780 --> 01:35.180
container.

01:35.220 --> 01:37.660
That'd be a whole different, different ball game.

01:37.660 --> 01:39.100
So we're not going to do that.

01:39.100 --> 01:41.860
But we are going to have it do its creation.

01:42.380 --> 01:44.820
And now we just have the test engineer.

01:45.540 --> 01:47.780
So thank you cursor.

01:48.020 --> 01:51.660
And that seems like a good enough start.

01:51.660 --> 01:58.140
But the test engineer we absolutely want the test engineer to not only write the unit tests but then

01:58.140 --> 01:59.580
to run the unit tests.

01:59.860 --> 02:00.940
But it probably doesn't need.

02:00.980 --> 02:05.350
Well we'll give it we'll give it a couple of minutes to do that, and we'll give it five retries as

02:05.350 --> 02:05.830
well.

02:06.110 --> 02:07.910
That seems fine.

02:08.110 --> 02:10.230
Okay, those are our agents.

02:10.270 --> 02:12.950
Next, it's time for us to define our tasks.

02:13.750 --> 02:16.470
And this is going to start to get very complicated.

02:16.790 --> 02:20.830
The design task is just going to look like that.

02:20.950 --> 02:22.950
And I bet curse is going to know everything else.

02:22.950 --> 02:25.270
That's all we want for the code task now.

02:26.070 --> 02:28.590
And, uh, let's see if it can help us more.

02:28.630 --> 02:31.750
That's probably great for the front end task.

02:32.190 --> 02:34.670
And, uh, the test task.

02:34.670 --> 02:35.830
Is it going to help us with that?

02:35.870 --> 02:36.510
Yes it is.

02:36.510 --> 02:39.270
It's got a strangely indented, but no, it's brought it back.

02:39.270 --> 02:40.110
That's nice.

02:40.430 --> 02:42.990
And I think that's it for our tasks.

02:42.990 --> 02:44.750
I don't think there's anything missing here.

02:45.030 --> 02:45.750
Perfect.

02:45.750 --> 02:46.190
All right.

02:46.190 --> 02:46.990
Thank you.

02:47.030 --> 02:47.590
Cursor.

02:47.630 --> 02:49.830
Those are indeed our tasks.

02:50.110 --> 02:51.150
It's time though.

02:51.190 --> 02:52.470
It's time for our crew.

02:52.510 --> 02:54.550
Let's see if, uh, cursor can do this.

02:54.590 --> 02:56.190
Oh, no no, no, that's all.

02:56.230 --> 02:57.870
All a disaster.

02:57.910 --> 03:04.930
This is, uh, a moment to, uh, definitely mention that you do have to be mindful of this.

03:04.970 --> 03:06.170
The whole vibe coding thing.

03:06.170 --> 03:12.170
As I said before, it is common for Llms to generate too much code and to to just put stuff in there.

03:12.170 --> 03:17.970
And often people send me problems they've got and I can see that they've used an LLM to generate lots

03:17.970 --> 03:21.930
of code, because it will tend to err on the side of more.

03:22.130 --> 03:25.770
Of course, in this situation, we don't need to list out all of the agents like this.

03:25.810 --> 03:29.210
We can just say the agents are self dot agents.

03:29.210 --> 03:31.330
That's the why we decorated them.

03:31.610 --> 03:35.170
And we can say that the tasks is self dot tasks.

03:35.170 --> 03:40.010
And we also need to mention that the process is process sequential and verbose is true.

03:40.010 --> 03:41.930
And that really is it.

03:41.930 --> 03:45.610
But we would normally call this def crew like that.

03:46.490 --> 03:49.290
And I think we've got it.

03:49.850 --> 03:52.050
Okay well you know what's left.

03:52.050 --> 03:56.330
We have to do our run function and we will come to that right now.

03:57.010 --> 03:57.690
Okay.

03:57.930 --> 04:01.330
This is the usual main full of stuff.

04:01.730 --> 04:03.450
Gonna delete all of that.

04:03.730 --> 04:10.390
Going to delete all of this stuff here and leave us with something very simple.

04:10.790 --> 04:14.390
So let's have a think about this, this run.

04:14.430 --> 04:20.630
So, so first of all, we know that the what we've got here is we've got requirements are going to be

04:20.670 --> 04:25.910
let's let's just give ourselves a variable that we'll have we'll have a variable requirements okay.

04:26.310 --> 04:27.910
Module name was one of them.

04:28.310 --> 04:31.190
And we'll have that be a variable module name.

04:32.350 --> 04:36.070
And class name is going to be a variable class name.

04:36.790 --> 04:41.430
Isn't it great the way again cursor just guesses since we had that before that.

04:41.430 --> 04:42.870
That's going to be our thing.

04:43.190 --> 04:44.790
And now engineering team.

04:45.630 --> 04:50.550
That's because that the the function, the method that we decorated with, with the crew is indeed called

04:50.590 --> 04:54.470
crew kickoff with our inputs.

04:54.830 --> 04:55.470
Okay.

04:55.670 --> 05:00.750
So all that remains now is for us to actually come up with the assignment.

05:00.950 --> 05:06.320
And I have produced an assignment which I wish to show you now and which I think you may find rather

05:06.320 --> 05:06.960
interesting.

05:07.440 --> 05:14.600
So here is the coding challenge that we have for our team of agents.

05:14.600 --> 05:16.400
Let me tell you about this challenge.

05:16.520 --> 05:18.120
And then I'm going to tell you why.

05:18.160 --> 05:19.640
This is an interesting challenge.

05:20.280 --> 05:28.040
So the requirements we would like a simple account management system for a trading simulation platform.

05:28.240 --> 05:33.800
The system should allow users to create an account, deposit funds and withdraw funds.

05:34.240 --> 05:39.280
The system should allow users to record that they've bought or sold shares and providing a quantity.

05:39.320 --> 05:45.520
It should be able to calculate the total value of the user's portfolio and the profit or loss from the

05:45.520 --> 05:46.600
initial deposit.

05:47.160 --> 05:48.320
Users should be able.

05:48.320 --> 05:54.120
The system should be able to report the holdings of a user at any time, and the PNL at any time.

05:54.240 --> 05:57.840
And it should be able to list the transactions that the user has made.

05:58.280 --> 06:02.560
And it should prevent the user from withdrawing funds that would leave them with a negative balance,

06:02.720 --> 06:07.580
or buying shares that they can't afford, or selling shares that they don't possess.

06:08.340 --> 06:14.980
And I'm telling it, the system has access to a function get share price, which returns the current

06:14.980 --> 06:22.300
price of a share, and includes an implementation that returns a fixed price for three shares there.

06:22.300 --> 06:25.140
So that should be built into this code.

06:25.740 --> 06:27.580
So that's the challenge.

06:27.580 --> 06:33.900
It's like to build a kind of framework for simulating trading activity, which you know that's a fair

06:33.900 --> 06:35.220
bit of work to do that properly.

06:35.220 --> 06:36.940
That's that's not going to be easy.

06:37.260 --> 06:39.740
And you may wonder why why this particular challenge?

06:39.740 --> 06:41.060
Well, here's the thing.

06:41.420 --> 06:47.980
In the last week of our course, we are going to try to build agent traders.

06:47.980 --> 06:50.860
We're going to be using back to OpenAI agents SDK.

06:50.860 --> 06:52.300
And we're going to be using MCP.

06:52.620 --> 06:53.940
It's going to be really cool.

06:54.060 --> 07:00.140
And the idea is going to be, can we build like a set of traders of agents that are able to monitor

07:00.140 --> 07:05.780
financial markets, look at actual live real time prices and make trading decisions?

07:06.100 --> 07:11.110
But for this to work, we're going to want to have a kind of framework that they can make trades in

07:11.110 --> 07:14.110
and that a framework that will keep track of portfolios and so on.

07:14.110 --> 07:17.830
And there are some frameworks that you can get off the shelf, but they're very heavy weights because

07:17.870 --> 07:21.470
they're sort of big financial markets, backtesting frameworks.

07:21.470 --> 07:26.830
There isn't something that I could find easily that's just a lightweight account management stock portfolio

07:26.830 --> 07:28.310
management framework.

07:28.350 --> 07:31.710
And so I thought, why don't we get AI to build it for us?

07:31.910 --> 07:37.870
And what could be better than having our own crew, our own engineering team, take on this challenge

07:37.870 --> 07:41.910
and try and build out this, this whole framework for us.

07:41.910 --> 07:44.110
So that's why this is a two for one.

07:44.150 --> 07:50.270
Not only are we doing this week's project, putting together a crew of software engineers and a test

07:50.270 --> 07:55.870
engineer and so on, but also this is going to hopefully provide us with a framework that will then

07:55.910 --> 08:00.910
be able to reuse, give us a head start in week six, so we don't have to build our own and do a whole

08:00.910 --> 08:01.590
ton of coding.

08:01.590 --> 08:04.910
So it's actually going to save us some time as well to boot.

08:05.630 --> 08:08.710
Well, with that introduction, I think it's time to try and run this thing.
