An AI chatbot on my own website that answers from the site’s pages, shows which pages it used, and passes the rest to WhatsApp.
- Client
- Kuraib Ali (in-house build)
- Sector
- Own business · website AI chatbot
- Timeframe
- Running on kuraib.site, recorded November 2026
- Engagement
- In-house: built and run on my own website, not a client project
How the retrieval-augmented generation (RAG) chatbot on my website answers
The question is matched against passages built from my site, the best ones go to the language model, and the reply shows up to three source pages.
- VisitorAsks in the chat on my websiteThen: Question
- SearchBy meaning and by exact wordsThen: Looks up
- My site’s pagesPassages built from the site at build timeThen: Best passages
- Language modelTold to answer only from those passages, no prices of mineThen: Answer
- ReplyWith up to three source pages
No passage covers it? The chatbot says so and points to WhatsApp.
A RAG chatbot (retrieval-augmented generation) looks up passages from a business’s own content first, then has the AI model answer from those passages only. I built one for my own website. Its index is made from the site’s pages at build time, each answer lists the pages it used, prices of my own services are never quoted, and a short name and email form before the first chat emails me the lead. It is in-house work.
The situation
Visitors to my website ask questions the pages already answer, but the answer can sit three clicks away.
A general AI chatbot would answer them quickly and also make things up: a price I never set, a result I never had. I wanted a chatbot that reads only my own pages, names the pages it used, refuses what they do not cover, and tells me who started a chat. This is an in-house build for my own website, not a client project.

The move
- 01
Build the index from the site itself. At the start of every build a script reads the site’s own content (posts, case studies, offers, the services pages, About and the site facts), cuts it into passages of about 220 words, and stores an embedding (a list of numbers that captures meaning) for each. A passage whose text has not changed keeps its stored vector, so a routine deploy embeds nothing new. A GitHub workflow commits the index when content changes on the main branch, and the build never fails for want of it: passages without a vector fall back to keyword search.
- 02
Search two ways, then answer from the results only. Each question is matched by meaning (embeddings) and by exact words (BM25 keyword ranking), and the two lists are merged, so an exact term is never pushed out by a vague neighbour. The top passages, at most two from one page, go to the model with rules: answer only from them, say so when they do not cover the question and point to WhatsApp, never state a price for my services, never promise a result.
- 03
Show the sources and leave some things out. The model ends each answer with the passage numbers it used, and the visitor sees up to three source pages as links. Pages about the brokerage where I work in-house are kept out of the index and of the WhatsApp assistant, my decision of 8 October 2026, and a check reads the committed index to confirm it.
- 04
Capture the lead, then get out of the way. Before the first chat, a short form asks for a name and email, phone optional. It is emailed to me and recorded as a lead event in Google Tag Manager. If the email fails, the visitor still chats. Each address can ask 20 questions in ten minutes, with a daily cap for all visitors, so one person cannot run up the model bill.

Photograph Zulfugar Karimov, Unsplash
What changed
States of the system, not metrics. These are things that either were or were not true, so they can be stated without claiming a result.
| After | ||
|---|---|---|
| Where answers come from | A general model’s memory | Passages from the site’s own pages only |
| A question the pages do not answer | A confident guess | Said plainly, with WhatsApp offered |
| A question about my prices | Whatever the model says | No figure; a pricing PDF on request |
| How a visitor checks an answer | They cannot | Up to three source pages linked under the reply |
| Who started a chat | Unknown | Name and email emailed to me before the first chat |
| When the content changes | Not applicable | The index is rebuilt from the pages on the next build |
What shipped
- Build-time index of the site’s own pages, about 220 words per passage, with embeddings reused when the text is unchanged
- Hybrid retrieval: embeddings and BM25 keyword ranking, merged by rank
- Answer rules: context only, no prices of my own, no promised results, hand-off to WhatsApp
- Up to three source pages shown under each answer
- Exclusion filter for one business, checked against the committed index
- Name and email form before the first chat, emailed to me, with a honeypot field for bots
- Rate limits per address and a daily cap for all visitors
- Backup answer models when the first is out of free quota, and a plain message when all are
What this build was held to, and how each item was checked.
- Index size
- 841 passages, 63 pages
- api/_rag/index.json as committed, read 29 Nov 2026, before these case pages were added; every passage has a 256-dimension embedding
- Passages naming the excluded business
- None
- A check in scripts/wa-test.mjs reads the committed index
- Endpoint tests
- 11 of 11 passing
- Vitest, run 29 Nov 2026: tests/chatbot-lead.test.mjs, tests/gemini.test.mjs and the chatbot and lead cases in tests/abuse.test.mjs
- Questions per address
- 20 per 10 min
- Server-side limit in api/gemini.js, plus a cap of 600 a day for all visitors
- Sources shown per answer
- Up to 3
- Set in api/gemini.js from the passage numbers the model names
Each row is a property of the system, read from the code, its tests or the committed index on the date given. This is an in-house build for my own website, not a client project.
Questions about the RAG website chatbot
What is a RAG chatbot?
Is this a client project?
How is the index built?
What does it refuse to say?
Is anything left out of the index?
How are leads captured?
Related services and reading
Next project
Kuraib Ali (in-house build)
Two automations that run my own business: hot leads into a sheet every hour, and tasks given by voice that an AI agent carries out.
Want a chatbot that answers from your own pages? Tell me what your site covers and what visitors ask.
hello@kuraib.site