1
00:00:00,720 --> 00:00:01,080
Okay.

2
00:00:01,200 --> 00:00:01,720
Okay.

3
00:00:01,760 --> 00:00:05,760
It's time for us to go to the crew module as well, you know?

4
00:00:05,800 --> 00:00:07,400
You know that that's the next step.

5
00:00:07,400 --> 00:00:10,560
And of course, you also know that I like to get rid of all of the gunk.

6
00:00:11,080 --> 00:00:18,120
No more gunk for us, but we'll keep in, of course, the hooking up to the YAML files.

7
00:00:18,160 --> 00:00:25,400
Let's get rid of everything else from here, and we will do our work to define the agents.

8
00:00:25,680 --> 00:00:29,800
So agents, the first agent is called the engineering lead.

9
00:00:29,960 --> 00:00:36,600
And good old cursor is giving us some good suggestions here, but not perfect because we don't need

10
00:00:36,600 --> 00:00:39,200
the engineering lead to be able to execute code.

11
00:00:39,200 --> 00:00:42,960
That's not its idea, it's just meant to be designing stuff.

12
00:00:43,520 --> 00:00:44,360
All right.

13
00:00:44,600 --> 00:00:46,880
But now the back end engineer.

14
00:00:47,120 --> 00:00:49,080
So thank you cursor for that.

15
00:00:49,080 --> 00:00:52,360
But you have missed this time what we really need here.

16
00:00:52,360 --> 00:00:57,560
So we do indeed want it to be able to have code execution.

17
00:00:57,560 --> 00:01:01,160
We want the code execution to be safe in a Docker container.

18
00:01:01,420 --> 00:01:02,300
Absolutely.

19
00:01:02,860 --> 00:01:05,260
The, uh, max execution time.

20
00:01:05,820 --> 00:01:07,020
We probably want to give it a bit more.

21
00:01:07,020 --> 00:01:08,380
Well, not not that long.

22
00:01:08,380 --> 00:01:09,500
That's rather too long.

23
00:01:09,700 --> 00:01:11,780
Let's give it a few minutes to work on this.

24
00:01:11,780 --> 00:01:12,500
Why not?

25
00:01:12,820 --> 00:01:14,300
And then Max retries.

26
00:01:14,300 --> 00:01:17,420
We'll give it five times before we are upset.

27
00:01:17,740 --> 00:01:19,460
That seems pretty good.

28
00:01:19,940 --> 00:01:20,540
Okay.

29
00:01:20,820 --> 00:01:22,580
The front end engineer.

30
00:01:22,620 --> 00:01:23,100
Oops.

31
00:01:23,140 --> 00:01:24,780
Need to remember my decorator.

32
00:01:25,340 --> 00:01:27,020
The the front end engineer.

33
00:01:27,060 --> 00:01:28,020
Let's have a look.

34
00:01:28,020 --> 00:01:30,060
So actually we're going to have it right front end.

35
00:01:30,060 --> 00: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

36
00:01:34,780 --> 00:01:35,180
container.

37
00:01:35,220 --> 00:01:37,660
That'd be a whole different, different ball game.

38
00:01:37,660 --> 00:01:39,100
So we're not going to do that.

39
00:01:39,100 --> 00:01:41,860
But we are going to have it do its creation.

40
00:01:42,380 --> 00:01:44,820
And now we just have the test engineer.

41
00:01:45,540 --> 00:01:47,780
So thank you cursor.

42
00:01:48,020 --> 00:01:51,660
And that seems like a good enough start.

43
00:01:51,660 --> 00:01:58,140
But the test engineer we absolutely want the test engineer to not only write the unit tests but then

44
00:01:58,140 --> 00:01:59,580
to run the unit tests.

45
00:01:59,860 --> 00:02:00,940
But it probably doesn't need.

46
00:02:00,980 --> 00: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

47
00:02:05,350 --> 00:02:05,830
well.

48
00:02:06,110 --> 00:02:07,910
That seems fine.

49
00:02:08,110 --> 00:02:10,230
Okay, those are our agents.

50
00:02:10,270 --> 00:02:12,950
Next, it's time for us to define our tasks.

51
00:02:13,750 --> 00:02:16,470
And this is going to start to get very complicated.

52
00:02:16,790 --> 00:02:20,830
The design task is just going to look like that.

53
00:02:20,950 --> 00:02:22,950
And I bet curse is going to know everything else.

54
00:02:22,950 --> 00:02:25,270
That's all we want for the code task now.

