📱

Get Our Mobile App

Take your business learning on the go!

Download on the App StoreGet it on Google Play

The NEW Way to Build AI RAG Agents in Under 10 Minutes (no code)

Duncan Rogoff | AI Automation22:46

Transcription

Imagine if every question about your business, from client onboarding to SOPs, could be answered instantly, 24/7, by your own AI brain. That's exactly what a RAG knowledge base does. And right now, it is one of the most in-demand, best-selling automations across all industries. It is so incredibly powerful.

You can use it for your marketing, your social media, even your customer support. And the company Pinecone just made it ridiculously easy to build one. In this video, I'm going to show you exactly how to create your own fully working knowledge base, step by step, in under 10 minutes. No coding, no confusion.

Make sure you stick around to the end because we're going to hop into the AI coding platform, Lovable, to create a really beautiful front-end experience for your clients that's going to make you look like a pro overnight.

So, here we are inside of NADN, and I just want to show you how the system works first before we go ahead and build it. So, all we have to do is type to our agent to ask it a question about anything that we have in our knowledge base. I've just gone ahead and loaded up this test knowledge base with Alex Heroszy's "$100 Million Leads" in PDF form. This has basically everything you need to know to get leads for your business.

And so, I'm just going to go ahead and I'm going to ask a question. I'm going to say, "What are the core four ways to get leads?" So, I'm just going to go ahead and send that off. And you can see the agent is already getting to work. It's thinking. It's right here. It's actually asking the question to our knowledge base directly, and then it's going to pull in the answer that it finds to our chat right here.

So, this takes a couple of seconds to run, and we can see the core four ways to get leads, as outlined in "$100 Million Leads" by Alex Heroszy, are: one, warm outreach; two, posting content; three, cold outreach; and four, paid ads. So, this is literally pulling word for word from the documents that we have uploaded into our own knowledge base. And so you can see instantly how incredibly powerful this is.

And what's really great about this is from here, you can even go ahead and ask a follow-up question like, "Create and optimize a LinkedIn post for this content." So, again, you can see this is really, really powerful. I know some of you might be asking, like, "Why not just create a custom GPT?" And you could absolutely do that. But the reason it's so powerful to do this inside of a platform like NADN is because of your ability to connect additional tools to your AI agent.

So, instead of just having it respond directly to a chat, like you could hook up, like, an email tool or something like that. And so now, anytime somebody asks a question, and you could say, like, "Send an email to Gary with the answer." Now it's going to grab the information from your knowledge base and send it off to Gary. Or if you wanted to take the information from your knowledge base and store it in a Notion doc or something like that, right? So, it's the ability to take all of your knowledge and to connect it to everything else you are doing in your business.

You can see here that in a couple of seconds, it just rewrote this into a format for LinkedIn. So, today we're going to be using the platform Pinecone, which just came out with Assistants, and we're going to be using the platform OpenRouter. So, we have access to every single LLM: ChatGPT, Claude, you name it.

So, I'm just going to go ahead and delete this and I'm going to start from scratch. So, if you're starting a brand new project in ChatGPT, this is what it's going to look like. And so, the first thing you're going to do is just click the big plus in the center. What we want to do is we want to trigger this on a chat message. So, anytime we send off a message, our agent is going to respond. And this is going to be key for when we hook everything up to Lovable and make it really, really pretty later on.

And now that we have this set up, I can say, like, "Hey, what's up?" Right? And we can send this off. And you can see it received this message already. Now, obviously, we don't have anything connected to it, so it's not going to go anywhere. But now we know we have a good start.

So, the next thing we do, we're already ready to hook this up to our AI agent. So, we're going to click the plus here. We're just going to type in AI. I typed in "Gent," but "AI agent" comes up. And this is great. The source for the prompt is going to be the connected chat. And so, now anytime we send off a chat message, it's going to send the message to our agent. Cool. We are well on our way.

So, in order for the AI agent to operate properly, it needs a couple of things. The first thing it needs is a chat model. And this is the brains of your AI agent. Basically, a chat model, we're going to use. In our case, we're going to use ChatGPT. It just needs an LLM, something with thinking and processing power.

