so I want to go over today how to make an API so that you can chat and have memory chat with naden it took me hours to do and but then when I read the docs it took me minutes and that's one thing I really learned about na is that read the docs take your time watch some videos uh and typically if it's taking you a long time or complicated you might be missing something that they already had planned out and some of it's just learning so we're going to make a workflow where we can
talk to it with Postman let me go grab Postman and so we can take this particular Postman and use it to chat with the API so we're going to send it a chat input in a session ID so we're going to have history and everything so this is what it's going to look like and we'll have a tool there just for the heck of it so you start seeing the power of these tools now you know we're there's two things to consider here overall like a lot but basically the reason I'm doing this training series
The reason I want to help teams and developers convert to these patterns is is someone who is a longtime developer with larl we're almost hitting this period where know it's almost like like the day like the chainsaw came around and you had these people cutting wood with with axes and and handsaws and we as developers just have like a comet hit and a bunch of chainsaws came popping out and I think we got to grab them and start doing our work with those and not with these hand tools so one really simple example is like
hey I could build it the old way the old way you know I could could build out the code the controllers the routes integrate it with code with nice libraries you know but they're all code and they're they're our own custom Tools in our integration points I could grab a library from composer or mpm and then I can deploy it right and then when the developer comes in later on for support or new features sure they can do those things but we're heading in this era where these and these note sizes kind of represent my
sense of like work right I could come in and make a workspace I could say hey integrate this with the l using their AI agents and deploy it because it is deployed um now this can be considered tricky we'll talk about that eventually how to deploy without impacting what's already deployed with n and then you come back to it uh a month later and you're like okay we need to add a new feature and the developer doesn't have to dig into this other developer code they're able to just say hey here's this well-known naden um
node I know how to use it because there's docs on it or maybe it's a custom node but there's not a ton of code there because it's very focused fun so my point is what I'm going to show what I'm about to show you might seem like hey I could have coded that in no time at all and last time then I it took when I first tried it it's the future idea of what it's saving and in the cost hidden inside of this traditional flow that I'm seeing so okay so let's just start and
build this out now let me see I'm going to move this over let me add a new workflow and let me see something we're going to take this and drag it out of here and then oops I'm going to go to that new workflow just add one and then I went really wrong here I started with a web hook only to find out I could have did a chat trigger and it just didn't make sense to me and again I had to read the docs so I had to basically say make it publicly available and
it gave me this URL and again docs they do a good job here why did I not read them I don't know I don't know anyways so here we are and so now I can leave this here I don't really not worryed about that right now but then I can say you know we want to and I'm looking at my my other here other screen we want to say load previous session and we want to say from memory oops and then we want to add we want to make this respond using a web hook and
again this is a common pattern I'm seeing and I just wasn't clear like there is no web hook here and I started with a web hook these apis but we're building an API without a web hook so it's just an interesting paradigm shift for me there okay so we have our particular route basic crud stuff now we have this which we didn't have a moment ago and so what I'm going to do is connect that to my postgress which is the coolest thing because I have a I could I have a postgress database which might
be super based but I'm treating it as yeah it is I'm treating it as postgress because it is it is and I want to make sure I get the settings right so basically at this point I messed up a ton I had it using the wrong session ID I had it you know but it's going to make the table for me if it doesn't exist it's going to set everything up for me I mean this is like this is game changer and how much it saves for us and as a team you have these consistent
patterns defi defined before your team hits it right so okay so now we want to add the the the best feature of all is the AI agent and so we're going to and let me get my settings open we're going to just leave the defaults take from previous node trigger tools agent there's options there and leave this and and that's it yep that's it so at this point because it's so awesome because the AI agent you don't get it this is there is no PHP Library out there that can compare with this uh and that's
why I'm shifting towards this because making backends with this over PHP or whatever is a is a time-saving decision we can still build front ends with whatever we want we can still build backends with whatever we want but once you want to do complex not even complex even simple workflows once you want to start integrating with AI just open up a this and you're done right so okay uh so I'm going to give it an open AI chat model and you could maybe easily use one of these other ones like anthropic but remember to read
the docs because I was using AMA only to find out they didn't have tool integration all right I'm going to use chat4 and this is already set up with my account so you just you know you just click the pencil add your account it even tries and shows you if it's working just the nice details all right so then we do this one thing where we're like yeah we need the memory but we're going to share the memory right here let's do that and then we want to add some tools for the heck of it
right so the one that a lot of people add is a calculator because you know this stuff isn't great at math so uh you can help it out and it's a fun one but I'm going to do The Hacker News one because it's just whatever it's just a tool you can make your own you can connect to other workflows like that's just huge so and once you think about that for a bit you you'll just like the fun you can have with this stuff it's just crazy all right so here we go Hacker News calculator
and then we want to add our respond to web hook let's see respond I am looking over there for typing because I or spelling because I am mad at spelling okay we're going to leave it at its default so now we have this respond to web hook now I'm going to click save now I don't think with web hooks you can usually have a test URL I don't think this does that let's go try that I'm totally curious so let's go replace that and we'll we'll we'll just send it I don't think it will work
yeah it's not open yet I'm wondering know if I put a test here what happens just curious yeah okay so we have to now publish this now you could the cool thing here maybe this is why they don't do that is that you can now chat with your your project right so I you know oops and we get to watch again just these little details are crazy awesome but we get to watch the Green Line showing how it's processing so the latest n8n which this might not even be has this nice path so I as
a developer ER can get a sense of what happened and if I go to here I even get a better sense of what happened where I can then copy it to the editor in in have state now right so I can progressively I can just see what's going on how did it work that's how I kind of figured out what what my my API request look like right and I don't use the action one I probably should now I think about it maybe I should use that now I think about let's let's think about that
as we throw Postman at it but yeah so we saw now in the chat message which Clos because I switched screens that that guy had the here we go had this thread of of what it did this is really cool now let me go to subase for you I should have had this window open let us see so you'll see here it's starting to make a conversation thread with the particular session ID so we can have history I didn't have to code any of this I just can't emphasize enough how hard this is to keep
a consistent pattern amongst teams all right so so now if we were to open up if we were to Cod a front end if we were to use lovable or cursor or bolt if we were to use Lille we can then point to that API and and send something so let's see uh oh I'll do this thing really quick so here's my session ID I'm going to go grab it from here just for the heck of it because I didn't even think about this till just now and I can go here and say you know
can you TLD drr it for me right so oops I never let's go do this so I never said let's make this live all right so now when I send that it will take a moment to respond didn't have to code it didn't have to do all the history the database and we have memory right like I've built this stuff before by hand I know what it takes and I know when I bring in another Dev to help with the support or whatever I know what it takes I have no this this is there's no
like this is you know it's challenging because it's a paradigm shift for us so again we we can quickly go to here and have less debt so yeah that is a sense of how you could use naden to build out a quick API for your applications to use to chat with now naden would let you embed this into a system and I'll show that some other times so you don't even need to potentially build an API you could just embed a widget into a website but in the meantime yeah I just want to show how
you can make that particular API to talk to from your application all right uh that's it it so make sure to subscribe uh to share this with others uh consider me in my training course for you or your team uh and uh we can talk more uh that way um but all right thank you uh for watching the video