A RAG workflow answers only from documents you provide and says so when the answer is not there, unlike a plain LLM that risks hallucinating.
0:00 Hey, my name is Annie. I'm a tech consultant based in Stockholm. And in this tutorial, I will help you to create an NHN workflow using RA. The first thing first, let's understand what is RA and how it is different compared to usual LLM. When we ask a question to chat GPD, which is an example of LLM, CHVD will answer based on the information it was trained on. However, if we are creating rack, we are giving rack certain database or documents to look and retrive information from and it will always say that it doesn't have an answer if it can't get the answer in those documents. Compared to that, LL for example GBT will always answer and there is a certain risk of answering wrong which we call hallucination.
1:01 Now back to animate end and here what we will do we will create a whole new workflow together. So I will click on plus button then workflow and here we will choose agent. So this one and we'll double click on that. Okay, you can see that we have the chart and then we have the I agent here. We will enter a break for I agent and you can choose the LLM that you like to use. In my case, it's Antropic. So, I will just choose entropic and you can see that I already have my credentials to Antropic saved here. So, that will be added. Next what we need to do is we need to use a vector database where we will save our documents.
1:57 Now the question is what is a vector database? Compare to general relational databases in vector databases we'll process every single word or combination words and we'll give them different vector points in multi-dimensional environments and for example different words that have similar meanings for example king and queen will be saved close to each other. So when we search certain words from vector databases, it will return words that are close to each other. So for example, if we search for jacket, it will also return code. So that's what vector database is. So in this tutorial, the choice of vector database for me is pine cone.
2:47 And the reason I'm choosing Pineon is because it's not only a database, but it also has an agent connected database. So, Python also has a free section. So, you can just log in and use it in the beginning for free. You can see starter usage and you will go on assistant button and here you will create an assistant. You can call for example NM and you will just click on create assistant and that's it. Your assistant will be created and what you will do in here you will save the files that we want to use for rap here.
3:33 So you will for example click here in my case I have snowflake document that I uploaded that I want to use for this purpose. So I will just save my snowflake document there. Here I will click import and document will be saved there. Okay. So you can see that snowflake documentation was uploaded and after that what we will do we will click on connect button and from here we will change Python to share and we will scroll down. You can see the code here that is used to connect to Python agent. So we will copy everything except icon API key and then we will go back to N10 and here you will need to create an HTTP request because this agent needs to be able to connect to Pyon and for doing that we will just click on the plus button and we will search for HTTP request tool.
4:36 So here it is and here we can just click on import and we can just pass our code. If we click on import we can see that everything will be populated here which is amazing except the API. Another thing that we need to update in HTTP request is content. And content is basically what the user enters into the chat. So if we go here, if we go to mapping from here, you can see that the content should be chat input and in this case it's tell me about snowflake data share and how you will enter it here.
5:21 You don't even need to type it. You can just drag this chat input into here. But I have already done that so I will not repeat it. So that is done. And another thing if you want your answer to include citations then you will even include this part include highlight is to true. You can get more information about this in Python documentation. And of course Pyon has an API documentation. So if you want to make this even more specific then you can just read Pyon documentation and update this based on your needs. So that is done. And another thing if we open I agent. So here we need to enter system message.
6:06 So this is something that you need to update. And in this case I'm basically saying to Pyon tool to be very specific and to mention from which page and from which document it is returning the answer. So you can read it here. And of course I will be sharing this N10 template for free. So you don't need to type it on your own. So that's it and let's save this workflow and let's try to test it. I will ask about snowflake share. So I will ask question tell me about snowflake share and hit enter. And then after that let's see what is happening. You can see it says snowflake documentation. Okay it's giving basically all the pages that are in this document.
6:54 It's specifying exact page but it still says what are the key features how it works for the agent. We can see what is then the exact output even here simply applies collaboration reduces storage application issues realtime access to Jassy data. You know what we can do? We can just copy this and we can open that document from where it is extracting the data the snowflake documentation and try to find this information to see if this information exist in the snowflake documentation or if our dragon lm is just hallucinating. So here if we do ctrl f and we will try to enter.
7:43 Okay, here you can see so it was basically getting the information directly from this document and it wasn't hallucinating which is an amazing sign that our workflow works. Yes, but that is what I wanted to share with you. And as always, if you want to get this NAT template for free, just comment NAN down below in the comments and I will send you a link that you can use to get this template for free. And have a good day. Bye.