WEBVTT

00:00.240 --> 00:03.440
Okay, so let's close the terminal.

00:03.680 --> 00:05.480
Come into financial researcher.

00:05.680 --> 00:06.600
You know the deal.

00:06.600 --> 00:08.760
Now there is a source folder.

00:08.760 --> 00:10.120
It has a config.

00:10.520 --> 00:12.040
And that is where we want to begin.

00:12.040 --> 00:15.600
We want to begin by looking at our agents.

00:15.800 --> 00:17.440
So this is the agents.

00:17.440 --> 00:21.440
And we are in fact also we're going to have a researcher agent.

00:21.640 --> 00:27.760
And we're going to make this a bit shorter and just have an analyst agent, a researcher agent and an

00:27.800 --> 00:28.840
analyst agent.

00:28.840 --> 00:30.160
So what are they going to do?

00:30.440 --> 00:37.880
So this time I'm going to to simply copy and paste a whole new section here and talk it through with

00:37.880 --> 00:38.360
you.

00:38.360 --> 00:43.760
So the role is going to be a senior financial researcher for a company that we will specify in the inputs

00:43.800 --> 00:49.640
like before, it's going to research that company news and potential for that company.

00:50.040 --> 00:50.840
The backstory.

00:50.880 --> 00:55.920
You're a seasoned financial researcher with a talent for finding the most relevant information about

00:55.920 --> 01:02.090
a company known for your ability to find the most relevant information, present it in a clear and concise

01:02.130 --> 01:02.850
manner.

01:02.850 --> 01:07.290
And that's where we specify the LLM, which we can we can mix this up if we wish.

01:07.730 --> 01:13.330
And we now choose to have our second second agent, the analyst.

01:13.330 --> 01:15.330
Let me put in what I've got here.

01:15.770 --> 01:19.730
Market analyst and report writer focused on a company.

01:20.010 --> 01:24.650
You analyze the company and you create a comprehensive, well structured report that represents insights

01:24.650 --> 01:26.290
in a clear and engaging way.

01:26.930 --> 01:32.810
Meticulous, skilled analyst with a background in financial analysis and company research, a talent,

01:32.850 --> 01:40.290
etc., etc. it's interesting that this construct of having us tell the back story, it really does encourage

01:40.290 --> 01:41.330
better prompting.

01:41.330 --> 01:46.730
If I were just writing a system prompt instructions as we did last week, I probably wouldn't think

01:46.730 --> 01:53.090
through expressing myself this way in terms of using a word like meticulous and meaningful insights

01:53.090 --> 01:53.850
and so on.

01:53.930 --> 01:55.290
So it is helpful.

01:55.330 --> 02:00.870
Putting us through the discipline of having to give a backstory, helps give more context, and helps

02:00.870 --> 02:06.670
make sure that we're going to get the best outputs, the best outcomes from running the LM.

02:07.470 --> 02:08.470
All right.

02:08.670 --> 02:13.310
So with this, let's now talk about our tasks.

02:14.470 --> 02:15.150
Okay.

02:15.270 --> 02:17.510
So we're moving over to tasks.

02:17.510 --> 02:23.190
And we are going to have a research task and an analysis task.

02:23.310 --> 02:26.190
So it's not too different to the the boilerplate one.

02:26.190 --> 02:28.630
But we are going to do a little bit more work here.

02:28.830 --> 02:33.830
So for the research task going to really spell out what it is that we want this task to involve.

02:34.110 --> 02:37.190
Conduct thorough research on this company.

02:37.230 --> 02:43.510
Focus on the current status and health, the historical performance challenges and opportunities, recent

02:43.550 --> 02:46.710
news, future outlook, potential development.

02:47.150 --> 02:52.590
Make sure to organize your findings in a structured format with clear sections, and then the expected

02:52.590 --> 02:57.920
output is a bit repetitive, but it says what we want the well-defined sections and we again mention

02:57.920 --> 02:59.120
the input the company.

02:59.680 --> 03:03.040
And that is going to be assigned to the researcher.

03:03.560 --> 03:04.120
Okay.

03:04.320 --> 03:06.120
And the analysis task.

03:06.160 --> 03:07.880
Now you'll notice there's no output file there.

03:07.880 --> 03:09.960
So you might be thinking what what's going on here.

03:10.080 --> 03:10.640
Well let's see.

03:10.680 --> 03:15.480
Now let's give this a description that is going to be quite detailed.

03:15.520 --> 03:21.600
Again analyze the research findings and create a comprehensive report.

03:22.040 --> 03:23.560
The report should.

03:23.600 --> 03:25.440
And then we have the different sections in the report.

03:25.480 --> 03:32.120
Executive summary information insights market outlook and be formatted in a professional style.

03:32.560 --> 03:36.400
And for the expected output will again be a bit repetitive here.

03:36.600 --> 03:39.280
There's never a harm in being repetitive.

03:39.840 --> 03:48.160
Polished professional report on the company representing the research findings and the agent that we

