AI chatbot for WhatsApp Business API: Integration with RAG and LLM

Inquiries in WhatsApp get lost during peak times, and operators cannot keep up with repetitive questions. We develop turnkey AI chatbots: we connect search over your knowledge base so the customer gets an answer immediately, and the team handles only complex cases. We reduce response time and remove routine from support.
Frequently Asked Questions

WhatsApp AI chatbot: where incoming requests break down

Messages arrive in the messenger around the clock, while support works on a schedule. A message sent late in the evening stays unanswered until morning — and by then the customer has either gone to a competitor or placed an order where they got a faster reply.

Such lost requests are almost invisible in reporting: the dialogue never happened, so it isn't in the statistics either.

Peak load finishes off what working hours didn't. After a broadcast or on a sale day, the inbound flow grows several times over, the queue of requests stretches out, and first response time goes beyond tens of minutes.

During those hours, operators spend their energy on the same typical questions — about delivery times, availability, payment, returns — and have no resources left for complex cases.

A separate pain point is the memory of the dialogue. A new employee opens the conversation and doesn't see what was already promised to the customer, which order was discussed, what was decided last time.

They ask the same questions again, the customer repeats their story for the third time and leaves frustrated.

All three bottlenecks — receiving outside working hours, absorbing peaks, and a single request history — are closed by a layer on top of the WhatsApp Business API with a knowledge base and a language model. Let's break down how it's built and what it gives the business.

What changes after launch: speed, accuracy, offloading

Launching the bot doesn't cancel the support shift — it changes which requests reach it. We take measurements before the start and two weeks after, so the effect reads in numbers, not in feelings. Below are five values that shift first and show that the solution is working.

First response time and the share of dialogues without an operator

In the usual mode, a customer waits as long as the operator spends on the previous dialogue: during peak hours that's minutes, at night it's until morning. The bot responds in seconds and keeps that pace around the clock, including weekends. First response time stops depending on shift load and the customer's time zone.

The share of dialogues without an operator is the second control value. We calculate it as the ratio of requests fully closed in the chat to the total flow.

On typical topics — order status, terms, availability, booking — it stays high, while everything that requires a human decision goes to an operator with the conversation history already assembled.

Eliminated failure classes and shift load

Separately, we record eliminated failures: abandoned dialogues outside working hours, leads lost inside a conversation, off-topic answers caused by outdated information. Previously, each such case meant a lost customer; now it's closed at the moment of the request.

Support offloading is visible in the structure of the shift: the night flow no longer requires someone on duty, and during the day operators take on complex questions instead of identical ones.

Around-the-clock reception appears without expanding the staff — routine goes to the bot, and people handle what genuinely needs decisions.

Chatbot assembly options: scripts, knowledge base search, hybrid

The three approaches differ not in the "intelligence" of the model, but in who determines the next step of the dialogue: a pre-written script, a search across the knowledge base, or a combination of the two.

The choice is dictated by how predictable the questions are and the cost of an error — where a wrong answer is expensive, freedom of phrasing hurts.

Option When it fits Limitations
Dialogue scripts Typical operations: booking, request status, a short form Doesn't understand phrasing outside the branches, each new topic is a manual change
Knowledge base search Large heterogeneous documentation, free-text questions Answers from the fragments found: an outdated base produces confident errors
Hybrid scheme Some steps are strict, others are consultation Harder to maintain: routing rules are needed between script and search

How a script differs from knowledge base search

A script is a state graph: the bot knows the valid answers at each step and always drives the dialogue to a result. Knowledge base search works differently: a question looks for close fragments in the documentation, and the model formulates an answer from them.

The first gives predictability without inventing things, but breaks on non-standard phrasing; the second handles natural language, but depends on how fresh the base is.

The hybrid scheme removes this trade-off: key actions follow the script, the rest goes to search, and at low confidence — to an operator.

Channel and external service limitations

WhatsApp Business API sets the boundaries: outside the free-response window you can only write with an approved template, buttons and media have limits, and broadcasts require the recipient's consent. That's why notifications are planned in advance rather than on the fly.

