Home · Blog · How an AI chatbot uses a knowledge base

How an AI chatbot uses a knowledge base

· updated · Command CHBT · AI

The AI agent in CHBT is not a “chat with a neural network in a window” or a model trained on your data. This is a language model of your choice, which is shown three things with each response: your instructions (role), your knowledge base in the form of text, and up to the last ten messages of the conversation. All of its strengths and weaknesses follow from this device: what it will answer exactly, where it will start to fantasize, what the price of the answer depends on, and in which tasks a push-button bot is more honest. We analyze mechanics, boundaries and economics; setting up by channels - in separate articles of the cluster, links at the end.

Three sources for one answer

If you are choosing a tool for responding to clients, check out AI agent capabilities CHBT. This article explains the response structure and its limitations.

When a client writes to a bot, and the “AI agent” block is in the script, the model receives one compound request out of three parts:

  1. Role - your instructions from the agent card in the “AI Agents” section: who he is, how he responds, what he doesn’t do. Usually 6–10 lines.
  2. Knowledge base - free text: description of the company, prices, conditions, answers to frequently asked questions. Entirely, with each answer.
  3. History - up to 10 last conversation messages, including the agent’s responses: as many as fit in the model window along with base.

For example. The client writes: “Will you come beyond the Ring Road?” The model sees the role (“studio consultant, answer briefly, only from the database”), the entire database - where, among other things, the line “Departure to the Leningrad region: up to 30 km from the Ring Road, +1500 ₽” - and previous remarks, from which it is clear that we are talking about replacing the wiring. Answer: “Yes, we travel up to 30 km from the Ring Road, additional payment is 1500 ₽. Name the locality and I’ll specify the date.” Not a single fact that is not in the database; wording - models.

The model reads all this and writes the answer. No “training” in the sense of additional training of the scales occurs: we changed the line in the database - the next answer already takes it into account. Hence the limit: the agent knows exactly what is written in the database and said in the last remarks (no more than ten). He doesn’t remember yesterday’s conversation, doesn’t see your CRM and doesn’t look at the website.

A practical corollary about history: in a long conversation, the facts drop out from the beginning. If the client named the city in the first message, and asks about delivery in the fifteenth, the agent can ask again. Put everything that should always be “remembered” in the database, and don’t rely on conversation.

Which model answers

The one you select in the agent card. There are 10 models to choose from: GPT-5 nano, GPT-5 mini and GPT-5.6 Terra (OpenAI), Claude Haiku 4.5, Claude Sonnet 5 and Claude Opus 4.7 (Anthropic), Gemini 3 Flash and Gemini 3.5 Flash (Google), DeepSeek V3.1, Qwen 3.7 Plus (Alibaba). The default response is Gemini 3 Flash. The list is sorted by price; Each model has the speed, quality of the answer, how it writes in Russian and how many credits the answer costs.

How to choose for the task. For the answers “how much does it cost” and “when will it be delivered”, there are enough models for 1 credit: there are 5 of them, and they differ mainly in style and speed. Powerful models - Claude Sonnet, GPT-5.6 Terra, Claude Opus 4.7 - hold the role more accurately, better understand careless and complex questions and are more convincing in sales, but are more expensive: up to 7 credits per answer. A convenient way is to start with the default model, run twenty typical questions in the “Test” and only if you are not satisfied with the answers, try the model more expensive.

ModelDeveloperFor answer
GPT-5 nanoOpenAI1 credit
Qwen 3.7 PlusAlibaba1 credit
GPT-5 miniOpenAI1 credit
Gemini 3 FlashGoogle1 credit
DeepSeek V3.1DeepSeek1 credit
Claude Haiku 4.5Anthropic2 credit
Gemini 3.5 FlashGoogle2 credit
Claude Sonnet 5Anthropic3 credit
GPT-5.6 TerraOpenAI4 credit
Claude Opus 4.7Anthropic7 credits

Next - temperature: the lower, the closer the answer to the text base and the less variability. For consultations on prices and conditions, keep it low. Models GPT-5 and Claude do not have a temperature - their field is hidden.