03:48.160 --> 03:49.720
want to mention here.

03:49.760 --> 03:52.320
Of course should be the research.

03:53.040 --> 03:55.400
This is the the sorry the agent is the analyst.

03:55.530 --> 03:57.810
That's the agent that we that we made for the analysis task.

03:57.850 --> 03:58.370
Of course.

03:59.170 --> 03:59.650
Okay.

03:59.690 --> 04:02.210
So there's a few more things that we want to add here.

04:02.570 --> 04:11.450
We want to make sure that the output from the research task is included as part of the analysis task.

04:11.650 --> 04:14.330
And crew gives us a super easy way to do that.

04:14.370 --> 04:16.330
You just type context.

04:16.610 --> 04:21.090
And yes, of course cursor tells us what to do by saying that context.

04:21.090 --> 04:23.210
Context can take a list like this.

04:23.210 --> 04:28.810
And we are giving the research task as part of the context that's needed for the analysis task.

04:28.890 --> 04:35.450
And just with that simple step, we ensure continuity and we ensure that the output is included in the

04:35.450 --> 04:36.530
research task.

04:36.890 --> 04:40.250
And then finally we are going to have an output file for this.

04:40.570 --> 04:46.330
And we're going to let's let's call that report.md in the output directory.

04:46.330 --> 04:48.050
That seems fine.

04:48.770 --> 04:49.290
Okay.

04:49.330 --> 04:52.330
And now to the all important crew dot I.

04:52.530 --> 04:55.510
And here we have as usual, some gunk.

04:55.670 --> 04:58.270
We have the financial researcher I am.

04:58.270 --> 04:59.430
I'm going to be bold here.

04:59.430 --> 05:01.790
I'm obviously I'm going to leave in oops.

05:02.190 --> 05:03.270
Say that and I delete it.

05:03.670 --> 05:07.950
I'm going to leave in the config file that we want.

05:08.190 --> 05:10.990
And I am just going to delete everything else.

05:10.990 --> 05:12.510
And then we're just going to rewrite it.

05:12.510 --> 05:13.470
You want me to rewrite.

05:13.470 --> 05:17.150
Well we're going to rewrite this entire file right now okay.

05:17.190 --> 05:18.350
So what do we want here.

05:18.350 --> 05:19.710
We want an agent.

05:19.910 --> 05:22.230
So we put in the decorator for agent.

05:22.550 --> 05:25.070
And uh let's see.

05:25.110 --> 05:26.950
Well let's just press tab and see what we get.

05:26.990 --> 05:29.150
We want an agent that is the researcher.

05:29.150 --> 05:29.950
That's correct.

05:29.950 --> 05:32.510
We probably want to say verbose is true.

05:32.830 --> 05:33.630
There we go.

05:33.950 --> 05:38.070
And then we also want an agent that's called the analyst.

05:38.510 --> 05:45.910
And that is going to be an agent that is going to what's happening all over the place.

05:45.910 --> 05:46.190
Sorry.

05:46.190 --> 05:50.830
This is an agent and this should be an analyst.

05:51.630 --> 05:54.080
And now we're getting help from cursor.

05:54.080 --> 05:55.360
That all looks great.

05:55.560 --> 05:58.480
Okay, so now we want to have a couple of tasks.

05:58.480 --> 06:02.200
So we want to have a task that is called the research task.

06:02.200 --> 06:03.120
That sounds right.

06:03.120 --> 06:07.920
It's going to be a task that is going to the research task.

06:07.920 --> 06:08.920
That's perfect.

06:09.680 --> 06:13.560
And the analysis task that looks good to me as well.

06:13.920 --> 06:15.960
So all is well.

06:16.280 --> 06:19.920
And now we want the crew and yes thank you.

06:19.960 --> 06:21.320
Very nice cursor.

06:21.320 --> 06:22.960
It's filling it all in for us.

06:22.960 --> 06:31.240
We want the process to be the process sequential and verbose to be true.

06:31.440 --> 06:33.480
Crew cursor is faster than me.

06:33.520 --> 06:35.520
I'm playing catch up here but that is perfect.

06:35.520 --> 06:38.520
So remember self dot agent is populated.

06:38.560 --> 06:38.720
Sorry.

06:38.760 --> 06:46.600
Self dot agents is populated because we have agent decorators around our agent functions methods and

06:46.640 --> 06:50.200
then tasks is also decorated here.

06:50.200 --> 06:53.260
So everything looks great to me.

06:54.140 --> 07:01.900
Okay, now we go to Maine, and I think, again, we're going to want to, uh, delete all of this and

07:01.900 --> 07:02.500
start again.

07:02.500 --> 07:04.620
And I will type it for you manually.

07:05.300 --> 07:05.940
Okay.

07:05.940 --> 07:06.820
Here we go.

07:07.020 --> 07:09.540
So we're going to delete the gunk.

07:09.900 --> 07:14.020
We are going to delete everything but just only leave in run.

07:14.020 --> 07:15.300
That's going to be it.

