Okay.
Moment of truth.
I'm going to run it.
And while it's running, I will talk through what it's doing.
Hang on.
Off it goes.
So we have a new sales manager.
We say you are the sales manager working for comply.
You use the tools given to you to generate cold sales emails.
Never generate one yourself.
Always use the tools.
You try all three sales email tools at least once before choosing the best one.
You can use all the tools multiple times.
If you're not satisfied with the results from the first try, you select the single best email using
your own judgment of which email will be most effective, and then after picking it, you hand off to
the email manager agent to format and send the email.
Now again, I'm really spelling it out here, and you shouldn't need to be that prescriptive because
the hand off description was there.
But it helps to be to be precise.
And particularly as these things get more complex, if you want it to stay on track and to be reliable,
then this is a good practice to do.
So then we create the agent.
We it's a sales manager.
We give it these instructions.
We pass in both the tools and the handoffs.
This is the crux of this.
This is how we separate out that the tools, which is where we it's like a request response from the
handoffs, which is a delegation control is passed across to take care of the rest of the work.
And that is our message.
And we put a trace around it, automated SDR and we give it a run.
And it took about a minute and let's see what came back.
This is the result and it's picked a very short one in the end.
You remember one of them is a very concise email writer.
It does indeed begin, dear CEO.
And it ends, Alice, as we asked for.
And it's given a nice, short, sharp, AI driven solutions that can optimize your business processes.
And so it's nice and crisp.
There we go.
And importantly, we now have to go and look at the trace.
So the trace here it is automated SDR.
You can see how long it took.
It used nine tools.
Let's go and have a look.
So it came in and it used sales agent one and two and three.
And then look at what happened.
It went back and used sales one, two and three a second time.
Load more.
And then this was the handoff you can see here shown.
Then it goes to the email manager.
And then that goes to the subject writer followed by the converter followed by the send email.
And you'll see the control does not then come back.
So you're seeing everything in action here.
The sales manager that's able to to handle things.
And it hands off here.
And the email manager takes the rest of control for the rest of this blue timeline that you see highlighted
in here.
You can see the multiple calls to different agents and the handoff and the use of tools, both wrapping
agents and just directly calling functions.
And that is a satisfying conclusion to quite an interesting example of a genetic workflows and design
patterns.
Okay.
Well, we covered a few of the constructs and concepts with OpenAI agents SDK, including tools and
hand offs.
And the most important thing that I want you to take on board is that it was simple.
It's relatively lightweight.
We we achieved something quite complex, quite advanced, and we did it all in a matter of a few minutes.
Now, some exercises for you as of course, very important that you now come back and spend some time
on this yourself.
That is the best way to learn.
So first of all, go through and identify the agentic design patterns that we used here.
Now, there was a moment in this when we moved from from doing what anthropic would just describe as
agent workflows to something that was really like agentic agents under their definition, although I
think it's a little bit, a little bit hand-wavy.
But still, there was a clear moment.
Can you identify it?
Can you spot what was the change?
The small change that made that difference?
And then try adding in more tools and more agents.
This is a great way.
This is so easy to extend.
This.
Obviously this is calling this an SDR was was maybe a bit of a stretch because it's really just a cold
email writer, but it would be very easy to see how you could build this into something that's much
more interactive and then a hard challenge for you, particularly if you've got some engineering experience.
Figure out if you could turn this into something which is more of a longer living agent workflow, in
that someone could reply to that email, and the agent would then be able to pick up and continue the
conversation.
Have an email based conversation about the company.
Now the hard part about that is handling replies back from SendGrid that we'll need to do a little bit
of research and understanding about things like webhooks and how that will work, and how you'd use
that to trigger this processing, and how would you identify who you sent it to?
So there's a fair amount of stuff in there, but it's engineering stuff rather than much genetic stuff.
So.
So you could be forgiven for skipping it if it doesn't appeal to you.
But if it does, then, then that's a very interesting framework to put in place.
And in terms of commercial applications, because you remember, I do always like to try and bring this
back to how can you apply this to business?
And hopefully I mean, obviously there's the fact that it could be literally a sales automation tool
that could just be working to generate a bunch of different cold sales emails or email campaigns.
And if you were to do this extra hard project, it could in fact be something that engages and continues
the conversation.
And generally, the point here is that you can really apply this to any end to end automation of these
kinds of business processes.
You can think of how you can apply this in this context of sales, but you can think of applying it
to so many contexts.
Imagine my day job at Nebula that involves recruitment.
Imagine how applicable something like this is to that space as well, and many others.
Think of a business area.
Think of the kinds of activities that are done at scale with things like cold sales, outreach, and
picture how this kind of approach agents collaborating with a level of autonomy and with use of tools
and handoffs, can automate a complex business process.