Handover to an operator is designed as part of the logic — the dialogue goes into the queue together with the history and a draft reply, so the customer doesn't start the conversation over.

Implementation stages: from conversation audit to handover

Dialogue audit and route map

We start by exporting the conversation history from the WhatsApp Business API and reviewing it manually: how many requests, what topics, where the operator's reply lags. This shows the real scope of automation, not the assumed one.

  1. Dialogue audit. We label the export from several months by topic and typical phrasing — this gives us the share of requests the bot will close on its own without losing quality.
  2. Route map. We fix the script branches and escalation rules: by what sign a human is connected, what the operator sees at the moment of handover.

Setup, checks, handover

After the route map is approved, we move on to assembly and checks — at this stage the content changes, but not the logic of the script.

  • Knowledge base assembly. Regulations, the catalog, and typical answers are cut into fragments and linked to search: the model answers from sources, not from memory, and every reply can be verified.
  • Channel connection. We register the number, set up message templates and notifications about new requests, and check delivery and statuses on a test account.
  • Acceptance checks. We run a set of control dialogues, including incomplete and provocative questions, record inaccurate answers, and fix the base before handover.
  • Handover to operation. We hand over the accesses, the route scheme, and the operator instruction, and show how to update the knowledge base and view statistics on your own.

What stays with the team: configurations, schemes, regulations

The solution stays with the client not as a "black box," but as a set of documents and settings by which the bot can be developed without us. We record every decision made — from connection parameters to the rules by which an operator takes a dialogue away from the bot.

Technical artifacts and access rights

  • Working bot configuration: number parameters, message templates, retry rules for non-delivery, and settings for handing the dialogue over to a human.
  • Dialogue route map: which scenarios go to the knowledge base, which go straight to an operator, where clarifying questions kick in.
  • Populated knowledge base: labeled materials, the rules for splitting into fragments, and the test questions used to verify answer accuracy.
  • Access rules and roles: who sees the conversation, who edits the scripts, who exports the history — with an action log for every change.
  • Integration scheme: how the bot gets data from the accounting system and what happens when an external service is unavailable.

Instructions for operators and the owner

  • Operator instruction: how to take over a dialogue, what's visible on the screen, how to return the bot to work, and what to do in typical failures.
  • Update regulation: the procedure for adding materials, checking answers before publication, and rolling back to the previous version of the script.
  • Acceptance checklist: the control questions by which the owner checks the bot after every edit.

Case: how the flow of requests stopped getting lost during peak

What it was like before launch

The peak came in a wave: a seasonal promotion generated up to four thousand inbound per day, and the entire queue landed on nine operators across two shifts. First response time during peak hours reached 40 minutes, and at night a request waited until morning.

Every twelfth message went unanswered altogether — the dialogue closed on the waiting timeout, when the customer had already gone to another seller.

Manual routing made the picture worse: the operator looked up the order in the accounting system and the knowledge base by hand, and typical questions about delivery, availability, and returns ate up to a third of the shift.

Hiring didn't help — bringing a new operator up to flow took weeks, and the peak still outran the staff.

What it became after, and how it was measured

We built an AI chatbot on the WhatsApp Business API: the inbound flow goes into an asynchronous queue, the model formulates its answer based on RAG over the knowledge base and stock levels, and the dialogue is handed to an operator by rules — the model isn't confident, the customer asks for a human, the topic is outside the regulation.

Measurements were taken over comparable periods: two weeks before and after, the same scenarios, and one labeling of the dialogue export.

First response time — 8 seconds, including at night; the share of dialogues closed without an operator — 63%; requests without an answer — 0.7%.

According to Gartner, a customer in a messenger waits a minute for a reaction and leaves if there is none — that's why we put the first metric into the main report.

How does knowledge base search differ from scripts?

A scripted bot is a decision tree: a message is matched to an intent, the intent is tied to a branch, and the branch returns a prepared answer or triggers an action.

