I gotta tell you, I don't like to toot my horn a whole lot, but I do think that I've done a great
job with the project for this week, and I enjoyed it so much.
And it's running now and I love it.
I absolutely love it, and I can't wait to get into it and show it to you.
And let's start, as always with the introduction.
But very quickly we're going to get to code because that is where it's at this time.
So we're going to go deeply into a gigantic I.
It's such a hot topic.
It's something that everyone can't get enough of right now.
And so it's worth it that we really go deep and get into it, and we use it as an opportunity to learn
more and more about the different components of LMS that we've worked on already over the last seven
and a half weeks.
So what we're going to be doing today is talking about agentic workflows, agent frameworks, and then
we're going to build an agent framework.
We're going to do it today that is able to send push notifications with information about great deals
that it finds based on looking at RSS feeds.
So it's really putting all the pieces together into a solution.
So before we do that, let's just quickly talk about what what is what exactly is Agentic AI and agent
workflows and all of this.
And I think the truthful answer is that it's one of these ambiguous terms that still emerging and somewhat
overused by different groups.
So it's used to mean a number of different things.
But I think if you take a step back and I did mention this when we touched on it briefly in a previous
week, uh, but if you take a step back, you can think of the hallmarks, the key aspects of Agentic
AI as having these five pieces to it.
And no doubt there are some things that some people say it's more than this, and some people will say
it's less than this.
But I think that the these are the big five.
So first of all, an agentic solution is one that is able to take a larger problem, a more complex
problem, and divide it down into smaller pieces that can be executed potentially by LMS and maybe just
by normal bits of software.
But that ability to take a harder task and break it down is certainly a hallmark of agent solutions.
The use of tools, function calling and structured outputs that we've covered at various points along
the way.
That's also something that often falls into the remit of an agent solution.
Is this idea that you're giving an LMS something that's more than just a conversational here's a prompt,
give me back a chat response.
But it's something where it's fitting into a tighter construct.
We need outputs in this particular JSON format.
You can call these different functions to carry out different activities.
So that's how that fits into Agentic AI and environment.
A framework environment.
The different words for it.
But some kind of a of a of a sandbox in which, which provides some functionality which all the different
agents would be able to take advantage of.
The classic example of this would be something like memory.
If there's something where all of the agents can share in some bit of information that reflects what's
happened in the past or something like that, that would be an agent environment and just something
which allows different agents to call each other in some way.
Uh, and then typically and again, this, this one is an example of something which isn't a must have.
It's not like without this you don't have an agent solution.
But you often see agent solutions having a planning agent, an agent that's responsible for figuring
out what tasks to do in what order.
And again, I think normally when people talk about this, they're thinking of that planning agent being
itself an LLM that's able to take a task and figure out, all right, I want to do this and then this
and then this.
But it doesn't have to be an LLM this.
If it's a simple problem that just has five steps to it or something, then you can just write some
Python code that calls those steps, or it can be a JSON configuration file or something.
But there's got to be something which is considered your, your, your planner to tick this box and
not that it's necessarily required, but perhaps the last one here, which is the one that we've not
really done much of to date, is the kind of key.
It's perhaps a single criterion that does distinguish between something that's agentic and it is not,
and that is autonomy.
That is this idea that your agentic AI solution has some kind of a existence that transcends a chat
with a human.
So we've we've had memory before because we've had Q&A chats like our Rag solution when we when we had
a chat that talked about the insurance company and obviously it had memory there, and we've had other
examples of that too.
Even our airline chat had memory, but that's not really considered an autonomous AI because that.
Memory only existed where we had that app running and while the human was interacting with it.
It didn't really have any kind of a of a presence beyond that.
So this idea of autonomy is some.
And some kind of a sense that this, this thing has an existence that is more permanent and.
Say, is running behind the scenes.
Now, that might all sound a bit magical, and it's not at all.
As you'll see, basically, if you've got a process that's running, that's carrying out some activity.
That doesn't necessarily need human interaction, that in itself is good enough to say, okay.
That sounds like that's an agent solution.
So in a nutshell, it's not like there's one super clear.
Definition.
And a lot of the times when you're working with an AI solution that is solving a harder problem involving
multiple models Involving coordination between them and in a way that isn't just a prompt and a response.
The chat interface that we're so familiar with, anything like that is considered an agentic AI solution.
Now there are a bunch of frameworks which offer agent capabilities.
Langshan has a bunch of agent abilities.
There's agent tools that you get with hugging face.
Gradio has something and there's many others.
Some of them are what they call no code.
So all you're doing is stitching together different, different models.
Some of them are have more code involved, like like a Lang Chain's offerings.
But one of the points I wanted to make to you is that many of these platforms are putting on abstractions
around Llms, much as Lang Chain did for Rag when we came across that before.
And really to be building these kinds of agentic AI solutions, you don't need those abstractions.
We know how to call Llms directly and we can just do it ourselves.
We can have LMS running and we can send the right information to the right.
LM as now a master of LM engineering, almost 5% away from being a master of LM engineering.
That's well within your capabilities.
So actually for for this session, as we get in and build our Agentic AI framework, we're just going
to be creating these agents, as you already saw those classes and have them operating ourselves using
Python code.
We're going to collaborate them, stitch them together with our own code, which is a great way of doing
it, and which also gives you deeper insight into what's happening.
And we can actually see what information is being passed between the agents.
Um, but of course, you can also use one of the more off the shelf, uh, more abstraction layer products.
If you wish.
You can you can look up any of the ones that's available from, from Langshan or the others.
Um, and it might be an interesting exercise to then redo some of what we're doing.
It was it would probably be quite, quite straightforward to do it using one of those off the shelf
products.
But for us, we're going to get to the nitty gritty.
We're actually going to go and build our own little agent framework and have multiple llms participate
in solving the problem that, you know, we're setting out to solve, which is scraping for for good
deals on the internet and messaging us when it finds them.
Let's remind ourselves quickly of what that framework looks like.
What is our architecture?
This is the the the workflows that we're putting together.
Um, we have the three models that are running and an ensemble agent that calls them.
This is an example of perhaps a bit of a stretch, because an ensemble model that calls other models
is something that's been around for donkeys years.
People haven't called that Agentic AI in the past, but since we do have these running as separate classes
in their own right that have the same construct and the same ability as you'll see to log and to be
participating in this framework, it kind of makes sense to think of these as separate agents in their
own right, and we could be running them in different Python processes if we wish to.
But for simplicity, I just have it just be being called directly, but we certainly could do.
Um, so I have chosen to suggest that these are separate agents that carry out these three different
models, and that we have an ensemble agent that calls each of these agents, collaborates with them,
and then applies the linear regression weights to give an ensemble of a price of a product.
The scanner agent is what we looked at last time.
This is an agent.
We ended it by by calling the scanner agent.
It's able to go out, collect feeds, and then call Gpt4 zero as its way of finding out the good pithy
description of each deal and the price point associated with it.
And it collects that together.
And you may remember that it had an input memory, which is part of the glue of how we're going to glue
everything together.
The memory is where we tell it not to surface a deal, that it's already surfaced in the past.
And what we're going to look at today are these boxes in yellow that bring it all together, that we're
going to look at a messaging agent, a very simple thing that's going to send push notifications to
your phone, which is going to be delightful.
A planning agent which is able to coordinate activities.
And it's not going to be an LM, it's going to be a simple Python script, but it easily could be an
LM.
And then the agent framework, which sounds super fancy.
Uh, it's not fancy in the least.
It's just simply something which has all of these agents and which can allow messaging to go on.
And that's going to be our agent framework creation today.
And then tomorrow we're going to build the user interface that that wraps it all together and makes
it look fabulous.
But I hopefully have motivated you enough to be ready to go.
I will see you in JupyterLab.