55
00:02:26,070 --> 00:02:28,590
And, uh, let's see if it can help us more.

56
00:02:28,630 --> 00:02:31,750
That's probably great for the front end task.

57
00:02:32,190 --> 00:02:34,670
And, uh, the test task.

58
00:02:34,670 --> 00:02:35,830
Is it going to help us with that?

59
00:02:35,870 --> 00:02:36,510
Yes it is.

60
00:02:36,510 --> 00:02:39,270
It's got a strangely indented, but no, it's brought it back.

61
00:02:39,270 --> 00:02:40,110
That's nice.

62
00:02:40,430 --> 00:02:42,990
And I think that's it for our tasks.

63
00:02:42,990 --> 00:02:44,750
I don't think there's anything missing here.

64
00:02:45,030 --> 00:02:45,750
Perfect.

65
00:02:45,750 --> 00:02:46,190
All right.

66
00:02:46,190 --> 00:02:46,990
Thank you.

67
00:02:47,030 --> 00:02:47,590
Cursor.

68
00:02:47,630 --> 00:02:49,830
Those are indeed our tasks.

69
00:02:50,110 --> 00:02:51,150
It's time though.

70
00:02:51,190 --> 00:02:52,470
It's time for our crew.

71
00:02:52,510 --> 00:02:54,550
Let's see if, uh, cursor can do this.

72
00:02:54,590 --> 00:02:56,190
Oh, no no, no, that's all.

73
00:02:56,230 --> 00:02:57,870
All a disaster.

74
00:02:57,910 --> 00:03:04,930
This is, uh, a moment to, uh, definitely mention that you do have to be mindful of this.

75
00:03:04,970 --> 00:03:06,170
The whole vibe coding thing.

76
00:03:06,170 --> 00: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.

77
00:03:12,170 --> 00: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

78
00:03:17,970 --> 00:03:21,930
of code, because it will tend to err on the side of more.

79
00:03:22,130 --> 00:03:25,770
Of course, in this situation, we don't need to list out all of the agents like this.

80
00:03:25,810 --> 00:03:29,210
We can just say the agents are self dot agents.

81
00:03:29,210 --> 00:03:31,330
That's the why we decorated them.

82
00:03:31,610 --> 00:03:35,170
And we can say that the tasks is self dot tasks.

83
00:03:35,170 --> 00:03:40,010
And we also need to mention that the process is process sequential and verbose is true.

84
00:03:40,010 --> 00:03:41,930
And that really is it.

85
00:03:41,930 --> 00:03:45,610
But we would normally call this def crew like that.

86
00:03:46,490 --> 00:03:49,290
And I think we've got it.

87
00:03:49,850 --> 00:03:52,050
Okay well you know what's left.

88
00:03:52,050 --> 00:03:56,330
We have to do our run function and we will come to that right now.

89
00:03:57,010 --> 00:03:57,690
Okay.

90
00:03:57,930 --> 00:04:01,330
This is the usual main full of stuff.

91
00:04:01,730 --> 00:04:03,450
Gonna delete all of that.

92
00:04:03,730 --> 00:04:10,390
Going to delete all of this stuff here and leave us with something very simple.

93
00:04:10,790 --> 00:04:14,390
So let's have a think about this, this run.

94
00:04:14,430 --> 00: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

95
00:04:20,670 --> 00:04:25,910
let's let's just give ourselves a variable that we'll have we'll have a variable requirements okay.

96
00:04:26,310 --> 00:04:27,910
Module name was one of them.

97
00:04:28,310 --> 00:04:31,190
And we'll have that be a variable module name.

98
00:04:32,350 --> 00:04:36,070
And class name is going to be a variable class name.

99
00:04:36,790 --> 00:04:41,430
Isn't it great the way again cursor just guesses since we had that before that.

100
00:04:41,430 --> 00:04:42,870
That's going to be our thing.

101
00:04:43,190 --> 00:04:44,790
And now engineering team.

102
00:04:45,630 --> 00:04:50,550
That's because that the the function, the method that we decorated with, with the crew is indeed called

103
00:04:50,590 --> 00:04:54,470
crew kickoff with our inputs.

104
00:04:54,830 --> 00:04:55,470
Okay.

105
00:04:55,670 --> 00:05:00,750
So all that remains now is for us to actually come up with the assignment.

106
00:05:00,950 --> 00:05:06,320
And I have produced an assignment which I wish to show you now and which I think you may find rather

