Chapter 1

A Place to Start

What is a chatbot?

The term "chatterbot" was first coined in the 90s by Michael Mauldin, a computer scientist and creator of the Lycos search engine. It referred to any computer program that could simulate an interactive conversation with a human. Over time, this term was shortened to "chatbot." It’s understandable why we’d want to have conversations with our computers, they're incredibly powerful at performing tasks that we often find challenging. It’s tempting to turn to them and ask, “How do you do it?”

However, the term "chatbot" can be misleading. We often overlook the part of the definition that states it’s a simulation of a conversation. When you ask a chatbot, “What is your favorite pizza topping?” it will provide an answer because it’s programmed to do so. But what does it really mean for a computer to have a preference for pizza toppings?

I've seen many demos where people ask chatbots factual questions like, "How tall is the Eiffel Tower?" While interesting, this isn’t why chatbots are typically needed. Without a clear purpose, there's no reason to deploy a chatbot on your website. The term itself might suggest that its main function is to chat, but in reality, the goal of a chatbot is to resolve user issues efficiently. Imagine a computer that doesn’t actually solve any problems—what's the point?

Think of a calculator. You can enter any type of operations on it, even some that don't make sense. The calculator will do what it is designed to do, regardless of the result being useful. However, if you can translate the problem you want to solve into the perfectly calibrated input, then the calculator will provide not only correct output, but a valuable answer as well.

The same thing can be applied to chatbots. Rather than calculate numbers, the chatbot can be used to resolve problems. In this book we will focus on eCommerce. However the same concept can be applied to any type of chatbots as long as the purpose is clearly defined.

Customers on eCommerce websites expect quick responses and solutions to their inquiries. However, as a service becomes more popular, it becomes increasingly difficult to respond to each customer promptly. With limited resources, a company can only hire so many customer service agents before it becomes unsustainable. I've encountered companies that warn customers to expect a 48 to 72-hour wait for a response.

This is where automation, like chatbots, can be invaluable.

By automating routine customer service interactions, chatbots can reduce wait times and offer faster resolutions. I've often sent emails to customer support, only to receive a response days later. By then, the issue had resolved itself, but a customer service agent still had to read my message and attempt a solution. An automated agent could have quickly provided an update on my order status, saving both time and resources.

The purpose of a chatbot is not to engage in endless conversations, but to provide solutions to customer problems. Identifying this purpose early in your process is key to delivering real value to your users.

Fun Fact: Chatbots on Instant Messaging!

In the late 90s, chatbots found their first widespread commercial use on platforms like AOL Instant Messenger (AIM). These bots were built for customer service, answering simple questions, and even offering entertainment. One of the most famous was SmarterChild, an AIM bot that could answer trivia, give weather updates, and even perform basic tasks like looking up stock prices. SmarterChild laid the groundwork for modern virtual assistants like Siri and Alexa!

Why use a chatbot?

A common misconception when adopting chatbots is the belief that they can entirely replace human agents, leading to significant cost savings. This assumption often stems from the idea that a chatbot can handle any question, from mundane to complex, such as answering trivia like “What is the height of the Eiffel Tower?” However, this is misguided. Especially when it comes to eCommerce chatbots.

The reality is that a chatbot should not be seen as a complete replacement for human agents. They are a powerful tool that enhances your customer interaction capabilities. Companies don’t take 72 hours to respond to messages because they want to make customers wait. They do so because their agents are overwhelmed with a backlog of customer inquiries.

A chatbot shines when it comes to handling repetitive requests, reducing response time, and providing valuable metadata.

Handling Repetitive Requests

Chatbots excel at managing repetitive and straightforward customer inquiries, such as checking order statuses, answering FAQs about return policies, or providing shipping updates. By automating these routine interactions, chatbots can take over a large portion of customer service duties that would otherwise bog down human agents.

This frees up valuable time and resources for handling more complex issues, allowing the support team to operate more efficiently. In eCommerce, this not only boosts operational capacity but also improves the customer experience by providing quicker responses to the most common questions.

Clearing the Queue

By taking care of repetitive inquiries, chatbots help clear customer support queues, reducing the backlog that can lead to frustratingly long wait times. When routine questions are handled automatically, human agents are left to focus on more intricate problems that require personal attention or higher-level decision-making.