And so, let's go ahead and connect this to OpenRouter. So, I'm just going to click the plus here in "Chat Model," and I'm going to type in "Open" and select OpenRouter. OpenRouter is an incredible platform. You can go ahead and click "Models" up here, openrouter.ai. I'll leave a link in the description where you can get access to this. And you can see we literally have like every single LLM model. Like, if you look on the side here, like, look, look how much we can scroll down.

So, we really have access to everything. It's incredibly easy to set up. All you have to do is create an account. And then from there, go into your profile and select "Keys." We can create an API key. And we can just go ahead and call this RAG for RAG knowledge base. It stands for Retrieval Augmented Generation. You don't really need to know it, but if you want to sound fancy, now you know it.

I'm going to go ahead and click "Create." And we have a brand new API key. I'm just going to click "Copy" right here. And we can come back into NADN and come over here, and I can say "Create new credential." We can rename this credential to RAG. And all I have to do is paste in the API key right here. And go ahead and click "Save."

And now we have created a connection to OpenRouter in like 2 seconds. And we have access to every single LLM, pretty much known to man. So, you can see here we selected GPT-4.1 Mini, which is perfect for what we're doing today. It's fast and it's cheap. If you are using this for more complex tasks, I recommend switching to Claude or even GPT-3.5, which is specifically used for complex reasoning. For our case today, like I said, 4.1 Mini is plenty.

And so, now already that we've set this up, now I can say, "Hey, what's up?" Right? And if I go ahead and send this off, now it was pinging the AI agent and says, "Hey, not much. Just here and ready to help. How about you? What's up?" So, now we're basically having a conversation with ChatGPT, right? But it has no knowledge to pull from.

And the other thing that's the issue with this right here is I can say, "My name is Duncan," and I can send this off. But right now, our agent doesn't have any memory. So, now I can say, "Hi Duncan, how can I assist you today?" But now if I say, "What's my name?" It's actually going to do this and it's going to say, "I don't have access to your name based on this conversation," right? Because we don't have any memory.

So, from there, what we want to do is we just want to set up some simple memory. We can just go ahead and click the plus and do "Simple Memory" here. And the context window, we can save this to five. We can set this to 10. This is basically how many messages back and forth do you want, you know, your AI agent to remember. So, for purposes of today, five is plenty.

And so, now I can go ahead and say, "My name is Duncan." And now it's going to know, right? It's going to say, "Okay, great. Nice to meet you. How can I assist you?" And I can ask the same question. "What's my name?" And it's going to go ahead and it has access to our chat history. And so, now it says, "Your name is Duncan. How can I help you further?"

You can see that this is powerful because now it has context for all of our conversations. So, earlier in the video, when I said, "Hey, get me the information about the four core or the core four lead types from Alex Heroszy and then said, 'Create a LinkedIn post about this.'" It actually had the memory to process and access that information. Great.

So, we have actually set up like a huge portion of this already. Now is the last part is actually hooking this up to Pinecone. And Pinecone has gotten super, super cool. It basically functions like a GPT project or a custom GPT, but you have access to it inside of your automation workflows.

So, if we come into app.pinecone.io, go ahead, create your account. Takes like a minute to set up. You know how to create an account at this point. What we want to do here is we just want to come into "Assistant" and I'm going to go ahead and say "Create an Assistant." And why don't we just go ahead and name this Heroszy because this is going to be our Alex Heroszy, you know, leads bot or whatever. And we can just go ahead and click "Create an Assistant."

We are already in the platform. You can see here that this is a very familiar interface. What's super, super cool about this is you can share this with your client, and they can just come in here and ask questions directly. You know, they're not going to have access to the agent for the enhanced processing, but if they have documents or things like that they want to add to the knowledge base, they can just come over here and go to "Files" and they can upload the documents for you.

So, now this way, you're not tracking everything down. They're actually just putting everything in here that they're going to want to have access to. And so, I have my little "$100 Million Leads" PDF right here. And I'm just going to go ahead and I'm just going to drop this in right now. You can see we just go ahead and click "Import." We can add more files, whatever. I'm just going to go ahead and click "Import."

And it's uploading one file. And it's going to take a little bit of time to process it because it's turning it into vectors, which is basically just a long string of numbers that makes it easier for the computers and the robots to understand. I'm not going to get into all the technicalities, but that is essentially what's going on right here.

