Step by Step: RAG AI Agents Got Even Better

Nate Herk | AI Automation · Intermediate ·🛠️ AI Tools & Apps ·1y ago

Key Takeaways

This video tutorial demonstrates how to build an improved RAG AI Agent using n8n, a no-code automation tool, with a step-by-step guide on creating and connecting Postgres and Supabase databases, and setting up workflows.

Full Transcript

in this video I'll be walking through step bystep how to build out this rag AI agent system that uses postgress and super base what we're building today is a little bit more improved version of other rag Builds on this channel and we'll dive into why you want to set up your foundation like this in order to have a rag system that's a little bit more production ready and make sure you guys stick around to the end of this one because I'm going to go over some tricks in setting up the workflow so that anytime a new file is created it's automatically going to go into your super base as well as if you update any of those old records it's going to replace them in your super base so that you know you can always trust the data that you're talking to so here's the rag agent that we'll be working with today if you're unfamiliar with the term rag or you've just sort of heard about it it stands for retrieval augmented generation and it's as simple as the agent here's our question it has to go out somewhere to retrieve that information then it takes that information back generates an answer and then gives us that nice clean answer so retrieval and generation are kind of the two main parts of retrieval augmented generation you can sort of just think about it as if someone asked you a question and you're not sure so you go and Google it and then once you understand the information you give them back back a response but anyways here is the system we'll be building today here's a look at the old one that uses window buffer memory as well as pine cone so I'm going to break down you know why I think postgress is better than window buffer memory and we'll talk about the differences between super base and pine cone but before we do that let's just hop into a quick demonstration so I've already went ahead and uploaded this document to our Vector store which is just information about a fake project called project Mountain so we're going to hop in here and we'll ask the agent what are the action items for project mountain and who are the parties involved so we'll send this off we'll watch it take place and as it's going on I just wanted to mention real quick both of these workflows that we'll be going over today will be available for download in my free school Community Link for that will be in the description you'll just download that Json you'll come up here and then you'll import from file and you'll have the stuff up and running ready to go and if you're looking to take a automations a little further and you want some Hands-On learning experience and help then feel free to join my paid Community Link for that will also be down in the description and then if you're sort of a small business or you're looking to have me Implement these systems for you have me build them out for you then please book a link in my um website which will also be linked down in the description but let's take a look and see what this um agent was able to respond to us with so it said here are the action items for project mountain and the parties involved um as follows so we have collect feedback samples we have Sarah doing that we have metrics which will be John it's giving us due dates as well and then it's basically just summarizing everything that's going to be going on within this project and sort of the timeline going on with it um so we can go into subbase real quick and obviously here's the quick vectorization of the project mountain and then we also have our post Cress memory in here where we can see the human asked what are the action items for the project Mountain who part is involved and then we can see the AI responded with this information so that's sort of how this is going to work um real quick before we get into the actual step by step we have this interface obviously where we're talking to the agent and then we have this workflow that's going on in the back end which is um automatically putting stuff into super base based on um a Google Google drive folder and then also anytime a file in there is updated it's also um updating that record in super base as well as deleting the old record so that we're only interacting with relevant upto-date information all right we're about to get into the step by step so if you want to skip this part feel free but I'm just going to break down the difference between postgress window buffer memory pine cone super base at a really high level so first of all why is postgress going to be better than window but for memory the first thing is about data safety and persistence so postgress SQL is sort of how we're putting the you know the chat memory like we just saw and it's going to keep your data safe even if nadn or your system restarts because when you use the window for memory it's sort of temporary and then it's going to wipe everything when closed so even the window buffer memory is super super easy to set up because if you can see in here if we unconnect this and we go to window buffer memory that's all it is it's no credentials all you're going to do is set your context window length but you know in postgress you have to connect your credentials and make sure everything's set up but it's still not too difficult but that's one of the advantages of the window buffer memory second thing about postgress is that it's scalable for Big Data so it's going to handle large data sets more efficiently and you're going to be able to search through them using powerful tools like indexing um which is obviously very important for rag workflows especially once you get more documents and more things um to chat with and then finally easy integration and long-term use post gr postgress SQL is going to work seamlessly with n 's databases it's obviously got nodes that are going to support multiple users and it's just going to be really reliable and you know future proof as you sort of add on to these workflows next we're talking about real quick super base versus pine cone obviously I've been using pine cone a lot and it's great so we're just kind of breaking down the difference so first of all the purpose super base is sort of a backend platform with um it also has built- in relational databases whereas pine cone is sort of more of just fully managed on Vector databases um which is really good at you know their Vector search and similarity queries for scalability subase is going to be better for small to medium scale Vector storage because they also have those relational queries and relational database um Integrations as well whereas pine cone is going to be more large scale Vector searches billions and billions of vectors you know different indexes different um name spaces to search through that sort of thing hosting subase can be self-hosted or used as a manag service while pine cone is going to be sort of a sass so there's no self-hosting option there and then for the use case to base ideal for um you know relational data metadata Vector search while pine cone is more for the like I said large scale Vector search with sort of minimal operational complexity so now that we understand that um I hope that makes sense as far as you know future use cases when you're trying to figure out what to use here and there what to plug in but now let's get into that step-by-step build all right just to open up a new workflow the first thing that we're building out here is the rag agent so we're going to come in here obviously and grab an AI agent we will leave this one as a tools agent and as far as system prompt um for now we will just basically say your helpful assistant you will use the vector database to retrieve relevant information and respond to the users query um and for now that will be simple enough cuz the only tool we're really plugging in is um you know the vector store so we we'll leave it as this for now um we're going to connect our chat model open AI um I'm going to use 40 mini for this case it's um you know it's it's powerful while being a lot more cost effective than 40 um and for this use case it will be fine you know as we're sort of just demoing but you know as you get more data you need to search through and more complex information you could probably go to for or um you know Claud so from here we have memory obviously we talked about the difference between um window buffer memory and then postgress so we're going to be doing postgress in this case and you need to obviously connect to your account so what you're going to do here is create a new credential you'll come in here and you'll see that you have this information to configure which is definitely a little more daunting than um setting up window buffer memory but it's not too bad so let's hop into super base so that we can get this information we need so if you haven't created a superbase account go ahead and do that real quick so once you're in superbase it's going to prompt you to create a project so you're going to come in here you just need to name your project you need to give it a password um make it stronger okay need to be even stronger than that okay and then you have to remember this password obviously so you can copy it want to put that somewhere safe because this is going to help you set up stuff in the future um I'll just going to leave this as default and then we'll hit create new project okay it will probably take a few minutes to set up your project as you can see up here it's setting it up still but you can see some things like um we have our API keys so obviously we'll use this later when we're setting up the super super base Vector store tool within nadn but we're waiting for it to set up some information as you can see it just went through okay so once you got that project set up you're going to go down to the left hand side click on Project settings you will go to database right here and then you'll have this screen pulled up and this is the information we need to set up the postgress so we can see host we're going to grab that real quick Copy it over paste it into host we will go to um our Port grab that and then this is going to be down here at the bottom we'll plug in the port right here um what else do we need the database should always be postgress so we need to grab our user which will be right here we will paste that into there and then the password as you can see that's just um the password you typed in earlier so let me do that real quick and once you put in your password hit save and then you'll see connection tested successfully let me just call this one real quick demo so we have this set up here and now once that's configured we don't really need to change anything else here the table name is just going to be the table that goes into um our super base that we can look at our chat history so we can leave that as is and then context window length just how many interactions the model is going to be looking at for context so five should be fine if you want to bump it up to 10 or 20 you can do so let's just go with 10 for now and that's basically it so we have our memory set up every time we talk to the agent and the agent talks to us the memory will be put into our super base um in a table called NN chat history I think it was so now let's set up the super base so obviously we're going to be adding a tool and we're going to type in Vector store we can see Vector store tool right here we need to name this so we will just call this um what are we pulling in Project data so I'll just call this projector data we will also do the same up here and then we need to obviously describe what this tool is so it's going to retrieve information about the projects and so that should be good for now um we've got project data now we need to obviously connect to model we're going to go with for minu once again and then we're going to go into Vector store and we're grabbing superbase and we need to set up these credentials as well so we'll click create new credential we need to get a host and a service R secret so back in um subbase you might see host here this is not what you're going to grab you want to go to the leth hand side go to Project settings you're going to click on API and then up here this URL that's going to be the host so you copy this you'll paste that right in there and then in here you need to click on for your service Ro secret you'll click reveal you'll copy it paste that into um you know obviously this section right here so let me do that real quick okay we got the huge service R secret po pasted into there we'll hit save should go green we're good to go and let me also just rename this one demo we got the credential set up and now obviously the operation is in this case we're retrieving documents but now we need to set up the table so if you come in here you will have no results because this current project that you just connected to you haven't set up the table yet yet so what we're going to do is click on docs right here it's going to pull up the NN docs and then we have a super quick start for setting up your vector store so you're going to click into this and we have this chunk of code right here all we're going to do here is hit copy we'll go back into super base and we're going to go to our SQL editor over here on the left side we'll paste this in that's all you have to do is paste it in you could go in here and change stuff if you want the table to be named something else if you want to change some of these matching criteria but I don't touch anything you're just going to hit run and you should see success no rows returned so now once we go into the table editor we will refresh and we should see right here a table called documents so this is our documents um Vector store that we'll be putting information into we'll get records filled into here that we can look at once we actually put documents into it so that's there and then also another one right here will pop up that's the one that will be ended in chat history and we can see what we've been been saying to the agent but anyways back in NN now we need to choose the table we should see not yet so let refresh and ITN real quick okay now that we refreshed it we should be able to come in here see our table which will be documents we're going to grab that and then we need to add an option of query name and leave it as match documents so we're good to go here um all we need to do now is set up the embedding so we're going to set up um text embedding three small which is kind of the default right now so we've got that set up we'll hit save um if you've watched some other videos with pine cone when you're actually setting up your index you will see an option to choose the embedding that you want in your vector store so that's when you'd set up embedding three small and then you'd want to choose that one in here as well but in sub base you don't actually go through that process of manually setting that up but we're going to do embedding three small so hopefully um not any confusion there but this is going to be it as far as the agent um you know there's no information in there so if we said like what are our projects looking like it's obviously not going to return anything because we haven't built out that workflow that is going to um so it actually went and searched but it's not going to return any actual information it seems I'm unable to retrieve information about our current projects so now we need to go through the process of you know actually putting information into that Vector store okay so in this workflow we're going to start this one off with a Google Drive trigger um we'll come into Google Drive the trigger is going to be on changes involving a specific folder so we'll grab that you need to set up your credentials um I've walked through this in multiple videos early on um also in my NN master class but if you don't understand you're basically just going to go in here you can click open docs and it will walk you through exactly how to set up your Cloud account um you know set up your your credentials your o consent screen that kind of stuff and it's it's super simple so you go into there do that the first thing we see is that once this trigger is active so the workflow is not active yet so it won't be doing this but when it when it is active every minute it will be checking in this folder so it's going to be looking for changes involving a specific folder which we will choose projects oops projects as you can see in here we have my folders called projects with project mountain in it that we used in the demo and then we're looking for a file created so anytime a file is created this will go off and then the logic will take place to upload it into Tu base and as you can see right here we've got project mountain right there so this is the correct folder and we know it's working and so we can move on to the next step which is going to be we want to set the ID from from the um file that's being pulled in we want to make sure that we have the the ID of the file that's that's coming through so that we can download it and then we can also put the ID into the metadata of subbase so that later when we want to update a file we can grab that metadata in order to to delete those records and then upload the new one so in here we're going to be doing a string we will just call this file ID and then we're going to drag in the value so you have to look through you know all the information that's coming back and it may may look intimidating so we're just going to close out of this stuff what we'll be looking for is near the bottom um we're looking for the spaces ID so you see an ID right here permission ID you're not going to grab that one that will not actually link to the um correct document and if you want to make sure you're doing it right we're going to grab space's ID but if you want to make sure you're doing it right you can go to the Google Doc um that you're actually pulling into that um folder and in the URL you will see this ID so that's how you know that it's referencing the correct document and also later if you did the wrong one you'll be able to tell because when we download it's not going to work but if we test the step we should see the file ID is coming back so we're good to go here so now we actually want to download this file so we're going to do once again at Google Drive um and then we're going to go down Within file actions to download a file so grab that um so obviously we're downloading a file here and this is where you know typically you could choose from a list to grab all the files or grab a specific file you want but in this case it's going to be dynamic obviously based on what's coming through so we want to grab by ID and then this is where we can grab the file ID earlier that we set in order to um you know grab the right one and if we test up we should see the actual binary coming through of that um document and so now we see this binary information and that's how you know you got it right but also what we want to do here is ADD options Google file conversion and we want to convert Google docs to text you could also do PDF but we're going to do text here so as you can see right now it's coming through as binary which is a doc extension we test this again and it will come through as um text so if we view it we should see actual text information coming back rather than that binary okay we've got the text and now we actually want to extract that so we're going to grab an extract from file node we're going to go down to extract from text file which is right here here and basically just want to test the step and we should see that now it's coming back as actual data that we have in NN and then from here all we need to do is push that into the super base Vector store so we're going to add an option here we're going to type in super base and we don't want to do super base we want to do super base Vector store we'll use superbase later but for now we are just going to be doing add documents to Vector store we need to set up our credential once again um so we put that in there because we've already set that up we're inserting documents we are inserting documents to the table called documents and then for options you want to add options and then just leave that there um because it's just going to match the documents and it already has that function put in there so you don't need to touch it that's all we need to do and so obviously now we need to add our our our document loader so in here we're doing Json we're just going to load all data input and then for metadata this is where it gets important because we want to grab the actual metadata from or sorry we want to put in the file ID like I said so lat L we can reference it so if we go to schema we should be able to grab the set ID right here which is coming through Json file ID and actually this is not correct um I think I just need to update my my cloud instance but um when you put something Json dot whatever it is that means that it's going to reference whatever currently most previous node that it's coming from so this is trying to look for file ID within this extract from file which obviously that's not there all we have would be json. data so um actually let's see if we did json. dat it would come back with the the the project the text that we extracted so that's not what we want what we need to do is we need to get the file ID from this set ID node over here that we actually you know this is where we grabbed that file ID so in here typically you should be able to just drag stuff in and it should be fine I think this is just a bug right now because um it's going as Json so what we need to do is reference the nodes so in here we type in the curly braces we can see we have different noes we're looking we're looking through the set ID node and then within there now we want to look for the Json or actually no it should be item. Json dot move this so we can see do file ID okay now we can see we we're getting the actual file ID back and this is how we want it because now in the metadata of our super base we will see a file ID so um that should be good we've added metadata we want to add a recursive character text splitter um if if you're looking for more information about text Splitters then please go watch my end Master Class um I walk through sort of the difference between the three options that we have for text Splitters um and then our embedding once again we will be doing text embedding three small so at this point we have this first part of this workflow set up for when a new um file is created within our folder so if you you know we got a new project we WR wrote out a project brief and then we drag it into this folder called projects once this workflow is active up here it would automatically grab it and put it in so let's test this and then we should go back into our table which is right here it's empty um there we go it just popped through so now we have these three vectorization of this information as you can see um we've got like the the information right here and then if you go into the metadata each of these we should see a file ID so before it would have just had all this information The Source The Blob type but now we've um make sure that we put in file ID so that later we can reference it once again so we've got this also you can see the chat history um which is earlier we asked what our projects looking like and it was unable to get anything so we've got that and now we have data in there um and so you know we could go chat with this agent actually yeah let's just do that real quick we'll go back to the rag agent where we currently ask what they're looking like and now we will say give me an overview of project Mountain because that's the one we just put in there so now it will'll be obviously understanding our question question going to the database to grab that information it's retrieving it now it's generating an answer right here generating an answer and then we can pop back into here it's updating our um is it not going to be in here yeah there it is um it updated the chat history and now we see it's an AI power tool being developed by Summit Enterprises it's giving us goals features the team composition um all that kind of stuff and if we go back into super base we should see in our chat history once we refresh now we have this action we just had right here give me an overview of our projects or project mountain and then it gave us the overview so that's how that works and now we just need to set up the second part of this workflow which is going to be if a folder or if a file is um updated it will change the information so we're going to add a Google Tri a Google Drive trigger once again we'll go down to triggers and we'll want onchanges involving a specific folder once again same thing we're grabbing the same same folder and instead of watching for file created we'll just be looking for a file updated so let's real quick go in here and just say file updated we will come in here and just make this one new file so we understand what's going on in each one um let's also just organize this we'll call this this is the actual node that's downloading the file and then we've got extracting from file and then putting into Su base so yeah let's get working on this this workflow now so we've got our file updated um let's actually just no for now it's fine so we'll make a change later and we'll see but we fetched test event and it's going to grab project Mountain once again um from here what we want to do is grab a sub base and we're not doing Vector store this time we're doing actual sub base and so that we can delete a row within our table so we're going to set up the credential again we're going to be deleting a row we're going to be looking through documents um and then we want to build this as a string and now we have to type in how we want to make sure that it's how sub Bas should be looking for which rows to delete okay so in here um it's going to be sort of a filter but it might look a little little Cody so what we're doing is metadata because in subbase we're going to be looking through the metadata right here obviously and then in the metadata we want to look for oh sorry we're in chat history in the metadata of um these Vector vectorization we're looking through the metadata to look at the file ID so we're going to be saying like within metadata look for file IDs that equal this and if they equal that then delete them so metadata we're going to do a dash with two arrows um or greater than signs and then we're going to say file ID because that's what it's going to be looking for and then we're going to do equals sorry equals like period and then we're going to go with two asteris two stars and then change this to an expression and then whatever is going inside of these two stars is what it's actually looking for so we're going to once again we need to close down to grab the file ID of the document that it's looking for once again don't go to permissions ID we want spaces ID so we'll pull this in right here and it comes in it's just json. ID and it has the correct um information right there so all we're going to do is go back in here we see that there's three um rows that have that ID we're going to come back into here and then test the step and if we did this correctly we should get this this is how it should come back so that's good it has three items because it deleted all three of those those rows and now we switch back into super base you can see that they just disappeared so this is good now every time something's updated it's going to delete those old ones so that we can download the new file and then put the new file into superbase so that we're only interacting with ual accurate information so we'll save this next step here is that we want to grab the um the IDS so we're going to do another set node and once again we're just mapping out the actual file ID again so that we can reference it later at this point it's pretty repetitive so we're going to grab it call it file ID and then do right here so as you can see it's referencing the node called file updated because if it was just to do Json it would be looking for that's actually a great point if we just did json. ID Let's test this real quick so we can see it's pulling back the actual IDs but if we just did json. ID it would grab this ID right here so it would be grabbing the ID of the it would be grabbing basically the row ID of the vector um database so we don't want that so make sure you specify what node you're looking for and so now if you can see we have three items coming back because there were three rows so what we want to do here now is limit because we only want one to come back so all we need to do is one keep the first item test that now we have one ID coming back rather than all three um not sure if it's like completely necessary but it keeps things cleaner and then you're only trying to download like one file so that's why we're doing that um but anyways from there we want to actually download the file not download we want to grab a Google Drive node right here we're going to download that file and this is pretty much the exact same thing as the previous one with an ID and edit Fields we're grabbing in this file ID so perfect it's referencing the node and we'll hit test upep so now we can see the project Mountain this would be the updated folder or sorry updated file once again we want to do file conversion text run that again we should see the actual text coming through as we can see now it's a text folder or text file and now we've got this we also could have easily just copy and pasted this node down here which probably would have been the smarter thing to do but um nobody's perfect so anyways download file two so we've got this and then it's the exact same thing so we can this time we'll just copy and paste this node down here to extract from a text file um we'll run that we can see the information coming through and then honestly I think this also can just be duplicated as well because we're just doing the exact same thing as long as we have um this is the only thing I think we need to change so um we're grabbing it from let's see okay so we just want to call this set ID 2 and so this one right now is looking through a node called set ID which obviously there's no information there because it's looking through this one so now we need to make it say in this case you'll be looking through set ID number two so if we come in here and we just add a number two we should be fine um can't determine which item to use maybe it's just because it hasn't ran let's okay let's try something we'll run this and now there's an error okay let's just try it again we'll do it manually so anyways why is it doing that why is it doing that okay bear with me here okay so now we're grabbing set id2 it's working so what do we do item Json file ID no do we not name it the same thing file _ ID oh okay maybe it's because we want to maybe grab it from limit because it's just limiting one let's try that why does it do that when I okay delete that we're going to go from limit and we can just maybe say item. json. file ID okay perfect there we go now we're getting the correct ID back that we want to put into the metadata once again um we'll hit save and now we'll run this again although yeah so there's nothing in there right now we run this again and we should see um three new vectors pop into there let's go and see if we can see it live um we might just have to give it a refresh yeah we'll give it a refresh there we go so we've got these um three new Vector stores so the first ones were one two three deleted those now we have 456 and we can see in here we' got the metadata so it's all working as it should um and this is really it so one thing I wanted to mention is you know ideally you would also have some sort of you know a node down here where let me just show you so a cool option would be if you wanted to have another trigger down at the bottom which is going to be changes involving a specific folder You' grab that same folder um once this loads up I think I'm overwhelming my computer with with um super base information but um let's see we grab a folder anyways my point was it'd be cool if there was like a file removed file deleted that way you could just you know delete folders once a Project's done but also maybe it's good to give a summary of like a project that's done or whatever it is but there's probably use case where you wanted to remove stuff so in that case you'd have to probably manually go into your super base delete those vectors you could also just update your file and say like this project has concluded or this is no longer relevant or whatever it may be and it would obviously update that but the point would be you you'd grab the ID and then you just have a super based thing to delete it and then it would just literally just be those two nodes so it would be like a delete row down here and then maybe like a you know at the end of these you could have a notification you could at the end of all of these workflows have a notification that said like okay new file was created and added to subbase and then it would just like text you that same thing over here blank was updated and deleted and then reuploaded to superbase and then down here was like project Mountain was deleted from superbase so you could always you know add some more stuff off of this and this one would just delete the file and then that would all all it would do but I guess a workaround for this could be you could have like a node that is always running to compare the files or the folder and then you would just see if like a comparison doesn't match up with this one then it would delete whatever like isn't syncing from superbase so that would be like just a quick workaround but um maybe in the future they'll have just an integration in Google Drive where you can just just do that right away so anyways we're going to make this workflow active and we're going to test out some stuff so got it so this workflow is now active it should be looking for within this folder right here if anything new is added so I'm going to make a new document real quick We'll add it in there and then we'll watch the execution happen Okay we're back with a new one this one's called project snow um we were going to put this one into the the folder I don't know if you can tell but um yeah it's almost winter and I'm looking forward to skiing so that's what's top of mine but anyways project snow right here we're GNA drag that into projects so now in this folder we have a folder or we have a new file just got created just got put into the the what's it called the folder so here's that execution we grabbed in here um project snow which should be I always have a hard time finding this anyways we'll go to Json project snow I might have scrolled too far once again sorry about that um you know what never mind we we'll see it we'll see it later so set ID downloads a file extracts from file now we can see the the project briefest project snow and then it got put into super base we'll come in here refresh this we should see 789 so now we've got um these new ones with their unique IDs in there um so yeah let's go over to the rag agent and we will talk to um the agent about project snow we'll say um what is Project Snow's budget that's simple enough we'll come in here and see that the Project's snow budget is 30,000 so that was obviously a very simple use case um there we go project snow budget is 30,000 so let's go back into project snow let's change the budget to um let's just say we have no money so now we we've changed this we will go to the project folder refresh that and we should see now it just got ified and we will go back into here and wait for another execution to come through of the um the updated file okay so as you can see it's running right now um we'll take a look at that in a sec so it already succeeded let's click into this and now we can see it went through the file updated path it would have deleted this old record uploaded the new one and let's look at sub base sorry I was about to drink water and then it happened but let's go look into sub base and see what happened okay so originally we put project snow into here they were IDs 789 as you can see 789 was deleted and it was replaced with 10112 and they still have our file IDs in there so now we should be able to go back into the rag agent and say um what is the budget now and it should say something about that we have no money which is unfortunate but you know at least we know we're getting accurate information the current total oh sorry it's looking for all so what is the budget for project snow so that this would probably have to do with you know prompting and the way that we have the memory set up because you would assume that it would know that it's referencing project snow but I don't currently have any access to specific budget details for project snow if there's anything else you'd like to know or other projects you're interested in let me know so let's see if we can actually look at what came back from superbase so the system says use the following pieces of context to answer the user's question it's pulling information about products know if you don't know the answer just say that you don't know don't try to make up an answer so that's how you can um you know try to limit that hallucination but then at the bottom you can see budget we have no money so that's why it came up with this answer just basically saying we don't have specific budget details but yeah that's about it for this one hopefully you found this valuable as far as looking at you know super base and post guest if you haven't explored these tools before um also you know the workflows will be downloadable in the free school Community Link for that down in the description if you're interested in going a little farther and getting some more Hands-On learning please um reach out to me about the paid Community we'd love to have you in there um see you on some live calls stuff like that and then once again if you're looking for help actually implementing these sort of solutions into your business or if you're run an agency that sort of stuff please reach out book a call on my website and let's talk about how we can work together but thanks for watching this one that's all I've got um hope you guys found this one valuable of course and I will see you guys in the next video