Two things you should know in advance. Any model sometimes writes in clerical writing and unnecessary introductory notes, and the cheapest ones are simpler than others, so the line “answer briefly, up to three sentences” in the role is almost always needed. And the request to the model includes your database and the text of the conversation: it is transferred to the model developer, processing takes place outside of Russia, so there is no need to put personal data of clients and internal information of the company into the database.

How is this different from a push-button bot?

The difference between a push-button script and an AI agent comes down to who formulates the answer: in the script, you wrote every word - the answer is predictable, free and available with the “Free” plan, but the question outside the menu rests on “I didn’t understand” or the operator; the agent understands any wording and responds according to the base from the “Basic” loan plan for the answer, but his typical mistake is a confident answer where the base is silent. Comparisons based on plan, fee per answer, predictability, reaction to off-script questions and risk - along with calculation of the cost of ownership for the year - included in the article push-button, AI or hybrid: how to choose the type of bot.

One difference that comparisons tend to forget is that the agent responds with text but does not act. It doesn’t record in CRM, doesn’t put tags, doesn’t send a webhook - all these are script blocks around it. Therefore, the “bot with a neural network” in CHBT is in practice always a hybrid: the script leads and acts, the agent explains.

What does an agent do well?

  • Answers a question for which the answer is in the database, no matter how it was asked: “how much does it cost”, “how much”, “price?” - the same for the model.
  • Keeps the conversation going within the latest messages (up to 10): “what if there are two pieces?” after asking about the price, he will understand correctly.
  • Works around the clock in all channels - Telegram, MAX, VKontakte, widget on the site - from one script, because the script in CHBT is one for all connected channels.
  • Transmits conversation to a person: when you are not sure of the answer or does not find it in the database, the “AI Agent” block goes through the “did not understand” port - send it to the “Operator”. Catch the word “operator” in a separate script with the “Keyword” trigger: it will work if the agent is in the “Reply and continue script” mode.
  • Changes without a programmer: base edit - plain text, takes effect immediately.

In addition to the agent, there are two other AI functions in CHBT that are confused with it. "AI flow" in the editor - generating a script according to the description: “a bot for making an appointment at a barbershop with a choice of a master and a phone number” turns into a set of blocks, which is then edited by hand. And AI text editing - “add a collection of e-mail after the greeting.” Both work at the assembly stage and have nothing to do with responding to clients; they also spend credits - at the price of the selected model, and only if the flow was assembled by the model.

A separate strength is the long tail of questions. The button bot covers 5–10 common topics well; There are not enough buttons for 40 rare questions, and in the database they occupy three lines each. This is why the agent most often stands behind the “Another question” button, and not at the entrance.

Where are the boundaries?

  1. Outside the base - either a refusal or an invention. To a question that is not in the database, a good agent says “let me clarify” and passes it on to the operator; bad - he composes confidently. Which of the two will happen depends on the role and explicit prohibitions in the database, and not on the model.
  2. Text knowledge base. Add text, link page or PDF, DOCX, TXT, MD, CSV file. Only the text is taken from PDF and DOCX, scans without a text layer are not recognized; the link loads one page, not the entire site. In Telegram, MAX and VKontakte, the bot sends text and buttons, without pictures and files; the files are only in the widget, and they are read by the operator, not the agent.
  3. Volume is limited by model. The entire database goes to the model with each question, along with its role and history, but the model’s window is small: services with price lists are included, but a catalog of hundreds of items is not. In CHBT, the database of one agent is up to 15,000 characters, which is about six pages. The solution is categories instead of positions or several agents in different branches of the flow.
  4. Memory - up to 10 latest messages and only the current conversation; With a base near the limit and long answers, less can be placed.
  5. No action. It will not make an appointment (there is no calendar or slots in CHBT - the entry is a text request), will not accept payment, will not check the status in your system.
  6. There is no list of unanswered questions. You can find out what the database is missing only by reading the conversations transmitted to the operator.
  7. There are no block counters. In “Analytics” there are incoming and responses from the bot and the operator by day for 14 days (the agent’s responses are included in the “Bot’s responses”) and the number of conversations that are waiting for the operator, but not “how many people reached the agent’s block” - this is considered tags through “Action → Add tag” before the block.

