From the course: Build with AI: Create Custom Chatbots with n8n

Milestone: Smart chatbot powered by your own docs

From the course: Build with AI: Create Custom Chatbots with n8n

Milestone: Smart chatbot powered by your own docs

- [Instructor] You've really made it very far. Congratulations already. The only thing for us left to do is to actually launch our chatbot to the real world. And thanks to AI Agent, that's pretty straightforward. So let's open the chat note again and talk along. Make chat publicly available. So as we learned before, you have different hosting options here. I'm choosing the hosted chat option here. And if you like, you can customize your chat with the title subtitle, the custom-chat styling, and everything like that. But for now, let's just try it out. So let's click the chat URL over here to copy it to the clipboard. Open a new browser window and just paste the URL in here. And if you see an error message like that, this happens typically when your chatbot is not live yet. So let's go back to AI Agent. And in order to make this chatbot actually live, we need to toggle it on. So activate the workflow by toggling on this little button here. You get this information that your bot is now active. So click on Okay, and back to our URL. If you refresh this, you will see that our chatbot is actually working. So let's type a question. Let's, for example, ask it again about the vacation policies. So you can see that the chatbot is now generating the answer. And of course, sometimes it takes a little longer because especially if you have very open questions, it'll either go and fetch a lot of information or it'll ask a follow-up question like this one. Because this was a pretty broad information, it asks us whether we are looking for vacation time or for carryover of unused vacation or anything else. In this case, let's just say the first. And this will also help us to confirm that our chatbot actually keeps track of the previous conversation because otherwise, it wouldn't know what the first means. But now it goes back to our database and searches for the vacation time accurate. And this is the information that it shows to us. So you can see we get this nice list here, full-time employees around 15 vacation days per year, and this is equivalent to 1.25 days per month. And we also have the sources for that information here. So you can see that this is coming from the leave and time of policies and the employee benefits and perks. If we wanted, we could also adjust our system prompt to also show the page where this is stored. Currently, I just have this for debugging purposes stored, but if you want, you could of course, also show that here to the user. Just add it to the system prompt as an example that you want the page shown in here. Now, let's click on the PDF and it should open the PDF document in its original storage location. In this case, that's the GitHub repository and you can see document seven here, the leave time and time off policy. So you the employee could now go back and verify the information from the chatbot or just read it in more detail. So going back to our chat, you can now try it out and ask it a couple different questions. Like for example, what benefits do I get? And you can see that this takes a little while to generate. AI Agent, currently out of the box, does not support chat streaming messages as you are familiar with from ChatGPT for example. So if you're more interested in that, we'll talk about this in the next chapter where we'll talk about the optimization and performance improvements of a chatbot like this. But in general, it's working as it's expected. And feel free to ask the chatbot a couple of questions and see how good it is working for you. And again, congratulations for launching your very own chatbot with a powerful RAG architecture under the hood that you can flexibly customize according to your needs.

Contents