Original Description

📌 Join my free Skool community for access to the workflow templates seen int this video! 👇 https://www.skool.com/ai-automation-society/about 🌟 Join my paid Skool community if you’re serious about mastering AI Automations👇 https://www.skool.com/ai-automation-society-plus/about 🚧 Start Building with n8n! (I get kickback if you sign up here - thank you!) https://n8n.partnerlinks.io/22crlu8afq5r Learn how to build a new and improved RAG AI Agent in n8n! In this step-by-step tutorial, I walk you through a more automated approach to creating RAG agents—making the process smoother than ever. While there's still room for optimization, this method takes a big leap forward from past builds on this channel. If you're passionate about no-code AI automations, don’t forget to like, comment, and subscribe for more content like this! Your support helps me keep bringing you valuable tutorials and tips. 🚀 Sponsorship Inquiries: 📧 sponsorships@nateherk.com WATCH NEXT: https://youtu.be/EzS2PIjyeQQ TIMESTAMPS 00:00 New RAG System 01:12 Quick Demo 03:05 Postgres vs. Window Buffer 04:18 Supabase vs. Pinecone 05:23 Building RAG Agent 06:21 Connecting Postgres 08:40 Connecting Supabase 09:54 Creating Supabase Table 12:04 New Files Workflow 20:05 Updating Files Workflow 27:59 Potential Enhancements 30:00 Testing Active Workflow Gear I Used: Camera: Razer Kiyo Pro Microphone: HyperX SoloCast Background Music: https://www.youtube.com/watch?v=Q7HjxOAU5Kc&t=0s Don't forget to like, subscribe, and hit the notification bell to stay updated with my latest videos on AI agents and automations!
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from Nate Herk | AI Automation · Nate Herk | AI Automation · 24 of 60

