Okay, so let's close the terminal.
Come into financial researcher.
You know the deal.
Now there is a source folder.
It has a config.
And that is where we want to begin.
We want to begin by looking at our agents.
So this is the agents.
And we are in fact also we're going to have a researcher agent.
And we're going to make this a bit shorter and just have an analyst agent, a researcher agent and an
analyst agent.
So what are they going to do?
So this time I'm going to to simply copy and paste a whole new section here and talk it through with
you.
So the role is going to be a senior financial researcher for a company that we will specify in the inputs
like before, it's going to research that company news and potential for that company.
The backstory.
You're a seasoned financial researcher with a talent for finding the most relevant information about
a company known for your ability to find the most relevant information, present it in a clear and concise
manner.
And that's where we specify the LLM, which we can we can mix this up if we wish.
And we now choose to have our second second agent, the analyst.
Let me put in what I've got here.
Market analyst and report writer focused on a company.
You analyze the company and you create a comprehensive, well structured report that represents insights
in a clear and engaging way.
Meticulous, skilled analyst with a background in financial analysis and company research, a talent,
etc., etc. it's interesting that this construct of having us tell the back story, it really does encourage
better prompting.
If I were just writing a system prompt instructions as we did last week, I probably wouldn't think
through expressing myself this way in terms of using a word like meticulous and meaningful insights
and so on.
So it is helpful.
Putting us through the discipline of having to give a backstory, helps give more context, and helps
make sure that we're going to get the best outputs, the best outcomes from running the LM.
All right.
So with this, let's now talk about our tasks.
Okay.
So we're moving over to tasks.
And we are going to have a research task and an analysis task.
So it's not too different to the the boilerplate one.
But we are going to do a little bit more work here.
So for the research task going to really spell out what it is that we want this task to involve.
Conduct thorough research on this company.
Focus on the current status and health, the historical performance challenges and opportunities, recent
news, future outlook, potential development.
Make sure to organize your findings in a structured format with clear sections, and then the expected
output is a bit repetitive, but it says what we want the well-defined sections and we again mention
the input the company.
And that is going to be assigned to the researcher.
Okay.
And the analysis task.
Now you'll notice there's no output file there.
So you might be thinking what what's going on here.
Well let's see.
Now let's give this a description that is going to be quite detailed.
Again analyze the research findings and create a comprehensive report.
The report should.
And then we have the different sections in the report.
Executive summary information insights market outlook and be formatted in a professional style.
And for the expected output will again be a bit repetitive here.
There's never a harm in being repetitive.
Polished professional report on the company representing the research findings and the agent that we
want to mention here.
Of course should be the research.
This is the the sorry the agent is the analyst.
That's the agent that we that we made for the analysis task.
Of course.
Okay.
So there's a few more things that we want to add here.
We want to make sure that the output from the research task is included as part of the analysis task.
And crew gives us a super easy way to do that.
You just type context.
And yes, of course cursor tells us what to do by saying that context.
Context can take a list like this.
And we are giving the research task as part of the context that's needed for the analysis task.
And just with that simple step, we ensure continuity and we ensure that the output is included in the
research task.
And then finally we are going to have an output file for this.
And we're going to let's let's call that report.md in the output directory.
That seems fine.
Okay.
And now to the all important crew dot I.
And here we have as usual, some gunk.
We have the financial researcher I am.
I'm going to be bold here.
I'm obviously I'm going to leave in oops.
Say that and I delete it.
I'm going to leave in the config file that we want.
And I am just going to delete everything else.
And then we're just going to rewrite it.
You want me to rewrite.
Well we're going to rewrite this entire file right now okay.
So what do we want here.
We want an agent.
So we put in the decorator for agent.
And uh let's see.
Well let's just press tab and see what we get.
We want an agent that is the researcher.
That's correct.
We probably want to say verbose is true.
There we go.
And then we also want an agent that's called the analyst.
And that is going to be an agent that is going to what's happening all over the place.
Sorry.
This is an agent and this should be an analyst.
And now we're getting help from cursor.
That all looks great.
Okay, so now we want to have a couple of tasks.
So we want to have a task that is called the research task.
That sounds right.
It's going to be a task that is going to the research task.
That's perfect.
And the analysis task that looks good to me as well.
So all is well.
And now we want the crew and yes thank you.
Very nice cursor.
It's filling it all in for us.
We want the process to be the process sequential and verbose to be true.
Crew cursor is faster than me.
I'm playing catch up here but that is perfect.
So remember self dot agent is populated.
Sorry.
Self dot agents is populated because we have agent decorators around our agent functions methods and
then tasks is also decorated here.
So everything looks great to me.
Okay, now we go to Maine, and I think, again, we're going to want to, uh, delete all of this and
start again.
And I will type it for you manually.
Okay.
Here we go.
So we're going to delete the gunk.
We are going to delete everything but just only leave in run.
That's going to be it.
Okay.
So run the researcher crew.
Isn't it amazing that cursor realized knows that our input is a company that that inputs.
We did indeed just have company as the templated curly braces thing.
Just in case you don't know what I mean.
I mean, we have this right here.
Company is the one input that needs to go in to our YAML.
And if we go back to main, then automatically cursor realized that we needed to set company and populated
it there.
All right.
Then we're going to say yeah Result is the financial researcher.
And that all looks great to me.
And then we're going to print the results.
Thank you.
Cursor.
And that's really it.
I think that's all we need.
Now you might be thinking hey, didn't we set up Serpa?
Are we not going to use that for something?
We are going to use it for something.
But all in good time.
Let's first just try running this without making any any proper Google lookup and see what happens.
Okay, well, just before we run it, let's let's change the models.
Let's give ourselves some more interesting models to experiment with for our researcher.
Let's go with deep seek.
Now of course you could do whatever models you would like here.
This should be deep.
Seek chat.
That'll be the right one for us to use.
And you could stick with OpenAI.
Or you could use a different model, or use a llama and run it locally if you wish.
I will try a grok model for this one.
Let's use this this here llama three 370 billion.
Versatile.
That's one of the most powerful open source models from from meta.
And we'll use that via grok the high performance inference.
You can also run something locally like use a llama to to run llama 3.21 million or 3 billion version
of it.
So that's just a mix up the models to try something a bit different.
And now let's go and open up a new one of these guys a new terminal.
Let's make it nice and big.
And we will go into project or folder number three for crew.
We will go into our financial researcher.
And you remember we type crew I run to kick this off and we'll see what happens.
It's thinking now I will tell you that uh, you'll see, by the way, that the agent has been assigned
the task financial researcher for Tesla.
That shows how that those inputs, those parameters automatically got set as the, the, uh, the agents,
uh, roll.
Now, I'll tell you that the deep sea takes takes its time over this.
It takes a good 30s, I guess, because it's producing quite comprehensive research as part of this.
So we will allow it to do its thing.
Maybe next time we should have them both be grok so that it's nice and fast.
But it's going through.
It's, uh, we've gone off to deep sea guys servers where it is.
The 671 billion parameter model is busy at work, and once it's finished, we're then going to flip
across to our other agent, and our other agent will use grok running in the cloud a 70 billion meta
model.
And then we should get our financial report on Tesla at the end of it.
Here it is.
Grok was so quick we didn't even see it.
There's uh the grok taking the task and completing it.
Here is the result.
Our financial report on Tesla.
It all looks great.
Wasn't that easy?