None of the boundaries interfere with the launch if you know about it in advance and put it in the script: the file is for the operator, the entry is in “Data Collection”, the order status is in the text “how to see for yourself.”

Economics: the price of the answer depends on the model

Tariffing does not depend on the length of the question and answer, only on the model: agent response to default models (Gemini 3 Flash) - 1 credit, on powerful models - up to 7 credits. Credits are included in the plan: “Basic” (650 ₽ per bot per month) - 150 credits and models up to 2 credits per answer (7 out of 10), “Business” (1290 ₽) - 500 credits and all models. There is no AI on “Free”.

If we roughly assume that the plan was purchased for the sake of AI, answering models for 1 credit costs 4.3 rubles on “Basic” and 2.6 rubles on “Business”. The table below is for models for 1 credit; on the 2-credit model, it will take twice as many credits. It’s more honest to think differently: the plan also covers unlimited conversations, canvas, broadcasts, operators without restrictions - and credits come from above.

FlowConversations with AI per monthResponses to conversationCreditsplan
Master, small studio30390"Basic" plan
Clinic, school, service1203–4360–480"Business"
Shop with traffic40041600AI only for the “long tail”

When the credits run out, the agent responds with a neutral text, and the script goes along the fallback branch - the “AI Agent” block has such an exit. Lead him to “Operator” or to “Data Collection”: the client will receive a person or leave contact, not silence.

Three ways to spend less: buttons for the most frequently asked questions before the agent block (free), greeting with the “Message” block rather than an agent, and a direct “Call a person” button for those who do not need a neural network. Current prices and plan composition are on the page Plans page.

When AI is not needed

Signs that a push-button script will solve the problem better and cheaper:

  • There are few questions and they are the same. Five to seven topics are a menu of buttons and ready-made messages; template "Autoresponder FAQ" It assembles in half an hour and works on “Free”.
  • We need to collect data, not explain. Application, recording, registration - the “Data Collection” block with phone and e-mail verification is more reliable than any conversation with the model.
  • The answer must be verbatim. Legal formulations, medical contraindications, conditions of the promotion - things that cannot be retold in your own words.
  • There is no one to write the database. Agent without a base - a generator of common phrases. If no one collects the text of the database and updates it, AI will not help.
  • Flow less than 30 conversations per month and there is no budget for the plan: on “Free” with its 30 conversations, AI is not available, but the push-button bot is yes.
  • Clients write by voice and photographs. The agent works with text: he will not understand the voice message and photo of the product, such conversations will still go to the operator.

And the opposite sign is when AI is justified: there are many heterogeneous questions, the answers to which have already been written, and clients write at night or on weekends, when there are no operators.

Hybrid: place of the “AI agent” block in the flow

The working scheme is the same for consultations, support and the site - only the buttons differ:

  1. Trigger: /start command in Telegram, “any message” where there are no commands, “Opening a widget” on the site.
  2. “Message” is a greeting with buttons: typical tasks, “Another question,” “Call a person.”
  3. Typical buttons are ready-made messages and “Data collection”. No loans.
  4. “Another question” - “AI agent”. You can put “Action → Add tag” in front of it so that you can then count how many people reached the neural network.
  5. After the agent - “Operator”. There is also an exit to the exhaustion of credits and a “Call a person” button.

Two additions that will not be useful to everyone. Block “Condition” by time of day: during the day - directly to the operator, at night - to the agent; this reduces the consumption of loans where people are already in place. And the trigger "Intent" — AI text classification: the script starts when the message is similar to the given topic (“I want to return the product”), and leads along the desired thread without buttons. It is useful when clients write in free text instead of clicking buttons.

Where to start: cluster map

This article is about the device and boundaries. Specific assemblies are in the neighboring ones:

The order for the first launch: collect the database in a text file → create an agent and run a test chat in the account → insert the “AI Agent” block into the script behind the “Another Question” button → put “Operator” after it → a week on “Basic” or “Business” and analyze the transferred conversations. A trial period of “Business” for 1 day is included in the “Payment” section. Create a bot and try an AI agent →

More on the blog