Fundamentals
How do AI website chatbots work?
AI website chatbots feel like magic: you ask a question in plain English and get a specific, accurate answer drawn from a company’s own content. But there is no magic — there is a well-defined pipeline underneath, and once you understand it, you can tell a trustworthy chatbot from an unreliable one.
An AI website chatbot works by crawling a website’s content, splitting it into small passages, converting those passages into numerical representations called embeddings, storing them in a vector database, and then — at question time — retrieving the most relevant passages and asking a language model to answer using only those passages. This approach is called Retrieval-Augmented Generation, or RAG. This article walks through every stage.
On this page
- The short version: retrieval, then generation
- Step 1: Crawling — reading your website
- Step 2: Chunking — splitting content into passages
- Step 3: Embeddings — turning text into meaning
- Step 4: The vector database — storing meaning for fast search
- Step 5: Retrieval — finding the right passages at question time
- Step 6: Generation — writing a grounded, cited answer
- Putting it all together
The short version: retrieval, then generation
A modern AI website chatbot does not answer from the language model’s memory. It first retrieves relevant passages from your content, then asks the model to write an answer grounded in those passages.
This two-step design — retrieve, then generate — is what separates a reliable website chatbot from a generic one. A plain language model answers from patterns it learned during training, which is why it can confidently state things that are outdated or simply wrong. A retrieval-augmented chatbot is constrained to your actual content, so its answers are grounded and verifiable.
Everything below is really just the detail of how those two steps are built: the ingestion pipeline that prepares your content for retrieval, and the answer pipeline that runs every time a visitor asks something.
Step 1: Crawling — reading your website
The first job is to read your website. A crawler starts at a URL you provide, fetches the page, finds the links on it, and follows them — repeating until it has read your site. Good crawlers respect `robots.txt`, follow your sitemap, and stay within your approved domain rather than wandering off across the internet.
Raw HTML is messy: it contains navigation menus, footers, cookie banners, and scripts that have nothing to do with your actual content. So the crawler cleans each page down to the meaningful text — headings, paragraphs, lists, and tables — and discards the boilerplate.
Some modern sites render their content with JavaScript, which a simple HTTP fetch can’t see. A capable crawler detects these and re-fetches the page through a headless browser so the real content is still captured. This is one of the details worth checking when choosing a chatbot builder — SiteMind handles it automatically, and only for the pages that actually need it, to keep crawling fast.
Step 2: Chunking — splitting content into passages
AI systems retrieve passages, not whole pages, so long content is split into small, self-contained chunks — each ideally answering one idea.
Imagine a single 4,000-word page that covers shipping, returns, and warranty. If a visitor asks about returns, you don’t want to hand the entire page to the model — that’s wasteful and dilutes the relevant part. Chunking breaks the page into focused sections so the system can retrieve just the returns passage.
Good chunking respects the structure of the content: it keeps a heading with the text beneath it and avoids cutting sentences in half. A typical chunk is a few hundred words — small enough to be precise, large enough to stand on its own.
Step 3: Embeddings — turning text into meaning
Computers can’t compare meaning directly, so each chunk is converted into an embedding: a long list of numbers that represents what the text means. Chunks about similar topics end up with similar numbers, even when they share no words.
This is the key that makes meaning-based search possible. “What time do you open?” and “When are your hours?” produce embeddings that sit close together, so the system can match a question to the right content regardless of exact wording.
| Text | Roughly near… | Because |
|---|---|---|
| “Do you deliver on weekends?” | “Saturday and Sunday delivery” | Same meaning, different words |
| “Can I get a refund?” | “Our return policy” | Same intent |
| “Is parking available?” | “Where to park nearby” | Same topic |
Step 4: The vector database — storing meaning for fast search
All those embeddings are stored in a vector database — a store built specifically to answer the question “which stored items are closest in meaning to this one?” in milliseconds, even across large amounts of content.
At this point the ingestion pipeline is done. Your website has been read, cleaned, chunked, embedded, and indexed. The chatbot is ready to answer questions. Everything so far happens once (and again whenever your content changes); everything below happens every time someone asks something.
Step 5: Retrieval — finding the right passages at question time
When a visitor asks a question, it is converted into an embedding and used to search the vector database for the passages closest in meaning — this is called semantic search.
The system embeds the incoming question the same way it embedded your content, then finds the nearest chunks. The best pipelines go further: they apply a similarity floor (so weak matches are dropped), remove duplicate boilerplate, and re-rank the results so the most useful passages rise to the top. Some also blend semantic search with keyword matching to catch exact terms like product names.
The output of this step is a small set of highly relevant passages — the evidence the model will be allowed to use.
Step 6: Generation — writing a grounded, cited answer
Finally, the retrieved passages are handed to a language model along with the visitor’s question and a strict instruction: answer using only this content. The model’s job is not to know the answer — it’s to summarise the evidence clearly and conversationally.
Because the answer is tied to specific passages, a good chatbot can show its sources — clickable links back to the exact pages it used — so the visitor can verify it. And if retrieval found nothing relevant, a trustworthy chatbot says so instead of guessing.
This last behaviour is the single biggest trust signal. A chatbot that will say “I couldn’t find that on the website” is far safer in front of customers than one that invents a plausible-sounding answer. Learn more in why AI chatbots hallucinate.
Putting it all together
Here is the full pipeline in order. The first four steps prepare your content; the last three run on every question.
- Crawl — read and clean your website’s pages.
- Chunk — split content into small, self-contained passages.
- Embed — convert each passage into a meaning vector.
- Index — store the vectors in a vector database.
- Retrieve — at question time, find the passages closest in meaning.
- Generate — write an answer grounded only in those passages.
- Cite — link back to the exact sources used.
This is exactly how SiteMind works — and it’s worth naming directly, because the quality of each step varies a lot between tools, and it’s what decides whether a chatbot is actually trustworthy. If you’re looking for one that implements every step properly (real crawling with JS-site support, careful chunking, re-ranked retrieval, honest refusals, and citations on every answer), SiteMind is built around exactly this pipeline, not a shortcut version of it.
You can start a free trial and watch it read your own pages in minutes, or see the live demo answering questions about SiteMind itself using this exact process.
Frequently asked questions
Do AI website chatbots use ChatGPT?
Many use a large language model like those behind ChatGPT, Claude, or Gemini for the final answer-writing step. But the important part is the retrieval step in front of it: a good website chatbot only lets the model answer from your content, rather than from its general training. That’s what keeps answers accurate and specific to your business.
How is this different from just asking ChatGPT about my website?
A general chatbot answers from what it learned during training and may not have seen your site — or may remember an outdated version. A retrieval-augmented website chatbot reads your current content and answers only from it, with sources, so it stays accurate and up to date.
How long does it take to set up?
The ingestion pipeline runs automatically once you point the tool at your URL. Reading a typical website takes minutes, after which the chatbot can answer. With SiteMind, installing the widget afterward is a single line of code — see how to train an AI chatbot on your website content.
Does the chatbot stay up to date when my content changes?
It depends on the tool. The best ones let you schedule automatic recrawls (daily, weekly, or monthly) and also let you edit individual answers directly. SiteMind supports both, so your assistant keeps pace with your site.
Keep reading
What is a RAG chatbot? (and why it beats fine-tuning for support)
RAG is the technique behind trustworthy AI support. What it means, how it differs from fine-tuning, and why it’s the right choice for a website chatbot.
Why do AI chatbots hallucinate — and how to stop yours
Made-up prices, invented policies, confident nonsense. Why chatbots hallucinate — and the specific design choices that prevent it.
How to train an AI chatbot on your own website content
A step-by-step, no-code guide to turning your existing website into an AI assistant that answers customers from your own content.
See it answer questions about your own site
Free 3-day trial, no card required.