An AI Chatbot That Answers From Your Own Website: RAG Explained Simply

How a website AI chatbot answers from your own content using retrieval-augmented generation (RAG), what it costs to run, and how to stop it from making things up.

A bookshelf filled with old books
Photo by sourmarb on Unsplash
Short answerRAG means the chatbot first searches your own content for relevant passages, then asks the model to answer using only those passages. Good chatbots also know when to say 'I don't know' and hand the visitor to a person.

Most businesses don't want a chatbot that can talk about anything. They want one that answers questions about their products, prices and policies correctly, and politely says when it doesn't know. The technique that makes this possible is called RAG, retrieval-augmented generation. The name is clumsy. The idea is simple.

The idea in one paragraph

When a visitor asks a question, the chatbot doesn't answer from the model's memory. First it searches your content (website pages, help articles, product data, PDFs) for the passages most related to the question. Then it gives those passages to the model with an instruction: answer using only this information, and say so if the answer isn't here.

It's like giving a smart new employee the right page of the handbook before they answer a customer.

How I build one

  1. Collect the content. Website pages, FAQs, product feeds, policy documents.
  2. Split it into chunks, each a few paragraphs, keeping headings so every chunk has context.
  3. Create embeddings. Each chunk becomes a list of numbers that captures its meaning, stored in a vector database or in PostgreSQL with pgvector.
  4. Retrieve. For each question, find the closest chunks by meaning, not just by matching words.
  5. Answer. Send the question and the chunks to Claude or GPT with clear rules about tone, length and what not to do.
  6. Cite. Link to the source page so visitors can check and read more.

Stopping it from making things up

The biggest fear is the chatbot inventing a price or a policy. What helps most:

  • Strict instructions to answer only from the retrieved content.
  • A confidence check: if the retrieved passages are weak matches, say "I'm not sure" and offer a person.
  • Keep content fresh. Re-index automatically when pages change, so the bot isn't quoting last year's prices.
  • Review real conversations weekly in the first month and fix the gaps they reveal.

Handing over to a human

A good chatbot knows its limits. I always add a handover path: collect the visitor's name and question, then send it to email, WhatsApp or your CRM. For sales questions, this alone often pays for the project.

What it costs to run

Most of the running cost is model usage, and for a typical business website it's small: each answer uses a few thousand tokens. Hosting the search index is cheap or free at small scale. The real investment is the initial setup and the first weeks of tuning.

Is it right for you?

It works best if visitors ask the same kinds of questions again and again, the answers already exist in writing, and quick replies win you sales. If every inquiry is unique and complex, a well-designed contact form might serve you better.

Chatbots are part of my AI automation service. If you'd like one trained on your own site, send me the URL and I'll tell you what it could answer on day one.