Introduction to RAG
Now we will focus on RAG—Retrieval-Augmented Generation, or chat with your document. How are we going to do that?
Don't forget to give us likes, leave your comments, share us with your friends, and also subscribe to our channels. We have YouTube, LinkedIn, TikTok, and Facebook.
Managing Documents in the Admin Workspace
So just for clarity, to start the RAG application you start with the admin portal, come to Workspace, and you will have tabs on the top. You will go to Documents. This is a place where you will upload. I'm not sure if it's uploading, but you tell this program that this is a document that you want to put into RAG.
I'm not sure whether behind the scene it is going to copy it to a local folder or not, but I don't want to go into the detail just yet. But this is how you are going to do it. And when you do it right, you can manage your document well using hashtags. As you can see here, these are separate documents. And imagine if you have hundreds of documents, without proper hashtagging, it's going to be wild, right?
I group everything that I have uploaded here so far into 'MBA marketing'. So maybe you will have like 10 or 20 documents for some of your usage. Maybe HR about hiring a new person, if it's Human Resources, or HR about payroll, or HR about company policies. So make sure you use tagging correctly because it's going to help you a lot.
Uploading and Tagging New Documents
Now let's go through a process of adding more information. Here we go. You click the plus button on the right-hand side, and you can click here to select documents.
So I am going to make a demo with—I already added accounting but I want to—wait, sorry, is it accounting? Sorry, I added marketing. I am going to add accounting.
So, I can select everything here, click open, and to manage, don't forget to add the right tag. So click here and make sure that you can type. So I will put MBA, this is accounting, and enter. Make sure you enter. You can add multiple tags. Go experiment with multiple tags; I think it will be useful. Or, yeah, I'll just leave it at that, and you can click save.
Now it's going to upload things. Here we go. It has uploaded accounting. See, over here I have a whole lot more list. Now you can manage by using filter as well. So I'm filtering with accounting, I'm filtering with marketing, right? I haven't really used this yet, but I think this is enough for you to get started. All right, there we go. I have uploaded documents in order for me to use RAG.
How to use it? To use it, let's try with an admin account first. So, first you need to select a model. Let's say I am going to select GPT 3.5 Turbo. To use RAG what you need to do is provide a document, right? How are you going to provide a document?
You can provide documents through this upload button here, upload button, but you have to do that every time. That's what I'm trying to say, you have to do that every time that you are needing this. So for example, if I want to—so this thing is about merger and acquisition. So I can add it to this chat manually. And I can ask, "Tell me the difference between merger and acquisition."
So it's going to provide an answer based on the document that I provided, right, having a reference here. But this is manual. It's good for just one-off RAG application. But what about the documents that we uploaded? We uploaded it because we want them to be accessed, we want the users to be able to access it a long time. It will be available all the time.
Querying Persistent Document Collections
So how are we going to do that? Through 'select a document.' You need to start with the sharp (#) notation. Sharp notation allows you to select whatever document you want to use as a context for a RAG application. And the reason why I want you to use hashtag is this: you can actually select it better. If it's about marketing, you just want to make sure that you search in marketing-related documents only, not all documents, right?
So here we go. I will select the whole collection. So I can ask, "What is 4 Ps?" How about that? So 4 Ps refers to four factors of the marketing mix that a company must consider in order to create a strategy. Marketing strategy is Product, Price, Place, and Promotion. And these are the references. You can click it; it is actually information text inside the document.
This is basic, right?
Understanding Open WebUI's RAG Limitations
You provide—this document processing is basic. I provide a document which can contain images, graphs, and text. Open WebUI will only do basic processing, meaning extracting only text inside the document. It's not going to do image-to-text or any kind of enrichment at all. So the RAG that you get from Open WebUI this way is going to be the bare minimum, but at least it gets you started. So if your document contains high-quality text without a lot of information being kept in graphs or images, this is going to be really good for you. There we go. This is RAG.
The User Experience and Final Conclusion
So I have tested RAG in the admin portal, admin page. Can my user use it? So right now I am in my user interface, right? Can a user use it? Let's do the same thing. I pick GPT 3.5. I want to do RAG. I press sharp (#). Maybe I just want to refresh.
Okay. So I'm only seeing 'MBA marketing'. It could be because I just added 'MBA accounting' into the document. Then this interface needs to be refreshed maybe in order to see that. So let me just try to refresh it. Refresh. Here we go. Try GPT-3.5 again. Press sharp. And there we go. So anytime, every time that you add a new document, the user is not going to see it right away. The user needs to refresh the page so that all the information is now updated.
Alright. Similar question: "What is a marketing mix?" A marketing mix is a combination of four fundamental factors: Product, Price, Place, and Promotion. And these are the retrieved context or relevant context that it thinks it should retrieve to answer this question. Alright.
Now you have seen that RAG with Open WebUI is extremely easy. You just need to provide documents, right? So we have nailed this one.