Volver al blog
explainersknowledge base

What Is a Knowledge Base Chatbot, and How Does It Work?

Mochii Team

Ask a general AI model about your return policy and it will give you a confident, plausible and quite possibly wrong answer. It has never read your return policy. It is guessing what a typical one says.

A knowledge base chatbot solves this by looking things up in your own content before it answers. This article explains how that works, in plain language.

The problem: models do not know your business

Large language models learn from public text up to a certain date. They know a lot about the world in general and nothing about:

  • Your products, prices and policies
  • Your internal documentation
  • Anything that changed after they were trained

Retraining a model on your documents is slow and expensive, and you would have to repeat it every time something changes. There is a simpler way.

The idea: look it up first

The technique is called retrieval-augmented generation, usually shortened to RAG. The name is technical but the idea is familiar. It is an open-book exam.

Instead of asking the model to answer from memory, the system:

  1. Finds the passages in your content that are relevant to the question.
  2. Hands those passages to the model along with the question.
  3. Asks the model to answer using what it was given.

The model contributes what it is good at: understanding the question and writing a clear answer. The facts come from you.

How the lookup works

The interesting part is step 1. How does the system find the right passage out of thousands?

Splitting. When you add a document, it is cut into smaller segments, typically a few paragraphs each. Small segments are easier to match precisely.

Embedding. Each segment is converted into a list of numbers that represents its meaning. Segments about similar topics end up with similar numbers, even when they use different words.

Searching. Your question is converted the same way, and the system finds the segments whose numbers are closest to it.

This is why a knowledge base chatbot can match "Can I send it back?" to a passage titled "Returns and refunds", although the two share no keywords. It searches by meaning.

Why context around a match matters

A matching segment on its own can be misleading. Imagine the retrieved segment says "This does not apply to sale items." What does not apply? The answer is in the paragraph before.

Good systems therefore pull in the neighboring segments as well. Mochii's knowledge base keeps track of what comes before and after each segment, and includes that context with the match, so the model sees the whole passage.

What makes answers good or bad

Since the facts come from your content, answer quality is mostly a content question.

  • Coverage. If the answer is not in the knowledge base, the chatbot cannot give it. Check what people ask and fill the gaps.
  • Clarity. A page that confuses a human reader will confuse the search as well. Clear headings and one topic per section help.
  • Freshness. Outdated documents produce outdated answers. For website content, an automatic refresh keeps things current.
  • Consistency. Two documents that contradict each other lead to inconsistent answers. Remove the old one.

Does this stop the AI from making things up?

It reduces it a great deal, and it does not eliminate it. A model given the right passage usually answers correctly. Problems arise when nothing relevant is found and the model fills the gap from general knowledge.

Two things help:

  • Tell the chatbot in its instructions to say when it does not know.
  • Review real conversations and correct wrong answers. In Mochii, a corrected answer is added to the knowledge base, so the same mistake does not happen twice.

Where to use one

  • Customer support: answer product, order and policy questions on your website.
  • Internal help desk: let colleagues ask about HR policies or technical documentation.
  • Personal research: ask questions across a pile of papers or reports.

Try it

In Mochii you can build a knowledge base from files and web pages, ask it questions directly, and attach it to a chatbot for your website.

Pon a trabajar hoy mismo a los mejores modelos de IA

Crea una cuenta gratuita en segundos y empieza a chatear, crear personajes o lanzar un chatbot para tu sitio web.

Plan gratuito incluido. Sin tarjeta de crédito.