107
00:05:06,320 --> 00:05:06,960
interesting.

108
00:05:07,440 --> 00:05:14,600
So here is the coding challenge that we have for our team of agents.

109
00:05:14,600 --> 00:05:16,400
Let me tell you about this challenge.

110
00:05:16,520 --> 00:05:18,120
And then I'm going to tell you why.

111
00:05:18,160 --> 00:05:19,640
This is an interesting challenge.

112
00:05:20,280 --> 00:05:28,040
So the requirements we would like a simple account management system for a trading simulation platform.

113
00:05:28,240 --> 00:05:33,800
The system should allow users to create an account, deposit funds and withdraw funds.

114
00:05:34,240 --> 00:05:39,280
The system should allow users to record that they've bought or sold shares and providing a quantity.

115
00:05:39,320 --> 00:05:45,520
It should be able to calculate the total value of the user's portfolio and the profit or loss from the

116
00:05:45,520 --> 00:05:46,600
initial deposit.

117
00:05:47,160 --> 00:05:48,320
Users should be able.

118
00:05:48,320 --> 00:05:54,120
The system should be able to report the holdings of a user at any time, and the PNL at any time.

119
00:05:54,240 --> 00:05:57,840
And it should be able to list the transactions that the user has made.

120
00:05:58,280 --> 00:06:02,560
And it should prevent the user from withdrawing funds that would leave them with a negative balance,

121
00:06:02,720 --> 00:06:07,580
or buying shares that they can't afford, or selling shares that they don't possess.

122
00:06:08,340 --> 00:06:14,980
And I'm telling it, the system has access to a function get share price, which returns the current

123
00:06:14,980 --> 00:06:22,300
price of a share, and includes an implementation that returns a fixed price for three shares there.

124
00:06:22,300 --> 00:06:25,140
So that should be built into this code.

125
00:06:25,740 --> 00:06:27,580
So that's the challenge.

126
00:06:27,580 --> 00:06:33,900
It's like to build a kind of framework for simulating trading activity, which you know that's a fair

127
00:06:33,900 --> 00:06:35,220
bit of work to do that properly.

128
00:06:35,220 --> 00:06:36,940
That's that's not going to be easy.

129
00:06:37,260 --> 00:06:39,740
And you may wonder why why this particular challenge?

130
00:06:39,740 --> 00:06:41,060
Well, here's the thing.

131
00:06:41,420 --> 00:06:47,980
In the last week of our course, we are going to try to build agent traders.

132
00:06:47,980 --> 00:06:50,860
We're going to be using back to OpenAI agents SDK.

133
00:06:50,860 --> 00:06:52,300
And we're going to be using MCP.

134
00:06:52,620 --> 00:06:53,940
It's going to be really cool.

135
00:06:54,060 --> 00: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

136
00:07:00,140 --> 00:07:05,780
financial markets, look at actual live real time prices and make trading decisions?

137
00:07:06,100 --> 00: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

138
00:07:11,110 --> 00:07:14,110
and that a framework that will keep track of portfolios and so on.

139
00:07:14,110 --> 00:07:17,830
And there are some frameworks that you can get off the shelf, but they're very heavy weights because

140
00:07:17,870 --> 00:07:21,470
they're sort of big financial markets, backtesting frameworks.

141
00:07:21,470 --> 00:07:26,830
There isn't something that I could find easily that's just a lightweight account management stock portfolio

142
00:07:26,830 --> 00:07:28,310
management framework.

143
00:07:28,350 --> 00:07:31,710
And so I thought, why don't we get AI to build it for us?

144
00:07:31,910 --> 00:07:37,870
And what could be better than having our own crew, our own engineering team, take on this challenge

145
00:07:37,870 --> 00:07:41,910
and try and build out this, this whole framework for us.

146
00:07:41,910 --> 00:07:44,110
So that's why this is a two for one.

147
00:07:44,150 --> 00:07:50,270
Not only are we doing this week's project, putting together a crew of software engineers and a test

148
00:07:50,270 --> 00:07:55,870
engineer and so on, but also this is going to hopefully provide us with a framework that will then

149
00:07:55,910 --> 00: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

150
00:08:00,910 --> 00:08:01,590
ton of coding.

151
00:08:01,590 --> 00:08:04,910
So it's actually going to save us some time as well to boot.

152
00:08:05,630 --> 00:08:08,710
Well, with that introduction, I think it's time to try and run this thing.