- Why, and How, To Build Custom Chatbots 🤖[
- Why, and How, To Build Custom Chatbots 🤖
Why, and How, To Build Custom Chatbots 🤖
I’ve been building custom knowledge agents (AKA chatbots) for a few weeks, and my friend Greg suggested I share some background on how you build these tools and why. The ‘how’ is covered in a short demo video towards the end of the piece, but before you start building nodes, it’s worth thinking about what these new chatbots are and what they can do for you.
First, we should ask what chatbots are and why they weren’t so helpful before.
What’s a Chatbot & Why They Weren’t Great
We’ve all experienced chatbots by now, whether we’re using customer support or maybe on a website’s FAQ section, and in some ways, these are text extensions of the old call trees (“press 1 for sales, 2 for customer support’) where each answer from the user sends you to a different branch of the chain. Unlike the call trees, however, the chatbots would provide appropriate answers and have built-in loops so you could ask a few questions in each session.
Unfortunately, these chatbots are challenging to get right as the branching was built manually: each question node had ‘hardwired’ answers, leading to subsequent questions. But if the developer got the questions and answer flow wrong, the user could get led in the wrong direction or stuck in a loop. You also had to anticipate the exact question and answer the person was likely to have, which limits the usefulness of these tools for more complex searches. You’ll probably have experienced this on a troubleshooting page where your exact problem isn’t shown, so there’s no way to get an answer from the session. Hopefully, the developers added a ‘contact us’ option somewhere.
So, until now, chatbots have mostly been OK: able to handle pretty narrow Q&As but unable to manage complex questions.
So what’s new?
With that in mind, you might not fancy manually wiring up a clunky set of nodes, hoping you can anticipate your user’s questions.
Luckily, you don’t have to anymore because the availability of AI tools has wholly changed how chatbots work. The quick explanation is that the LLMs (large language models) allow you to use natural language (NLP – natural language processing) to ask and answer questions. And the processors needed for this kind of work are now widely available.
So instead of hardwired Q&A paths, these new chatbots do all the work to return the response that it believes is most suitable.
Here’s an easy example
I have a chatbot that uses my books as a knowledge base. One of the books – Beyond The Spreadsheet – explains how to conduct a risk assessment and has a section on ‘grading risks’. So if someone asks, ‘How Can I grade my risks?’, the model will identify that section as a good match to answer that question. So far, so straightforward.
But if I ask, ‘Who should lead the risk management program,’ there’s no section with that as a title. However, by ‘reading’ the text in the knowledgebase, the model identifies a section on managing the program and extracts the answer by matching the question’s meaning with the text. In this case, instead of an exact text match, NLP allows it to find the best answer based on the meaning of the question.
So I can now ask the model questions in natural language, and it will find the most appropriate answer based on the knowledge base.
But, best of all, if it’s not sure, it says, ‘I don’t know.’
Why No Answer is a Good Thing
Surely I want an answer: what use is it when I hear ‘I don’t know’?
Well, if you recall, one big issue with AI is hallucinations: very plausible-sounding answers that are, in fact, garbage. Unlike the nonsense answers from the lunatic personality, it’s not clear that these made-up answers are wrong. Like a convincing human BS artist, the AI can give you eloquent, convincing, detailed, and absolutely wrong answers.
Not what you want from a technical knowledge base.
This is why ‘I don’t know’ is a great response: instead of making something up, the chatbot tells you it can’t answer your question from its knowledge base. You don
Carpe tomorrow!