The phrasing is fixed, only a finite number of transitions need to be checked, and the risk of an invented answer is zero. While typical questions number in the dozens and repeat, this is the most predictable option.

Answers from documents are built differently: a query is turned into a vector, relevant fragments of regulations, instructions, and contracts are pulled from the knowledge base, and the model builds an answer only from them.

What's critical isn't generation but the splitting of documents into fragments, the freshness of the index, and the confidence threshold: below the threshold, the bot hands the dialogue to an operator rather than completing the answer itself.

The choice of approach is set by the type of questions. Booking, order status, payment — a script: determinism and the same answer to the same request matter there.

Reference questions and the long tail ("what if I'm not in the city," "what are the terms for legal entities") — document search. The workable scheme is a hybrid: a router determines the type of question and passes it to the right layer.

If the bot already runs on scripts and hits non-typical questions, migration happens without stopping the service.

First we enable logging of unrecognized requests, from them we assemble a labeled set for measuring answer accuracy, then we add a document search layer and roll it out to a share of traffic with a fallback to the script.

For WhatsApp Business API, this is separate work: short replies and buttons limit the answer format, so the search layer is designed for them right away — with the splitting of long excerpts and a link to the source.

Technical doubts: accuracy, data, handover, rollback

Five questions most often raised in a technical review: accuracy on non-standard phrasing, the fate of the conversation, live dialogue handover, knowledge base updates, and the reversibility of changes.

How accurately does the bot answer if the customer writes in their own words?

The answer is built on semantic search across the knowledge base, not on phrase matching. The bot answers only when the found fragment is close enough; below the threshold, it doesn't guess — it asks a clarifying question or hands the dialogue to an operator. We calibrate the threshold using the logs from the first weeks.

What happens to customer conversations?

The history travels over a secure channel and is stored in your own environment — it doesn't go to train third-party models. The retention period is set by policy, and access is separated by roles.

How does handover of the dialogue to an operator work?

It triggers on the person's request, a repeated failure to understand, or a key topic. The operator receives the history, the knowledge base fragments found, and the version of the script — the customer continues the conversation rather than starting over.

How is the knowledge base updated?

The sources are exports, documents, tables, articles; reindexing runs on a schedule or as soon as something changes. New materials enter as a separate layer, so they're checked on a test environment before publication.

Can changes be rolled back?

The script and the knowledge base are versioned: reverting to the previous version is one operation, restoration takes minutes. Dialogues already underway finish on the previous version and don't break off.

Let's discuss the task and come back with an estimate and a plan

To make the first conversation substantive and take an hour rather than three, it's enough to send the inputs — our engineers will clarify the rest themselves.

Describe which scenarios the WhatsApp AI chatbot should cover and who on the client's side is responsible for the knowledge base and the support regulation.

  • 8–10 real examples of dialogues with an operator: from them you can see where requests are currently getting lost and which answers repeat most often.
  • A list of channels and entry points: WhatsApp, web form, phone — it's important to understand what the bot closes on its own and what it passes along the chain.
  • Escalation regulation: in which cases the conversation goes to a live operator, by what sign, and with what conversation history.
  • The composition of the knowledge base: documents, instructions, tables — and how they're kept up to date.
  • Data and access restrictions: what can be sent to the model and what stays in a closed environment.
  • Requirements for implementation timelines: by what date a pilot launch is needed and what volume of requests it must sustain.

Based on the review, we come back with an estimate and a plan: the scope of work, the order of stages, the control points, and the boundaries of the pilot, after which we expand the scenarios. Let's discuss the task — that's where any implementation begins.

AI Development Areas

Latest works

  • B2B ADVANCE company website development
    B2B ADVANCE company website development
    1542
  • Development of a web application for FEEDME
    Development of a web application for FEEDME
    1394
  • Website development for BELFINGROUP
    Website development for BELFINGROUP
    1081
  • Development of an online store for the company FURNORO
    Development of an online store for the company FURNORO
    1369
  • B2B Advance company logo design
    B2B Advance company logo design
    816
  • Development of a web application for Enviok
    Development of a web application for Enviok
    1142