Demo
Home » Blog » AI for business » How does an AI chatbot work, and how does it differ from a script-based chatbot?

How does an AI chatbot work, and how does it differ from a script-based chatbot?

Marichka made of dental materials with a smartphone glowing with chat bubbles, evening

An AI chatbot is a program based on a large language model that reads a customer's message in full and writes a response itself, drawing on your business data. A scripted bot cannot do this: it chooses a branch that someone drew in advance and shows a template. We are talking here about a bot for business in a messenger or on a website that advises your customers. General-purpose chats for personal queries are not considered here. The difference is easiest to see in a single message. An online store of dental materials, 22:10, Instagram Direct. A dentist writes: “Good evening. Is composite A2 in syringes available? And does it polymerise with my curing light, my one is old and LED?” The manager is already at home.

What happens during the half a minute while an AI chatbot is writing a response

Between the doctor's question and the reply, 10–30 seconds elapse: that is the response time Marichka AI claims for its AI manager. In those few seconds, the bot manages to do four things. It parses the message, searches for the necessary facts in your materials, puts together a response from them, and decides whether it can answer on its own. Each of these steps can be customised or messed up, so let's look at them one by one.

The model reads the message like a human, with all the “and alsos”

The female doctor asked two questions in a single message, abbreviated the shade name and mentioned an unbranded lamp. A button-based bot would probably only hook onto the word “composite”. The language model sees both questions. It understands that A2 here denotes a shade from the scale, and “old LED” is the condition upon which the second half of the answer depends.

Typos in words, surzhik, a voice message converted to text—for a model, that's just normal input. That is precisely why an AI chatbot, also known as an artificial intelligence chatbot, handles questions that cannot possibly be anticipated by a button tree.

Search your knowledge base

The model itself knows nothing about your inventory. It remembers general texts about dental materials and curing lights seen during training, but your remaining stock, prices, and the fact that the A2 batch arrived on Monday are not in that memory. Therefore, before answering, the bot searches the store's knowledge base for fragments related to the question: the product card, the manufacturer's instructions, and delivery terms.

This method has a name: retrieval-augmented generation, or RAG. The paper on it was written by Patrick Lewis with eleven co-authors, NeurIPS 2020. The authors combined the model's “parametric” memory, i.e., what is embedded through training, with “non-parametric” memory, i.e., an external document index, and according to their results, such models write more specifically and with a greater number of facts than a model that relies solely on what it has learned.

For a store owner, one practical thing follows from this. The bot's answer will not be more accurate than the documents it finds.

The response is written for a specific person.

The retrieved fragments are fed into the model along with the question and the rules on how to answer. From this set, it generates the text. The doctor does not need the entire product card. She needs to hear that A2 is available in syringes, how much one syringe costs, and what the manufacturer writes in the instructions regarding curing lights. If the database only contains the manufacturer's general requirement, the bot will relay it and ask for the model of the light to be provided.

The tone is also customisable. For doctors, it is appropriate to use formal address, write briefly and without emojis, and not explain medical terms because the interlocutor knows them better than the bot does.

Another thing that a script bot cannot replicate: the model remembers the entire dialogue. If in a minute the doctor adds “is A3 there too?”, the bot will understand that it refers to the same composite in syringes and won’t ask for the name again. If she returns an hour later with “order two”, it knows exactly what to order.

Shall I reply myself or get a human?

The final step is most often skipped in cheap solutions. The bot must assess whether it has found enough. Is there nothing in the database about compatibility with a specific bulb? Then the honest answer sounds something like this: “A manager will clarify the details regarding the bulb and message you in the morning.” The dialogue, along with the entire chat history, is handed over to a human.

Marichka AI is designed precisely like this: it responds only from the knowledge base and passes complex questions to an operator along with the context. The rest of the conversation, from availability to processing the order in the CRM, the bot handles entirely on its own. The doctor received an answer about A2 at 22:10, and the question about the lamp is waiting for the manager along with the already compiled order.

The same question in the script bot

A script bot responds to a doctor with a menu. It is built from branches: a greeting, “Catalogue”, “Delivery”, “Payment”, and “Contact manager” buttons, and a few trigger words. The bot finds the word “composite” in a message and sends a link to the catalogue section with several dozen items. It will not say anything about a lamp because no one has provided such a branch.

Next, the doctor has two options. She browses the catalogue herself at ten at night or presses “manager” and waits for the morning. If by morning she orders from another shop, the bot's report won't show this: formally, the dialogue has been handled.

A scripted bot does not become useless because of this. It is predictable: it will say whatever it has been programmed to, with zero chance of making things up. Buttons close tasks like order status by tracking number, opening hours, payment details, and booking a training session on a specific date faster than text. Nothing prevents combining both approaches: buttons for repetitive actions, and an AI chatbot for product consultations. What a scripted bot, an AI bot, and an AI sales manager look like side by side is shown in comparison of three types of chatbots using a cosmetics store as an example.

Why AI chatbots can sometimes be demonstrably wrong

A hallucination is a response that sounds convincing but does not correspond to the facts. For a dental supplies shop, this is a fictitious compatibility between a composite and a curing light, or a discount “for new clinics” that you have never offered. A dentist will believe it because the text is written confidently and without errors. Shop owners who are afraid of letting an AI chatbot interact with customers are most often thinking of this very thing.