What's cool is they've set this up in a way that's really easy to follow. So, we have the "Settings," we have the "Files," and now if I go over here, we can go to "Connect." And I will say this took me a couple of seconds to find. It can be a little bit confusing. This is if you're like installing this locally on your machine. But if you come down to the bottom, you can go to our documentation here.

Now we have all this information about the Pinecone Assistant. And if we scroll down and down and down and down, what we want to do here is we actually want to chat with our assistant. So, I'm just going to go ahead and click this as well. We want to chat through the standard interface. Cool.

And so, if we come down here, they've basically built everything that we need for us. What this is, this is called a cURL request. And this basically sends all of the necessary information from NADN to Pinecone and back. So, what's great is that all we have to do to set this up in our automation workflow is just copy everything from cURL down. So, just go ahead and click "Copy."

We can come back in here and now we can click "Tool." What we want is this "HTTP Request" tool. If you don't see it, just type in "HTTP." Go ahead and click this. And so, from here, all we need to do is click "Import cURL." Paste in that cURL request and click "Import." And you can see this has filled out all of this data for us.

There are a couple of little changes that we need to make. The first thing we need to do is I'm just going to change this to "Expression" so I can open this up bigger. Is we actually need to change this at the end here to the name of our actual assistant. So, in our case, we're just going to delete this and we're going to name this Heroszy. You're going to replace this for whatever you named yours. So, now we're actually querying the right database.

I'm going to change the description. I'm just going to say, "Call this Pinecone tool to answer any questions and retrieve relevant knowledge." There are two things that are really important when working with agents and tools like this. It's this description right here and then also the name of the tool itself. So, I'm just going to rename this "Pinecone Tool." Basically, the agent uses this information to make sure that it's accessing the right tool.

So, now that we have this, we can come in here. The next thing we need here is the Pinecone API key. There are two ways to set this up. So, if we're in here inside of Pinecone, we can come to the left here. We can go into our "API Keys" and close this document and go ahead and click "Create API Key." And why don't we just go ahead and name this Heroszy to keep it the same. And I'm going to do "Create API Key."

And now we're able to connect NADN to Pinecone. All we have to do here is click "Copy." We can come in here and we can paste in our API key right here. This is great, but there's actually a better and more secure way to store this API key. And if you store it this way, it'll also give you access to it down the line if you're ever working with Pinecone again.

So, one thing to pay attention to is here is "API-Key." And we have capital A and capital K with a dash in between. So, just pay attention to this for a second because what we're going to do is we're going to come up to the top. We can go to "Authentication." We can do "Generic Credential Type." We can come in here and we can select "Header Auth." From here, we can select down this and we can do "Create New Credential."

We can go ahead and we can name this Pinecone. And why don't we just say Heroszy just to keep everything the same. And this is what I wanted you to remember. So, for the name, we type "API," capital A-Key with a capital K. And we paste in our API key right here. And we go ahead and click "Save."

And now we have created a connection to Pinecone that is secure. It's not going to get shared with anyone. We can come back to this over and over and over again instead of having to always paste in a new API key. So, I can just go ahead and I can delete this because I no longer need it.

The other thing we need to do is switch this JSON to "Expression." And what this is right here, this is basically what the AI agent is sending to Pinecone. You can see here all it is says, "Who is the CFO of Netflix?" And this is the thing that we want to change. And the reason we want to change this is because every time we run the agent, no matter what question we ask right now, this is hardcoded in and it's literally just going to ask this question every single time.

But we want this to be more dynamic, and we want the agent to determine what question we're sending to Pinecone to our knowledge base. So, we can just delete this and we can type in double curly brackets open, double curly brackets close. And if we come into the middle here, we can type the dollar sign and we can start typing "from." And we want this to say "from AI." And inside here, we just need to put quotes. We have double quotes. And all we need to do is search with a lowercase S and query with a capital Q.

And so, what this is doing is this is basically saying, "Let the AI agent decide what our question to the knowledge base is." This is awesome. Before we actually ask any questions, there's one more thing we need to do. So, we need to come into the AI agent. We need to go down here and we need to add a system message because we need to tell the agent how we want it to behave. That's what a system message does.

