Well.
Hello there.
Today is a blue day.
Today is completing the Business Commercial project as part of week two.
All about accelerating your business or your client's business.
I put it to you.
I believe that today is going to be a day that is going to be relatively low on challenge and relatively
high on satisfaction, but you'll be the judge of that.
Let's see.
Today we are wrapping up our expert product for being an expert for your client.
And we're going to be building our rag agent and our voice agent, of course, bringing back the return
of 11 labs and voice.
And of course, I have to begin one more time with a recap on rag, and this will be the last one for
rag.
But it's always, always good stuff to go through.
There's a couple of times repetition is the best way to learn, but you're pretty familiar with this
stuff now.
The user asks a chat question.
It comes into our code, perhaps running in n810 and the big idea behind rag.
We want to try and look up some useful information, and the way we do it is we use a different kind
of alarm called an encoder, or an embedding model, or a vector embedding model, or, uh, any, any
of those things.
And it takes the text and it turns it into a set of numbers that we call a vector.
And if you're using the very popular OpenAI embedding small, then it comes back with 1536 numbers.
Correct me if I'm wrong.
Uh, and, uh, you can think of that as being like a point in 1536 dimensional space.
And it's done such that you can then go to all of your data sitting in a type of database that we sometimes
call a knowledge base.
And you have indexed it.
You've got all of the bits of data that have also already had vectors calculated for them.
That's what we did yesterday.
So we've got all of these 1536 dimensional vectors.
And we can find the ones that are closest.
And that's likely to give us some material that is going to be relevant to answering the question and
we take that material, we take the original text associated with it, and we send that to the LLM.
And back comes a knowledgeable response, giving the illusion that the LLM itself is, is knows about
everything in the database, because whatever question you ask, we bring back relevant context for
that.
And we learned about chunking and the fact that you typically take your documents and divide them up.
But as it happened, none of our of our documents were less than 1000 characters.
So we ended up with exactly one chunk per row in the Google sheet that we used as our source.
And there are two different phases of Rag.
There's the data ingest, which is what we did yesterday, and data ingest is where you have some source
of data.
And you first of all, extract your data from it.
You transform it in our case with the field mapping node.
And then and then you can chunk it and vectorize it or form vector embeddings from it.
And then you load that into your vector store.
In our case we used a Postgres database in Superbase, the managed Postgres service.
And this is something that can run once as a way to load in your vector store.
But it's common to have this running as kind of live data pipes.
And you could do that in through a few different ways.
You could do it by by having it run on a schedule so that it brings in things on some schedule or the
thing that you could do, should you wish.
And I will really equip you to do it next week is have something that like, listens on a shared drive,
like a Google folder, and then when a new document is dropped in there, it automatically kicks this
whole process off, loads in that document, and then puts all of that document and all of its chunks
into your vector store.
That would be that would be really cool.
And that's the kind of thing you'd actually have running live in production, constantly keeping your
vector store up to date.
And of course, the other side of this is the thing that actually answers the user's question.
The user asks a question, we have an AI agent that can answer it, and the agent has an LLM powering
it that that is used both to actually give the answer, but also to orchestrate how to answer it.
And as part of doing that, it has access to a tool, and that tool is a tool that allows it to vectorize
the question that's being asked, and look it up in the vector store to find relevant content.
And this is, of course, what we call a genetic rag.
And you could also equip it with other tools to dig through the data as well.
And so that is the second phase, which is what we'll be focusing on today.
And as well, you know, the the business challenge that I set for this week is this kind of classic
business, uh, commercial opportunity for for genetic AI, for generative AI, which is an expert question
answerer that's able to to answer questions as if the LLM knows all about your business or in our case,
all about the products that your client offers and can answer any kind of question about these products.
And as I say, so classic, it's so clear to see how you can use this to accelerate a business, to
be able to have workers effectively at the business that are able to do the more manual, more menial
tasks.
By manual, I mean the more sort of manually intensive Tasks that should be ripe for this kind of solution.
And for for our solution, we're using Supabase.
It is a provider, a cloud provider of Postgres, which is a very common, scalable relational database
used by, by by, by many enterprises.
It's, uh, we're using some sort of advanced approaches, but we have to we have to copy and paste
in that code, that slightly janky code.
And I promised you you could just generate that with ChatGPT if you had to do it on your own, and it
would do it for you.
It could explain it to you, it can fix it if there are problems.
So whilst this is meant to be a low code, it's not a no code.
It's a low code course.
So I hopefully don't do too much coding.
That was one moment when we looked at it, but it's it's cookie cutter stuff.
You can use it anywhere.
And we worked on the data ingest side of the house yesterday.
We did some interesting work to do that, that field mapping.
If you remember, transforming data from one format in the Google Sheet to the format with a content
and category that we wanted to put in our vector data store.
And that is done.
And we've loaded up our rag, our knowledge base in our Rag project in Super Base.
It has 60 rows, which all have vectors with 1536 dimensions.
I hope I'm getting that right.
Uh, and we've got all that in there.
Remember those dimensions?
The clever part comes from the encoder, from the OpenAI embeddings.
Small model.
That's what did it.
And our mission for today, of course, is to add the questioning, questioning question answering part
of this and then add a voice agent and then we will declare victory.
Well, here we are back in town, and it's time for us to take a final look at this beautiful ingest
pipeline and then make sure that you've saved it.
And then go back to this screen and it's time to create a new workflow.
This is going to be the home of our question answerer, our Agentic AI.
And we're going to start this time by having a first step that is going to be a good old on chat message.
Our original, our original and favorite.
Uh, there it is.
When chat message is received.
We know this one.
Well, that's how we will begin.
And you know the deal.
The next thing we do is we hit tab to add a node.
We want to add an AI node AI agent and then press escape.
And here it is.
And for once it's good to leave that uh, if I double click, it's fine to keep this connected chat
trigger node and JSON input.
That's exactly what we want.
You now have a better idea about what that means and why it says that.
Uh, so, uh, let's leave that go to chat model.
I guess we'll go with Gemini again.
Gemini chat model.
Of course, you could pick whatever chat model you want.
Use open router if you like that.
Uh, and we will go with models slash Gemini three flashcards.
Preview.
There it is.
And, uh, that's the model we're picking here.
Memory will just use a simple memory.
And it's time for us to add in the tool.