Blog
Aug 28
how chatbots work

How We Guide Conversational AI for Lead Qualification – How Chatbots Work

I’ve been working with AI since before the big AI boom.  Immediately when ChatGPT came out in November 2022, there was a ton of misinformation about how it worked.  Talks of the AI becoming sentient.  Misunderstanding about what it can and cannot do.  I thought the world would gain clarity about how chatbots work over time, but I’ve waited and, alas, nothing has changed.  So I figured it better late than never to write a simple explanation about how chatbots work and how we have been able to use this knowledge to develop the best tool for AI lead qualification the world has ever seen.

How Chatbots Work with Words

Short answer… chatbots don’t work with words.  The chatbots we use today actually work with numbers.  When you send a message in to tools like ChatGPT, your text is broken into a number format called an embedding.  Words are converted to embedding format first by breaking the words down into chunks called tokens, then into numbers.  This embedding is a number representation of the meaning of the word.  You can play with this tool at this link HERE.

Embeddings example

Example of text converted to embedding

The AI never actually sees the text Tell me a story about a goat in this example.  Instead, it sees your input as [41551, 757, 264, 3446, 922, 264, 54392].  The AI’s job is then to pick the next most likely series of numbers based on its training.

What Does it Mean to Train an AI?

The most widely misunderstood thing about AI is how it’s trained.  Unless you’re an AI researcher, you’re not training AI.  CloseBot doesn’t train AI.  Documents you upload into the system don’t train AI.  Your prompting doesn’t train AI.  AI is “trained” when the Language Learning Model (LLM) is created and fine tuned.  Why is it important to understand this?

The only two things you can do to improve the output to match your desired results are:

  1. Pick a model that is trained and fine tuned how you like (gpt-4o or claude-haiku for example)
  2. Make sure your prompt has all of the information needed to allow the AI to pick the next best series of numbers (words)

Picking the Next Best Word

Step 1 from above is a pretty quick process.  Step 2 is where the real work comes in.  Let’s look at two examples.  In this first example, we won’t give the AI all of the information needed to give the correct answer.  The AI is simply responding with the most likely series of numbers (converting them to words so us humans can read them).  When the AI responds with information that is not true, we call this hallucination.

 

In this example, we have included some additional information in our prompt.  This changes the most likely series of numbers/words that the AI generates.  This time it matches the true operating hours of the business.

 

Well that makes it easy!  We just need to make sure we always have the correct information in the prompt.  Then the AI will always respond how we want.  Right?  WRONG.  Sometimes our instructions to the AI result in the most likely series of numbers (text output) still wrong 😑 Usually this happens when our instruction to the AI gets too long.  We don’t know exactly what happens behind the scenes, but the output can still have hallucinations even if the AI is given perfect instructions with all relevant information.

How to Combat Lies…

Don’t get discouraged yet.  What if we made certain that the only information in our AI prompt was information that was needed at the time of response?  For example, there’s no reason for the bakery assistant to have a list of our entire menu in its instruction if the customer is simply asking about hours of operation 💡 This is most often handled through something called Retrieval-Augmented Generation (RAG).  This is a fancy way of saying that we pull in text as needed from other sources and include only that relevant text in the prompt at the time of generating an AI response.  RAG can get complicated, but here’s a breakdown article of the RAG algorithm that we use at CloseBot to dynamically pull in information from uploads, scraped websites and other sources to help build the final AI prompt.

 

Taking it a Step Further

Most other ChatBot platforms stop things here.  They have a text input area for you to put your own instructions in, and may have an area for you to upload items.  CloseBot, however has objectives.  These objectives remove and add things to the prompt depending on what is happening in the conversation.  Think of these objectives as a script that you lay out for your bot to follow.  At each point in the script, the AI only has access to the instruction that you’ve given it.  This has proven extremely beneficial in lead qualification AI, where you may want your bot to collect certain information from a contact in a certain order.

 

Summary

Many who have found AI impossible to control with other platforms like ZappyChat have found success with CloseBot.  Our deep understanding of how chatbots work allows us to build AI tools that work instead of tools that cause you more headache than results.  Our reviews speak for themselves!