So, right now all it says is, "You are a helpful assistant." Great. Okay. We can keep this and we can say, "You must call the Pinecone tool to retrieve answers for any question or task." We can just go ahead and say this, right? So, now the agent is instructed that every time we send it a message, it needs to call the Pinecone tool.

So, now I can go ahead and click "Save." And if I come down in here into our little chat box, now I can go ahead and say, "What are the core four types of leads?" I go ahead and send this off. You can see here our agent is getting to work. It's calling OpenRouter, ChatGPT. Now it's calling Pinecone to search our knowledge base. Pinecone is going to return the answer back to our AI agent, and then it's going to format the response for us and send us a message back.

And now we can see the core four types of leads are warm outreach, one-to-one communication, posting content, cold outreach, paid ads, etc., etc. Super, super cool. There is one more bonus that I want to add to this agent. If I come back in here into Pinecone, and I can go into the docs, I can come into the Pinecone Assistant here, and it is kind of annoying and hard to find, but I come back to "Chat with your Assistant."

And getting used to reading the API documentation is one of the most valuable skills you can possibly learn when it comes to the world of automation. So, I'm going to scroll down. I'm going to scroll down. This is what I was looking for: "Include citation highlights in the response." Now, what this does is the object that it returns is going to include a reference to the actual document that we're using to get the answers from. This is really, really helpful.

You can include highlights, which are the specific parts of the document that the assistant used to generate the response. This is great. So, all we need to do is we can see here we just have this little field that says "Include highlights: true." So, I can just go ahead and copy this. If I come back into our Pinecone tool here, we come into the JSON all the way at the bottom. All I have to do is come to the bottom here, add a comma, enter, and I'm just going to paste this in here: "Include highlights: true."

And that's all we need to do. Save this. I'm just going to ask the exact same question. "What are the core four types of leads?" So, again, it's sending it off. It's using the LLM GPT-4.1 Mini to process this. It's querying the knowledge base. We're using the Pinecone tool. And then it's going to send us a response with citations.

And if we go ahead and open this up, "Core four methods of lead are categorized by the type of audience, warm or cold, etc." We have a little bit more detail here. "One to many, one to one is cold," etc., etc. So, this is coming directly from the documentation. And if we had other documents, it would pull in direct quotes, citing everything along the way.

So, you have now set up a knowledge base for yourself, for your client, that has access to anything that you put in it. And as promised, we're now going to hop over to Lovable to build a much nicer front-end experience for this because you almost never want your clients hopping into NADN because they're more than likely to screw something up. So, let's save them from that. Let's create a really beautiful experience for your clients. They're going to love you for this.

So, really all we need for is to create a replacement for this chat module. This is actually incredibly easy to set up. So, I'm just going to go ahead, exit out of this for now. I'm going to hit Tab on the keyboard and I'm going to search for "Webhook" because what we need is a webhook. Basically, Lovable is going to send any message that we type to this webhook here. So, let's just go ahead and make sure that this is up. And I do know that we want to make this a POST request. And we can just connect this up to our AI agent instead of the chat message.

So, I'm going to hop over to Lovable. And why don't we just go ahead and take a screenshot of this to use as a reference because basically this is the type of chat box that we need. So, I'm just going to drop this in. "Using the image as a reference for styling, create a simple chat interface that sends all messages in a POST request to this webhook." And I'm just going to go ahead and come back in here. Copy this webhook right here just by clicking it. Say this. And then waits for a response.

So, I'm going to send this off. And we may have to do a little bit more fine-tuning with this, but this is going to get us 90% of the way there. While this is cooking, I'm going to go ahead and pause the video and then I'll come back in a couple of seconds once this is done. So, this took about 2 minutes to finish. And this is our little chat box here. And of course, we can come into Lovable and we can tell it to adjust styling, but this is good for what we need right now.

One thing I do need to do is because right now we're just using the test URL. There's a test URL and a production URL. So, when you are ready to switch this live and send this to a client, make sure you update Lovable with the production URL. Don't worry, I will show you how to do that. Since we are in test mode right now, what I'm going to do is I'm just going to go ahead and listen for "Test Event" just to see if we're receiving any data. And I'm just going to say, "Test test."

So, let's send this off. And it says, "Workflow has started." Super cool. We received a response. You can see here that we actually have a green check mark right here. This is working. And if we come in here, we can scroll down. I'll just go to the schema view because it's easier to read. You can see here that this is the message coming in that just says "Test test." So, now we know the system is working. Awesome.

