Hi everyone.
Welcome back.
Today we are diving into RAC which stands for Retrieval Augmented Generation and is a powerful technique
that makes AI agents and automation way smarter.
By the end of this lesson, you will know what the RAC is and why it's used so useful, how it retrieves
and generates information dynamically, and how to build a RAC powered workflow in an A-10.
So let's jump right in.
First, what is retrieval augmented generation?
Think of it like this.
Large language models only use what they have been trained on.
So if you ask them about something new, they might just guess or worse, hallucinate.
So RAC fixes this by adding a retrieval step before generating a response.
So retrieval means it fetches the most relevant up to date info from databases, documents, sheets,
APIs, etc..
Generation means the AI then uses that info to create a better, more accurate response.
For example, imagine you ask a powered assistant about today's stock prices.
A normal chatbot like ChatGPT might give you outdated info even if you are using ChatGPT search.
It might still make mistakes.
That's why it's better to use perplexity for searching the web.
Now why is that important?
So most llms have a fixed knowledge base.
They don't know anything after the last training update, even if they have access to tools and the
internet.
They don't have access to your internal private documents, right?
So if rack, we can use external sources of data instead of relying on outdated training data, you
can pull in real time information like stock prices, news or customer support data.
And rack makes AI more accurate by reducing hallucinations.
All right.
So now let's break down how rack works in simple terms.
Imagine you ask your rack powered AI assistant a question.
Let's say what what's the latest refund policy for my company?
First the LLM.
So your AI assistant brain analyzes your question and figures out what information it needs.
Then instead of making an answer straight away, it searches through connected data sources, and this
could be internal documentation, a database or a knowledge base.
Then the system retrieves the most relevant information related to your question.
And then the LLM combines that information with its own language understanding to generate a factual
and relevant response.
And finally, the AI gives you an answer that's backed by real data and in some cases even includes
references to the sources it used.
For example, instead of saying I'm not sure, an AI assistant followed by RAC for customer support
retrieves the exact refund policy from company documents and provides an accurate response to the customer.
It will be much easier to understand by looking at this diagram.
Um, so let's say a customer asks chatbot, what's the warranty policy for my new laptop and assistant,
powered by rack handles it step by step.
So the customer types the question into the chat.
Then the chatbot processes the request and determines it needs warranty details.
So instead of relying on old pre-trained responses, it performs a real time search.
So it retrieves the latest warranty policy from the company's internal database and if needed and if
needed, it checks the company's online help center for updates.
It can even search the web for manufacturer Enhancements or regulation changes.
So the assistant gathers the most relevant data.
And then generates an accurate response based on the latest information.
So the customer instantly gets the most up to date answer without needing to call support or search
manually.
It's really helpful because if the company updated its return policy yesterday, the AI assistant powered
by RAC will instantly reflect the changes.
Now, how does RAC work in your company?
For example, imagine you build an AI assistant for your company's customer support and sales team.
And is powered by RAC.
And in this scenario, a customer asks what are your refund policies?
Instead of answering I don't know, like ChatGPT might.
If it lacks the data and it's not fine tuned, or it can hallucinate and give you a random response.
Instead of that, your AI assistant powered by RAC retrieves the latest refund policy from your company's
knowledge base or internal documentation.
So it summarizes the key points like refund eligibility, like required steps, etc. and the customer
gets precise and up to date answer.
And it really reduces confusion.
Now let's jump into N810 and explore the components of RAC Powered assistant.
You can build this RAC assistant relatively easily in N810.
And I will show you exactly how in the next lesson.
It might look complex, but trust me, it's super simple.
And this particular example is very practical and very useful.
So here is how it works step by step.
Assistant which is our tools agent.
This is the core of the workflow.
So inside it has a system prompt which is a set of instructions that tell our assistant what to do.
It decides how to process a user queries.
So basically what we expect from this assistant to do.
Next we have chat model.
So OpenAI chat model.
This node is the brain of our assistant.
Inside this node we can select.
Between different llms.
And this is the AI that actually generates responses.
It doesn't just guess it waits until it has the right information before answering.
Not based on the ChatGPT general knowledge.
Now Postgres chat memory.
So this acts as our assistance persistent memory.
So it helps our assistant remember past interactions with users, which makes conversations feel more
natural because it knows the context of the conversation.
Now we have Supabase vector store.
This is where all the company knowledge is stored.
Basically, this is part of a vector database.
We'll dive into vector databases later.
For now, just know that it acts like an AI powered search engine and helps our LLM retrieve the most
relevant information before the chatbot responds.
Now embeddings.
This node is basically the setup which converts text into a format that the AI model.
So large language model can search through quickly.
It turns human language into numerical representations.
So when a user asks a question llms search through embeddings to find the most relevant data in the
vector store.
So we'll explore embeddings in more, more detail later.
But for now, just know that they help.
I understand and compare text efficiently.
Now let's talk about how react keeps AI models.
So large language models are useful.
So most AI assistants either guess answers or rely on old pre-trained data.
That's a problem if you need real time accurate info.
So react solves this by pulling data from the right place at the right time.
Basically it search internal documents.
Let's say an employee asks how many sick days do I get?
So instead of just making some random response, our assistant checks the official HR handbook and delivers
the exact policy details.
Our RAC powered assistant can retrieve web data.
So, for example, if a customer asks what's the latest price for this laptop?
Our assistant doesn't guess.
It pulls live pricing from the store's website and provides the real answer.
Now, it also adapts to fast changing industries like a finance assistant.
Let's say it gets asked what's the new tax rule for freelancers?
So instead of giving outdated info, It retrieves the latest IRS update and provides an accurate response.
So in most cases, instead of guessing or saying I don't know, it fetches the answer from the right
source, which is really useful.
So now these are the most popular use cases for using crack.
Where does crack actually make a difference?
First of all, in customer support, because instead of a chatbot giving a generic check our website
response, it fetches real answers from past tickets.
Frequently asked questions.
Past conversations.
Customer history, etc..
It is also very useful in chatbots and virtual assistants.
Think of a virtual assistant that doesn't just repeat old info.
It grabs live updates on news, weather or company policies before responding.
It's often used in education and research.
So for students looking for a concept or a lawyer searching for the latest case law, react can retrieve
the most relevant documents very quickly.
It is also very useful in e-commerce, so it can check livestock availability and even suggest personalized
recommendations based on past orders.
It's well known in finance and banking, so customers don't need to dig through statements.
I can instantly retrieve account balances, low options or interest rates in real time.
Next, healthcare and insurance so it can pull up your actual policy info before answering.
And lastly, legal and compliance.
So instead of providing outdated info, it can grab the latest regulations and contract updates before
giving an advice.
All right, so let's wrap up what we have covered today.
RAC retrieves real data before generating answers, which makes Nlm's responses way more accurate.
It can pull from internal.
It can pull data from internal documents, websites and databases, keeping responses more accurate
and up to date.
Assistance powered by RAC can give you real, useful information, and you can build RAC powered assistance
yourself using N810 relatively easily.
The next lesson we'll dive into N810.
So stick around and let's start cooking.
See you in the next one!