Okay, so I double click on the AI agent.
It's time to tidy this up.
It thinks that it's getting its information from a connected trigger node.
And it's not.
It's coming from the node before.
We'll define it with an expression.
And I don't know if you remember from the time that we built that, that extract text that, that it
comes in in a field dollar JSON like that.
That's how the text flows in from the PDF extractor.
And of course you don't need to remember this.
You could just run the node and see what comes in and drag and drop like we did last time.
Or you can look back at the previous example if you need a reminder.
Okay.
And now we are going to add a system message.
And this is where we want to be careful and give good instructions to our AI agent okay here we go.
Here is the system prompt I just wrote this, but I thought I would just paste it in and read it back
to you, rather than you have to agonize and watch me type it all out.
So I'm saying you are the sales manager for an accounting software firm at CTI.
You are provided with the ICP for an ideal prospect, you must carry out these steps first.
Use your prospecting Subagent tool once to search online for leads, providing a query based on the
ICP.
Next, for each of the identified prospects, use your Revops Subagent tool to store the information
in the CRM database.
Use the tool once for each prospect, uh, and then finally use your SDR Subagent tool.
Once this tool will retrieve everyone in Pipedrive and draft an outbound sales email for each for all
of them.
Then reply with a summary of the outcome.
And I'm going to add in the word repeatedly in there.
Just so it's absolutely clear, you want to make sure that these prompts are so, so clear that it's
almost impossible to misunderstand them.
That is the trick.
Okay, I think that's a fine prompt we've got there.
You can see with this reply with a summary of the outcome that I'm quite keen to make this have structured
outputs as well.
I always like structured outputs.
So let's turn that on.
Okay.
So with this I'm going to do an output parser structured output parser.
The JSON example we're going to have in here it's going to have success.
Colon.
And that's that could be true or false.
We'll do it like that.
And then uh, we'll have um uh summary.
Uh, a concise description of what happened that seems clear enough.
Good enough.
All right.
So that is then going to produce something out of here.
Uh, and, uh, we can then figure out what we want to do with that information that's going to come
on the right here.
Okay.
Well, we're going to want the output to go into an if because we're going to do something different
if it's successful or not.
So this is going to be an expression.
And we're going to want that expression to be JSON dot output.
That's what's coming out of the LM dot success, because that's the field we care about.
And if that is true, we're going to want to do one thing, otherwise something else.
Let's tidy up and let's see what happens.
If we want to move that over there a bit.
We want to have the true.
Uh, then uh, let's use pushover.
Uh, and of course, you can certainly, uh, do something different if you wish.
You can use slack, you can use telegram, whatever you wish.
Uh, and I'll have to paste in my user key there and then put in a message and bam, I've done that.
I've added in a user key.
I've put in two pushovers, one with a suitably jubilant message and one with a woeful message.
And I've also, while I was at it, I've put in three stickies so that we could see everything that's
going on.
And doesn't it look tidy and professional and nice?
I think we're ready to try out a multi-agent business development system.
Let's give this a try first.
We probably have to tidy up some data first to reset everything.
Let's go do that.
I've just gone back to Pipedrive.
I'm just going to come in here.
I'm looking here, back at the leads again.
Number one, I'm just going to click on John Smith and delete John.
We don't want John still in there.
Off goes John.
And I'm going to come down here to contacts I'm going to delete this organization.
Go away IBM and I'm going to delete people.
Go away John Smith nice.
Delete.
Done okay.
It should now all be nice and empty okay.
Pipedrive is cleared.
Next up we got to make ourselves a PDF.
Okay.
So I've made a PDF and this is what it looks like.
It's just a simple PDF.
It's got a PDF and it says ideal customer profile.
Senior member of the finance team at a mid-market consulting firm in the US.
Ideally not C-suite, but a director, something like that.
Senior enough to be a decision maker, but still hands on.
So it's like a blurb that you might get to describe the perfect customer that you're looking for to
hunt for leads.
Okay, we've got that.
And now all we need to do is execute the workflow.
I think we can keep this one in test mode, or we try it out once and then drop this PDF into our ICP
file drop and see what happens.
Well, look, I'm not gonna fib.
I just ran it and it didn't work because there were a couple of bugs which I have tracked down and fixed.
So rather than just go back and pretend that it worked, first time I thought I'd be honest, it didn't.
And you may have spotted the mistakes I made, in which case, congratulations and foolish me.
Let me fix them now and show you.
And also, it's sort of insightful to see how you you figure out what's going wrong.
The first.
The first mistake I made is in the Revops subagent right here that I did a silly thing.
You look at this field right here.
Sales lead description.
And what I put in here was the description of what the sales lead description should be.
Well, that was all getting confused.
This is here as if that's the value that that field should always take.
That's not what I meant to do.
So remove that.
Cut it.
This should be set by the model.
It needs to provide the sales lead description.
And then I can click here to add a description.
And that's where I can put in my text.
That is the actual description I put that in.
So it was always passing that description to the Subagent I was like, what's going on?
Uh, is it such a classic kind of flub that you can make?
And once you've made it, it's quite hard to see it.
Uh, so there we go.
So that fixes that one.
There's always a simple explanation.
Uh, and then, uh, what was another thing?
I did this if, uh, this if here, uh, you can see that this is taking this output and asking if it's
equal to true.
But this test is confusing.
This is a test that's in the string category.
This is saying is the result of this equal to the text true as a word.
That's not what we want.
We want to be thinking of this as a boolean a true or a false.
And we want to say if it's true, then then take the true route.
That's the right way of doing it.
Okay.
Maybe you saw both of those, in which case.
Great.
And then there was another thing that's that's a little bit more subtle.
Okay.
And the other mistake is over in our revops subagent.
Um, and this is a curious one because I thought this was working, so I think maybe I didn't save it
or something.
But if you go into create a person, we need to make sure that in addition to creating the person record,
it's also saving their email address.
And this doesn't seem to be happening.
It's not populated.
I need to add a field email.
This needs to be an expression, and we need to set the email based on the the agent data that's coming
in the AI agent.
This email right here.
That's what's needed.
Save that uh, so that wasn't there.
And so emails were being put in there blank, which means that it couldn't draft emails.
And now I've got to republish that now that I have saved it.
Uh, so I don't know what happened there.
I don't know whether I somehow didn't save it properly or whether I never put it in there, but but
for whatever reason, that wasn't there.
Maybe it is for you, maybe it's not.
But now we've done that, right.
Okay.
All right.
Back we go to Project Amplify business development business development manager.
Here's our beautiful agent.
And now we should be all ready to go.
We go to the ICP file drop I'm going to drop in the PDF file.
Here it goes.
Uploading.
There it is.
Come back over here.
Execute the workflow.
Fingers crossed the trigger is hit.
It's downloading the file.
It's extracting.
It's going over here.
Everything is underway.
We are now prospecting.
The first of our subagents is running.
This is presumably now connecting through Fire Crawl and through Hunter.io, choosing its tools as it
wishes in order to find us some leads.
They will then be placed into Pipedrive.
It will then draft emails and it will then send me a push notification.
This takes a couple of minutes.
So I'm not I'm not going to give you the running commentary.
Well, I bite my nails and see if I can, uh, work nicely this time.
I will see you in a second, when I will hopefully be the proud recipient of a push notification.
And yes, I am the proud recipient of a push notification.
And here it is.
It is a success.
It is the, uh, the happy path.
Okay, well, that's good news.
Let's go back to Pipedrive and we'll be the judge of it.
As usual.
Let's go into let's start with looking at the, um, contacts.
Look at that.
We appear to have five people in here and they appear to have email addresses right here.
That's great.
Do we have their organizations?
We do indeed have their organizations.
And finally, let's go over to leads.
There they are in there.
That's when the lead was created.
It's all set up.
We have people discovered and presumably these are real people and real email addresses.
Uh, they've been discovered.
They've been put there in our database by our agent system.
Anything else that we should be checking?
Let's go take a look.
And yes, the other thing was whether it had drafted emails and yes, it has drafted emails.
There are five nice, crisp, concise emails in my drafts folder sent to the different people here,
and they all seem to be quite well written and they don't have hallucinations, and they are exactly
what we were looking for.
And so here you have it, the first of our agents, which is an autonomous AI agent integrated with
many different platforms.
It's integrated with Fire Crawl, it's integrated with Hunter, it's integrated with Google Drive and
with Gmail and with Pipedrive, and then also with pushover at the end.
And all of these integrations are being nicely orchestrated together to achieve a business goal.
A bunch of emails drafted ready for me to review, tweak and send in order to generate new business
from my Agentic business development team.
Fantastic.