1 How I Wish Someone Explained AI Agents To Me (as a beginner)
How I Wish Someone Explained AI Agents To Me (as a beginner)
Nate Herk | AI Automation
2 How to Create an AI Email Agent with n8n (No Code, Step-by-Step Tutorial)
How to Create an AI Email Agent with n8n (No Code, Step-by-Step Tutorial)
Nate Herk | AI Automation
3 How to Create an RAG Chatbot AI Agent with n8n (No Code, Step-by-Step Tutorial)
How to Create an RAG Chatbot AI Agent with n8n (No Code, Step-by-Step Tutorial)
Nate Herk | AI Automation
4 Build your first NO CODE AI Agent in n8n (for beginners)
Build your first NO CODE AI Agent in n8n (for beginners)
Nate Herk | AI Automation
5 *LIVE BUILD* Personalized Outreach AI Agent in n8n (No Code)
*LIVE BUILD* Personalized Outreach AI Agent in n8n (No Code)
Nate Herk | AI Automation
6 *LIVE BUILD* Inbox Management AI Agent with n8n (NO CODE, Step-by-Step Tutorial)
*LIVE BUILD* Inbox Management AI Agent with n8n (NO CODE, Step-by-Step Tutorial)
Nate Herk | AI Automation
7 How to Build a Google Scraping AI Agent with n8n (Step By Step Tutorial)
How to Build a Google Scraping AI Agent with n8n (Step By Step Tutorial)
Nate Herk | AI Automation
8 How to Build a Client Onboarding AI Agent with n8n (Step-by-Step Tutorial, No Code)
How to Build a Client Onboarding AI Agent with n8n (Step-by-Step Tutorial, No Code)
Nate Herk | AI Automation
9 I Built a Personal Assistant AI Agent with No Code in n8n
I Built a Personal Assistant AI Agent with No Code in n8n
Nate Herk | AI Automation
10 Build a No-Code AI Chatbot (Step-by-Step Tutorial)
Build a No-Code AI Chatbot (Step-by-Step Tutorial)
Nate Herk | AI Automation
11 I Built an AI Agent that Automated my Inbox with n8n (No Code)
I Built an AI Agent that Automated my Inbox with n8n (No Code)
Nate Herk | AI Automation
12 Step-By-Step: Add 100+ Files to Pinecone for RAG AI Agent with n8n
Step-By-Step: Add 100+ Files to Pinecone for RAG AI Agent with n8n
Nate Herk | AI Automation
13 n8n Masterclass: Build AI Agents & Automate Workflows (Beginner to Pro)
n8n Masterclass: Build AI Agents & Automate Workflows (Beginner to Pro)
Nate Herk | AI Automation
14 Scrape Google for LinkedIn Profiles in Seconds with n8n
Scrape Google for LinkedIn Profiles in Seconds with n8n
Nate Herk | AI Automation
15 Step By Step: Automating Lead Nurturing with No Code in n8n
Step By Step: Automating Lead Nurturing with No Code in n8n
Nate Herk | AI Automation
16 n8n AI Agent Masterclass | AI Nodes Made Simple
n8n AI Agent Masterclass | AI Nodes Made Simple
Nate Herk | AI Automation
17 AI Personal Assistant 2.0 | This Agent Calls Other Agents (No Code) in n8n
AI Personal Assistant 2.0 | This Agent Calls Other Agents (No Code) in n8n
Nate Herk | AI Automation
18 The Best Way to Give AI Agents Tools in n8n
The Best Way to Give AI Agents Tools in n8n
Nate Herk | AI Automation
19 I Scraped, Researched, and Created Outreach for 16,846 Leads using Godmode HQ
I Scraped, Researched, and Created Outreach for 16,846 Leads using Godmode HQ
Nate Herk | AI Automation
20 AI Agent Prompting Masterclass: Beginner to Advanced
AI Agent Prompting Masterclass: Beginner to Advanced
Nate Herk | AI Automation
21 How to Build an AI Slack Assistant in 5 Minutes (Chatbase)
How to Build an AI Slack Assistant in 5 Minutes (Chatbase)
Nate Herk | AI Automation
22 Step by Step: Scrape UNLIMITED Emails for FREE with n8n
Step by Step: Scrape UNLIMITED Emails for FREE with n8n
Nate Herk | AI Automation
23 Chains vs AI Agents in n8n #artificialintelligence #shorts
Chains vs AI Agents in n8n #artificialintelligence #shorts
Nate Herk | AI Automation
Step by Step: RAG AI Agents Got Even Better
Step by Step: RAG AI Agents Got Even Better
Nate Herk | AI Automation
25 n8n vs Make.com #artificialintelligence #coding #agentgpt #techtok
n8n vs Make.com #artificialintelligence #coding #agentgpt #techtok
Nate Herk | AI Automation
26 How to Build a Personal Assistant AI Agent in n8n (Step-by-Step, No Code)
How to Build a Personal Assistant AI Agent in n8n (Step-by-Step, No Code)
Nate Herk | AI Automation
27 Personal Assistant AI Agent in n8n  #n8n #coding #agentgpt #artificialintelligence
Personal Assistant AI Agent in n8n #n8n #coding #agentgpt #artificialintelligence
Nate Herk | AI Automation
28 Set up Google Credentials in n8n in 5 minutes (2025)
Set up Google Credentials in n8n in 5 minutes (2025)
Nate Herk | AI Automation
29 5 n8n Tips You NEED to Know
5 n8n Tips You NEED to Know
Nate Herk | AI Automation
30 Build this Multi AI Agent System for Research and Content Creation in n8n
Build this Multi AI Agent System for Research and Content Creation in n8n
Nate Herk | AI Automation
31 Vector Database Optimization with n8n: Metadata, Text Splitting, & Embeddings
Vector Database Optimization with n8n: Metadata, Text Splitting, & Embeddings
Nate Herk | AI Automation
32 Are you doing these things to optimize your Vector Database?  #artificialintelligence #n8n
Are you doing these things to optimize your Vector Database? #artificialintelligence #n8n
Nate Herk | AI Automation
33 This AI Agent Extracts Text From Images in n8n
This AI Agent Extracts Text From Images in n8n
Nate Herk | AI Automation
34 This Invoice Agent Analyzes Images in n8n  #techtok #agentgpt #artificialintelligence #n8n
This Invoice Agent Analyzes Images in n8n #techtok #agentgpt #artificialintelligence #n8n
Nate Herk | AI Automation
35 The Best RAG System On YouTube (Steal This!)
The Best RAG System On YouTube (Steal This!)
Nate Herk | AI Automation
36 RAG System 2.0 | Effortless RAG in n8n  #artificialintelligence #n8n #aiagent #RAG
RAG System 2.0 | Effortless RAG in n8n #artificialintelligence #n8n #aiagent #RAG
Nate Herk | AI Automation
37 Understanding APIs in n8n (as a beginner)
Understanding APIs in n8n (as a beginner)
Nate Herk | AI Automation
38 Understanding APIs in n8n #n8n #artificialintelligence #api
Understanding APIs in n8n #n8n #artificialintelligence #api
Nate Herk | AI Automation
39 How I Built an AI Agent to Automate my Emails in n8n (Step by Step, No Code)
How I Built an AI Agent to Automate my Emails in n8n (Step by Step, No Code)
Nate Herk | AI Automation
40 This AI Agent automates my customer support emails. #n8n #aiagent #artificialintelligence
This AI Agent automates my customer support emails. #n8n #aiagent #artificialintelligence
Nate Herk | AI Automation
41 Everything I Learned About AI Agents in 2024 in 19 Minutes
Everything I Learned About AI Agents in 2024 in 19 Minutes
Nate Herk | AI Automation
42 Build AI Agents for $0.014 with DeepSeek V3 in n8n
Build AI Agents for $0.014 with DeepSeek V3 in n8n
Nate Herk | AI Automation
43 Having an Actual Conversation with Data Using an ElevenLabs Voice Agent and n8n
Having an Actual Conversation with Data Using an ElevenLabs Voice Agent and n8n
Nate Herk | AI Automation
44 Having an ACTUAL conversation with my data using ElevenLabs Voice Agent #aiagent #elevenlabs
Having an ACTUAL conversation with my data using ElevenLabs Voice Agent #aiagent #elevenlabs
Nate Herk | AI Automation
45 ElevenLabs Voice Agents Are So Easy to Build (No Code!)
ElevenLabs Voice Agents Are So Easy to Build (No Code!)
Nate Herk | AI Automation
46 How I'd Teach a 10 Year Old to Build AI Agents (No Code, n8n)
How I'd Teach a 10 Year Old to Build AI Agents (No Code, n8n)
Nate Herk | AI Automation
47 How I Built A Technical Analyst AI Agent in n8n With No Code
How I Built A Technical Analyst AI Agent in n8n With No Code
Nate Herk | AI Automation
48 This AI Agent Analyzes Stock Indicators! #n8n #artificialintelligence  #coding #agentgpt #techtok
This AI Agent Analyzes Stock Indicators! #n8n #artificialintelligence #coding #agentgpt #techtok
Nate Herk | AI Automation
49 I Built a Team of Research Agents for Newsletter Automation in n8n (No Code)
I Built a Team of Research Agents for Newsletter Automation in n8n (No Code)
Nate Herk | AI Automation
50 This Team of AI Research Agents Automated My Newsletters! #n8n #artificialintelligence #aiagent
This Team of AI Research Agents Automated My Newsletters! #n8n #artificialintelligence #aiagent
Nate Herk | AI Automation
51 The Ultimate n8n Starter Kit (2025) (Free)
The Ultimate n8n Starter Kit (2025) (Free)
Nate Herk | AI Automation
52 Two Ways to Save 96% of Your Money Using DeepSeek R1 in n8n
Two Ways to Save 96% of Your Money Using DeepSeek R1 in n8n
Nate Herk | AI Automation
53 How to Actually Build Agents with DeepSeek R1 in n8n (Without OpenRouter)
How to Actually Build Agents with DeepSeek R1 in n8n (Without OpenRouter)
Nate Herk | AI Automation
54 This Voice Agent Sends Emails for You #artificialintelligence #n8n #aiagent  #coding #agentgpt
This Voice Agent Sends Emails for You #artificialintelligence #n8n #aiagent #coding #agentgpt
Nate Herk | AI Automation
55 Best Model for RAG? GPT-4o vs Claude 3.5 vs Gemini Flash 2.0 (n8n Experiment Results)
Best Model for RAG? GPT-4o vs Claude 3.5 vs Gemini Flash 2.0 (n8n Experiment Results)
Nate Herk | AI Automation
56 How to Locally Host DeepSeek R1 for FREE in Under 10 Minutes in n8n
How to Locally Host DeepSeek R1 for FREE in Under 10 Minutes in n8n
Nate Herk | AI Automation
57 OpenAI Fires Back at DeepSeek With a New Reasoning Model: o3-mini (n8n AI Agent)
OpenAI Fires Back at DeepSeek With a New Reasoning Model: o3-mini (n8n AI Agent)
Nate Herk | AI Automation
58 Run DeepSeek R1 Locally in Under a Minute  #coding #artificialintelligence #n8n #deepseek
Run DeepSeek R1 Locally in Under a Minute #coding #artificialintelligence #n8n #deepseek
Nate Herk | AI Automation
59 I Built the Ultimate Team of AI Agents in n8n With No Code (Free Template)
I Built the Ultimate Team of AI Agents in n8n With No Code (Free Template)
Nate Herk | AI Automation
60 I Built the Ultimate Team of Agents in n8n  #artificialintelligence #n8n #agentgpt  #techtok #coding
I Built the Ultimate Team of Agents in n8n #artificialintelligence #n8n #agentgpt #techtok #coding
Nate Herk | AI Automation