There are two more things we need to do. One, we need to change this from "Respond Immediately" to "Respond using Respond to Webhook Node" at the end. So, this is great. And then from here, instead of "Source: Connected Chat Trigger," I want to change this to "Defined Below." And all we can do is come in here, go to "Expression." I'll just make this bigger for you. And we can say "User Message." Now we can come in here. We can go to the webhook on the side, and I can just pass in the user message that's coming from the webhook. You can see here this says "Test test," and this is what our AI agent is going to receive.

And we may need to test this one more time because I'm going to click the plus here. I'm going to type in "Webhook" and use this "Respond to Webhook" node. So, now what's happening is that we are sending a message to this first webhook. Our AI agent is doing all the processing, and it's sending a message back to our chat here. We're going to test this one more time to see if this is working. We may need to update one more thing to make sure we receive this message properly.

So, I'm just going to send this off. I'm going to say, "What are the core four ways to get leads?" And let's go ahead and see what's happening. Cool. So, there are a couple of things I encountered. So, one, we have this as "Connected Chat Trigger Node," and we actually returned an error because we no longer have a connected chat trigger node for our memory. So, all we have to do here is change this to "Defined Below," and we can just name this "Chat" as the key.

So, now we have access to this memory. And if I come over to Lovable, you can see this is the response it returned. And so, now we have to give Lovable a little bit more details of how to process this because we want to make sure we actually parse this response so that it looks like something readable. So, what I can do is I can just copy this and I can say, "Come over here and I can say, 'This is an example of the type of response the webhook returns. We need to parse it so it's written in normal language.'" And I'm just going to go ahead and paste in that response.

So, this is going to go ahead, AI is going to process this, do some thinking to figure out how we can clean up this response. This is great. "Your message will now display properly formatted." So, let's go ahead and test this one more time before we switch this into production mode. Test this out. Send this off. Go ahead, send this to NAD here. You can see our agent is working in the background. We're querying the Pinecone tool for our knowledge base. It's going to get the response. It's going to send it back to the webhook, and we're going to have access to it right inside of Lovable.

So, this is great. And now you can see, look how nicely formatted this is. This is exactly what we want. So, the last thing we need to do is we just need to switch this into production mode. And if we come into NADN, we can take a look here. And you can see the test URL and the production URL. They're actually almost identical, except the test URL has "-test" right here, and the production URL does not.

So, what we can do is we can switch this from "Inactive" to "Active." Go ahead and say, "Got it." This is great. This is saved. And if we come into Lovable, you can tell it to switch that out. Or if you want to be fancy, you can come into the code and you can go into "Search." And it's really not that difficult. You can type in "Webhook." If we go in here, you can see this is the webhook URL. And basically, all we need to do here is just remove "test" from that webhook URL. Great. And go ahead and click "Save."

And that should be all we need. So, now if I go ahead and type the same question, paste this in, come in here, and if I go into "Executions," now we can see that our execution here is running in the background, which means the system is working. Super, super cool. So, this shouldn't take very long to run at all. Maybe a couple more seconds. And when we're done, we should get a response straight back to Lovable the way we set up.

See, you can see here this just popped in. "Second iteration of the same response, the core four ways to get leads," which is really, really great. And so now, if you want to have your client with access to this, just come over here. You don't even need to publish this or make it live. You can literally just send them this preview and go ahead and say, "How should I activate my warm leads?"

If I send this off, you can see we're querying the system. Come into NADN. You can see here we now have this running for a few seconds. This is awesome. And once this is done, we're going to go ahead and have a response that was activated directly from our knowledge base using Pinecone. And this is a much, much better experience for your clients than having them come into NADN to use the little chat bubble.

You can see here, "To activate your warm leads using what they recommend in '$100 Million Leads,' start with your existing personal contacts, personalize your outreach methods, use the ACA framework, provide value, etc., etc." So, this is pulling directly from "$100 Million Leads" by Alex Heroszy, the PDF that we uploaded to our knowledge base.

If you thought this video was helpful, please make sure to subscribe to the channel. If you want to see another video about turning NADN automations into little micro-SaaS like this, check out this video right here.