This results in faster resolution of both simple and complex cases, ensuring that customers with urgent or complicated issues aren’t left waiting for days. In turn, this improves customer satisfaction, as customers feel their issues are being addressed quickly and appropriately.

Providing Valuable Metadata

Even when a chatbot isn’t fully capable of resolving a customer’s complex problem, it still plays a critical role in assisting human agents. The chatbot can gather valuable metadata, such as the nature of the problem, the customer’s sentiment, and any relevant order or product information. This information can be used to ensure that the human agent receives a complete picture of the issue before stepping in.

This allows for a more seamless handoff, as the agent doesn’t need to start from scratch, enabling quicker and more efficient problem resolution. Additionally, the chatbot’s ability to categorize and summarize customer concerns helps human agents prioritize urgent cases and offer tailored solutions based on the initial data collected.


In essence, the purpose of a chatbot is not to replace human interaction but to complement it. By handling the volume of simpler tasks, chatbots allow companies to provide better, faster service while freeing up human agents to tackle more challenging customer concerns. When used correctly, chatbots become an integral part of a comprehensive customer service strategy, enhancing the overall customer experience rather than detracting from it.

The role of AI in a chatbot

It’s important to acknowledge that chatbots are powered by AI, or machine learning to be more accurate. The common assumption is that chatbots follow a straightforward process. You set an application endpoint that prepares the user input then sends it to the AI. The AI understands the input then generates a response. Here the chatbot is essentially a thinly veiled wrapper around a sophisticated AI like ChatGPT. The idea is that you train the AI with company information and it becomes capable of answering customer questions seamlessly.

const chatEndPoint = async (req, res) => {
  // Step 1: Initialize AI with configuration for eCommerce chatbot
  const ai = getAi({ type: "ecommerce" });

  // Step 2: Get the user input from the request body
  const userInput = req.body.textInput;

  // Step 3: Process the input with AI to understand the message
  ai.process(userInput);

  // Step 4: Generate a reply based on AI's processing
  const response = ai.generateReply();

  // Step 5: Return the generated response to the client
  return res.status(200).send({ content: response });
};

app.post("/chat", chatEndPoint);

In this model, your application is merely a small REST endpoint, while the AI handles the heavy lifting. The chatbot is seen as the decision-maker and resolver of customer issues, providing immediate solutions based on its training. However, this assumption is incorrect, especially in the context of eCommerce.

We could, in theory, build a chatbot without any AI by simply focusing on keywords that are common to the type of messages we expect from our audience. For example, if our customers frequently ask, "Where is my order?" we could write a script that looks for those words and responds with tracking information. For simple and repetitive queries, this could be perfectly fine—potentially handling around 10% of all messages. This approach alone would already be an improvement over having no automation at all.

However, this keyword-based approach comes with its limitations. While it might work for straightforward queries, it runs the risk of producing false positives, incorrectly responding to messages that contain the keywords but have an entirely different intent. For example, a message like, "I want to cancel my order, but I don't know where my tracking number is," may trigger the same response as "Where is my order?" even though the customer is requesting something entirely different. These false positives could lead to frustration and a poor user experience, undermining the very purpose of having a chatbot in the first place.

This is where AI comes in, allowing us to move beyond rigid keyword detection and into understanding the actual intent behind customer messages. By incorporating AI, the chatbot becomes more flexible, able to distinguish between different contexts and provide more accurate responses based on the user’s specific needs.

Fun Fact: The First Chatbot "ELIZA"

While modern AI-driven chatbots are capable of understanding context and delivering personalized responses, the first chatbot, ELIZA, was created in the 1960s at MIT by Joseph Weizenbaum. ELIZA simulated a psychotherapist by using keyword detection and simple pattern matching. It had no understanding of the conversation but could mimic responses by identifying keywords in the user's input.

Interestingly, despite its simplicity, many people felt like they were having meaningful conversations with ELIZA—highlighting how humans tend to anthropomorphize even the most primitive AI systems!

Throughout this book we will explore how and where AI is used in the process. But before we go any further, let’s define what a customer is supposed to be.

← Part One: Understanding Chatbots
CH02: Solving People Problems →