This video teaches how to build an improved RAG AI Agent using n8n, covering database integration, workflow setup, and automation. It's a step-by-step guide for those interested in no-code AI automations.

Key Takeaways
  1. Create a new RAG AI Agent in n8n
  2. Choose a database (Postgres or Supabase)
  3. Connect the database to the RAG agent
  4. Set up a workflow in n8n
  5. Update the workflow with new files
  6. Test the active workflow
💡 Using n8n, you can create a more automated approach to building RAG AI Agents, making the process smoother and more efficient.

Related Reads

📰
5 AI Tools I Use for Research I Can Actually Trust (With Sources)
Learn about 5 trustworthy AI tools for research that provide transparent sources
Medium · AI
📰
AI‑Assisted Themed Yoga Sequencing for Independent Instructors
Learn how AI-assisted themed yoga sequencing can help independent instructors create customized classes, and discover a key principle to get started
Dev.to AI
📰
I Broke My Own Payments Service on Purpose, Then Asked an AI to Snitch on It
Learn how an AI can help identify and resolve issues in a payments service, and why this matters for improving system reliability and reducing downtime
Medium · LLM
📰
From Real Enterprise Modernization to an AI Legacy Modernization Copilot
Learn how to modernize legacy code with AI-powered tools and strategies, transforming outdated systems into efficient and scalable ones
Medium · AI

Chapters (12)

New RAG System
1:12 Quick Demo
3:05 Postgres vs. Window Buffer
4:18 Supabase vs. Pinecone
5:23 Building RAG Agent
6:21 Connecting Postgres
8:40 Connecting Supabase
9:54 Creating Supabase Table
12:04 New Files Workflow
20:05 Updating Files Workflow
27:59 Potential Enhancements
30:00 Testing Active Workflow
Up next
Unity AI Free Alternatives – ZERO Budget Game Developers MUST Watch
MaxonShire
Watch →