07:15.340 --> 07:15.860
Okay.

07:15.900 --> 07:19.460
So run the researcher crew.

07:19.820 --> 07:26.660
Isn't it amazing that cursor realized knows that our input is a company that that inputs.

07:26.700 --> 07:31.420
We did indeed just have company as the templated curly braces thing.

07:31.460 --> 07:32.620
Just in case you don't know what I mean.

07:32.620 --> 07:34.300
I mean, we have this right here.

07:34.340 --> 07:38.660
Company is the one input that needs to go in to our YAML.

07:38.940 --> 07:46.260
And if we go back to main, then automatically cursor realized that we needed to set company and populated

07:46.260 --> 07:46.780
it there.

07:47.140 --> 07:47.660
All right.

07:47.660 --> 07:53.190
Then we're going to say yeah Result is the financial researcher.

07:55.790 --> 07:57.910
And that all looks great to me.

07:57.910 --> 07:59.830
And then we're going to print the results.

08:00.310 --> 08:00.790
Thank you.

08:00.830 --> 08:01.430
Cursor.

08:01.630 --> 08:03.550
And that's really it.

08:04.070 --> 08:05.670
I think that's all we need.

08:05.910 --> 08:08.310
Now you might be thinking hey, didn't we set up Serpa?

08:08.310 --> 08:09.630
Are we not going to use that for something?

08:09.670 --> 08:11.150
We are going to use it for something.

08:11.150 --> 08:12.550
But all in good time.

08:12.590 --> 08:18.310
Let's first just try running this without making any any proper Google lookup and see what happens.

08:19.190 --> 08:22.790
Okay, well, just before we run it, let's let's change the models.

08:22.790 --> 08:27.710
Let's give ourselves some more interesting models to experiment with for our researcher.

08:27.750 --> 08:29.590
Let's go with deep seek.

08:30.150 --> 08:32.870
Now of course you could do whatever models you would like here.

08:32.870 --> 08:33.590
This should be deep.

08:33.630 --> 08:34.230
Seek chat.

08:34.230 --> 08:35.910
That'll be the right one for us to use.

08:36.230 --> 08:38.350
And you could stick with OpenAI.

08:38.390 --> 08:42.310
Or you could use a different model, or use a llama and run it locally if you wish.

08:42.630 --> 08:46.550
I will try a grok model for this one.

08:46.990 --> 08:50.400
Let's use this this here llama three 370 billion.

08:50.440 --> 08:51.160
Versatile.

08:51.160 --> 08:55.440
That's one of the most powerful open source models from from meta.

08:55.640 --> 08:58.840
And we'll use that via grok the high performance inference.

08:58.840 --> 09:05.720
You can also run something locally like use a llama to to run llama 3.21 million or 3 billion version

09:05.720 --> 09:06.320
of it.

09:06.760 --> 09:09.920
So that's just a mix up the models to try something a bit different.

09:09.920 --> 09:15.440
And now let's go and open up a new one of these guys a new terminal.

09:15.440 --> 09:16.960
Let's make it nice and big.

09:17.440 --> 09:22.680
And we will go into project or folder number three for crew.

09:22.840 --> 09:25.920
We will go into our financial researcher.

09:25.920 --> 09:31.920
And you remember we type crew I run to kick this off and we'll see what happens.

09:32.600 --> 09:38.720
It's thinking now I will tell you that uh, you'll see, by the way, that the agent has been assigned

09:38.720 --> 09:40.920
the task financial researcher for Tesla.

09:40.960 --> 09:48.140
That shows how that those inputs, those parameters automatically got set as the, the, uh, the agents,

09:48.180 --> 09:48.980
uh, roll.

09:49.300 --> 09:53.020
Now, I'll tell you that the deep sea takes takes its time over this.

09:53.060 --> 09:58.740
It takes a good 30s, I guess, because it's producing quite comprehensive research as part of this.

09:58.740 --> 10:00.620
So we will allow it to do its thing.

10:00.620 --> 10:03.900
Maybe next time we should have them both be grok so that it's nice and fast.

10:04.180 --> 10:05.540
But it's going through.

10:05.660 --> 10:10.740
It's, uh, we've gone off to deep sea guys servers where it is.

10:10.940 --> 10:19.220
The 671 billion parameter model is busy at work, and once it's finished, we're then going to flip

10:19.260 --> 10:26.620
across to our other agent, and our other agent will use grok running in the cloud a 70 billion meta

10:26.620 --> 10:27.180
model.

10:27.340 --> 10:31.340
And then we should get our financial report on Tesla at the end of it.

10:31.340 --> 10:31.980
Here it is.

10:32.020 --> 10:33.980
Grok was so quick we didn't even see it.

10:34.420 --> 10:38.100
There's uh the grok taking the task and completing it.

10:38.140 --> 10:40.100
Here is the result.

10:40.140 --> 10:42.900
Our financial report on Tesla.

10:42.940 --> 10:44.620
It all looks great.

10:44.660 --> 10:46.100
Wasn't that easy?
