How to Create a Custom AI Chatbot for HelpDesk and Customer Support

Hello, automation enthusiasts!

The topic of AI chatbots has been highly relevant over the past few years, and their applications are practically endless! Whether it’s customer support, sales processes, personal assistants, educational tools, or much more, AI bots are transforming how we interact with technology.

It becomes even more valuable when your bot understands your business and can instantly handle 80% of user inquiries!

But how do you create such a bot?

Let’s walk through an example of building a customer support bot. I’ll be using the HelpScout service to send and receive emails, which I’ve been using for quite some time, but this could work with any platform (email, Facebook Messenger, WhatsApp, Telegram, or other support services like Intercom, etc.).

What are we aiming to achieve?

  • Create a bot that can respond to user inquiries (or write draft replies)
  • Train the bot using our documentation and a list of frequently asked questions
  • Add special commands to request a live support agent if needed

After a few hours, here’s what I came up with:

How does it work?

The chatbot operates as follows:

  1. A trigger activates whenever a new message is received.
  2. We check the message for spam.
  3. We extract the user’s contact information and the message text.
  4. We look for a record of that user in our table.
  5. Based on whether the user has contacted us before, we create an appropriate response.

Now, let’s dive into more detail:

The scenario is triggered by the new message, and we use the AI operator to check if the message is spam. If it’s spam, the scenario halts and does not proceed further.

If the message isn’t spam, we store the user ID and message text as variables for easier access.

Next, we check if a user with that ID (email or nickname) exists in the table.

  • If no matching user is found, they follow the top branch, where a new thread is created for them in the assistant. The thread ID is saved in the table alongside the user’s ID. We then either save the draft response or send it immediately.

  • If the user has previously contacted us, they follow the second branch. The previously created thread ID is retrieved, and we insert it into the assistant node to ensure the new message is sent to the existing thread, maintaining the conversation context. Again, the message can als be sent immediately or saved as a draft.

(In this case, the table serves as a small database, which can collect the user’s first message, dates, etc., useful for analysis.)

The message is processed by the GPT assistant you’ve set up (I’ll write a separate guide on how to use it if needed).

/reset Command

I also added a separate branch that looks for the /reset command. If this command is detected, the existing user record is deleted, allowing the user to start a new conversation thread with a fresh message.

Requesting a Live Agent

Additionally, I created a branch that allows a live agent to be requested via a specific command, in my case, “/Latenode_Team.” When this command is used, a value is added to the table, indicating that a team member has been requested, and the AI assistant will stop responding to this user. The user will receive a message informing them that an agent has been called and will assist them shortly.

Conclusion

In this way, we’ve built a fully functional chatbot trained on your documentation, capable of maintaining conversation context, resetting the conversation when needed, and summoning a live assistant!

If you have any questions, feel free to ask! I’ll be happy to help!