Where this comes from is explained by Adam Kalai, Ofir Nahum, Santosh Vempala and Edwin Zhang in the paper “Why Language Models Hallucinate” (September 2025). Their thesis is that language models “sometimes guess when they are unsure” because training and evaluation reward guessing more than admitting uncertainty. The model has been trained to behave like a student taking a test. Anyone who writes at least something is more likely to get marks than someone who leaves the box blank.

Close-up of a female doctor's hands holding a smartphone with blank chat bubbles on the screen, with syringes containing material and a curing light on the table nearby

Does a knowledge base save you from this? Partially. Vectara maintains a public leaderboard of hallucinations, in which models are given a document and asked to summarise it using only facts from it. The conditions are very similar to a bot working with a knowledge base. According to Vectara's leaderboard, updated on 22 September 2026, across a sample of over 7,700 articles, the best model adds fabrication in 1.8 % of summaries. Across popular model families, the spread is wide: GPT from 3.1 to 15.1 %, Gemini from 3.3 to 13.6 %, Llama from 4.1 to 7.7 % depending on the version.

Nobody has a zero in this rating. The conclusion for the shop owner is a little unpleasant: an AI chatbot with a knowledge base makes mistakes less often, but it still makes mistakes. Protection is therefore built in several layers. The first layer (model selection and settings) rests with the supplier. The second layer consists of the rule to answer only from the base and hand over everything not found there to a human. The third layer, your knowledge base, is up to you.

What on your part keeps the bot within the facts?

A bot that answers exclusively from a knowledge base will repeat your mistake just as confidently as a model repeats its own. Therefore, the most frequent problems start in the documents you gave it. There are three traps, and they are all familiar to anyone who has onboarded a new manager.

First trap: two sources with different prices. The PDF price list from March is in the database next to the website where the prices are already new, and the bot will find both fragments: it is unknown in advance which one will end up in the response. For prices and stock levels, there must be a single source, and it must be updated without your involvement. In Marichka AI, the catalogue is pulled from website pages or PDF or Excel files, and prices and stock levels are updated automatically. It is better to delete old files from the database than to hope the bot will figure out for itself which one is more up to date.

Second trap: rules that exist only in the manager's head. For example, clinics with a contract get free delivery, but private doctors do not. If this sentence is not in the text, the bot will either stay silent or make up its own version based on general ideas about online stores.

The third trap is the void. Doctors ask about materials you do not stock and certificates you do not have. Without an explicit rule, the bot will try to help and will make things up. Add directly: if the product is not in the catalogue, we say that we do not stock it and suggest the closest available alternative.

Clearly state what the bot does not handle on its own, even when the answer seems obvious. For a dental supplies store, this includes discounts beyond the price list, returns of opened packaging, and any advice regarding patient treatment. The bot immediately transfers such conversations to a human. Better one unnecessary transfer than advice that one would later have to apologise for to a doctor.

For the first few weeks, it is useful to read the dialogues that the bot has passed on to people every morning. Each such dialogue shows which line is missing from the database. You add the line, and next time at three in the morning the bot will answer itself, without making things up and without waiting until morning.

Six messages that will test the bot in a single evening

Before paying for any AI chatbot, test it on your own data. Upload your catalogue and rules, connect a test channel, and write to it like the most demanding customer. Six messages will show you more than any demo video.

  1. A2 comes in syringes, and will my old LED lamp cure it? The bot must answer both parts or honestly hand over to a human.
  2. An item you don't stock. The correct reaction: “we don't carry that” and an alternative from the catalogue, without invented specifications.
  3. Discount request: “I buy from you all the time, will you make it cheaper?” The bot has no right to promise things that are not in the rules.
  4. A question about the price you just changed on the website. That shows whether auto-update actually works.
  5. Message with errors and surzhik, as written from a phone between patients. The bot must understand the meaning and reply to the point.
  6. Please ask a person to step in. Check that the manager has received the conversation history and that the client knows when to expect a reply.

Log every response where the bot hallucinated or stayed silent, and see what was missing: a row in the database, a transfer rule, or understanding from the model. The first two causes can be fixed by configuration in a few minutes. The third gives reason to look for another product.

The difference between an AI chatbot and a scripted one comes down to who compiles the response: a human in advance or the model at the moment the question is asked. That is the source of both the strength and the risk. A scripted bot will not invent anything, but neither will it answer a question outside its decision tree. An AI bot will give a doctor a substantive answer at 22:10, provided it has sources for the facts and knows when to stop. Seven days of the Marichka AI trial will be enough to run these six messages through your own catalogue and see which one the bot trips up on.

Ready to connect Marichka to your channel?

Marichka AI will help you automate communication, reply to clients 24/7 and increase sales.

Frequently asked questions

Can an AI chatbot make up an answer?

Maybe, if it isn't restricted. A language model sometimes guesses where it should admit that it doesn't know, and writes it in a confident tone. The risk is reduced by a knowledge base from which the bot takes facts, and the rule to hand over to a human every question for which the answer is not in the base.

How to train an AI chatbot on your own products?

The model itself is not retrained for this. The bot is given access to the store's catalogue and rules, and before each response, it searches there for the required fragment. In Marichka AI, the catalogue is pulled from website pages or PDF or Excel files, and prices and stock levels are updated automatically.

Will an AI chatbot replace a sales manager?

Not at all. The bot handles standard questions and conducts conversations during hours when no one is available. Complaints, non-standard queries, and decisions regarding discounts remain with a human, and the configured bot transfers such a conversation to a manager along with the chat history.