7 min read
Build a RAG Chatbot From Your Own Documents, No Code Needed
A RAG chatbot searches your own documents before it answers. Here is how that works in plain terms, and how to set one up without writing code.
By AssistBot Team
RAG chatbots look things up before they answer. RAG stands for retrieval-augmented generation: when someone asks a question, the bot first searches the documents you gave it, then passes the most relevant passages to a language model and asks it to answer from those. You can build one in Python with a vector database, or skip the code and use a hosted tool that handles the retrieval for you.
This guide takes the no-code route. It also explains enough of the machinery that, when an answer comes out wrong, you'll know which part to fix.
How a RAG chatbot works, in four moves
- Split. Your pages and files are cut into short passages, often called chunks.
- Index. Each chunk is turned into a list of numbers (an embedding) that represents what it means, and stored so it can be searched by meaning rather than exact words.
- Retrieve. A question comes in. It gets the same treatment, and the system pulls the handful of chunks closest in meaning.
- Generate. The model receives the question plus those chunks and writes a reply grounded in them.
The term comes from a 2020 paper by Patrick Lewis and colleagues at Facebook AI Research, Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks. It has since become the usual way to make a general-purpose model answer questions about one specific business.
Why it makes things up less often
A plain language model answers from what it absorbed in training, which knows nothing about your returns window or your Pro plan. Ask it anyway and it may produce something plausible and wrong. A RAG chatbot has the relevant text in front of it, so it has far less reason to guess.
Less often is not never. If retrieval pulls the wrong chunk, or nothing relevant exists, the model can still fill the gap. When a RAG bot gets something wrong, look first at the content and the retrieval, and only then at the model. That's why most of the steps below are about your content.
What you need
- 20 to 30 real questions customers ask, copied from your inbox, chat history or sales emails
- The content that answers them: website pages, PDFs, Word docs, internal notes
- A hosted chatbot tool that does the splitting, indexing and search (this guide uses AssistBot for the specifics)
- An hour for testing
- Permission to add a script tag to your site
The steps
Step 1. Write the question list before touching any tool
What: collect the questions people actually ask, in their words. "Can I send it back if I opened it?" rather than "returns policy".
Why: retrieval can only find an answer that exists somewhere. Your list shows you, before launch, which questions have nowhere to land.
The gotcha: customers and documentation use different words. Keep the customer phrasing, because that's what you'll test with in step 6.
Step 2. Fix the content before you load it
What: for each question, find the page or file that answers it. If none does, write the answer down somewhere.
Why: a RAG bot is only as accurate as the text it retrieves.
The gotcha: contradictions. An old pricing page still live, a 2024 PDF with a different refund window, a blog post describing a feature you've since changed. Retrieval doesn't know which one is current and may pick the stale one. Delete or update before you import, or you'll spend the first week chasing answers that are "wrong" only because your own site disagrees with itself.
Step 3. Add your sources
What: in AssistBot you can enter your site's URL and let it crawl, then pick which pages to keep. You can also upload PDF, Word (.docx), TXT and Markdown files, paste text directly, and write question-and-answer pairs. The knowledge sources page shows each of these in more detail.
Why: pages cover what's public. Files cover what isn't on the site: a supplier spec sheet, an onboarding doc, the internal note on how you handle damaged parcels.
The gotcha: more pages is not better. Tag archives, legal boilerplate and five-year-old blog posts add noise that competes with your good answers at retrieval time. Pick deliberately. (On the free plan the limit is 10 website pages and 1 MB of files; paid plans have unlimited pages.)
Step 4. Write Q&A pairs for the awkward questions
What: for questions whose answer is spread across three pages, or depends on a condition ("yes, unless you're outside the EU"), write the answer yourself as a Q&A pair.
Why: a Q&A pair is a chunk that is already the right size, in the right words, about exactly one thing. It tends to win retrieval for that question.
The gotcha: now the answer lives in two places. When the policy changes, update the page and the pair together.
Step 5. Pick a model
What: each AssistBot agent uses one model, chosen from GPT-5 Mini, GPT-4o Mini, GPT-4o, GPT-3.5 Turbo, Claude 3.5 Sonnet or Claude 3 Haiku. New agents start on GPT-4o Mini.
Why: with good retrieval, the model's job is mostly reading and rephrasing, which smaller models do well. Since every AI reply counts as one message whichever model you pick, you can choose on answer quality alone.
The gotcha: compare models on your own question list, not on general impressions. Test replies in the Playground count as messages too, so run a set of 10 rather than 100.
Step 6. Test with questions it should get wrong
What: run your question list through the Playground, then add five questions your content doesn't cover at all.
Why: the dangerous failure is a confident, specific, invented answer about something you never wrote down. You want to see what the bot does when retrieval comes back empty.
The gotcha: when an answer is wrong, resist switching models first. Look at what the bot had to work with. Usually the fix is in step 2 or step 4.
Step 7. Decide where a person takes over
What: RAG handles questions your documents can answer. It can't answer "where is my order?" because that lives in your systems, not your docs. For those, either connect an API lookup that calls an endpoint you already have, or hand the chat to a person.
Why: a bot that keeps answering when it shouldn't costs more goodwill than one that hands over early.
The gotcha: in AssistBot, human handoff is off until you turn it on (paid plans, from $24 a month). It triggers when a visitor's message contains one of the phrases on your list, like "talk to human" or "refund". Then the AI stops and the chat waits in your Inbox, with optional alerts to Slack, Microsoft Teams or Discord. Your team replies from the Inbox, not from Slack.
Step 8. Put it on your site
What: paste the script tag before </body>:
<!-- AssistBot widget -->
<script>
(function () {
var s = document.createElement('script');
s.src = 'https://www.assistbot.app/widget/assistbot.js';
s.async = true;
s.onload = function () {
AssistBot.init({ agentId: 'YOUR_AGENT_ID' });
};
document.head.appendChild(s);
})();
</script>
Why: one tag works on any site that accepts custom code, including Shopify, WordPress, Webflow, Framer and Wix.
The gotcha: Webflow only runs site-wide custom code on paid site plans. Platform-by-platform notes are in the setup guide.
Check it worked
- Open your live site in a private window and ask five questions from your list, typed the way a customer would type them, typos included.
- Ask about something you changed recently. If the old answer comes back, a stale source is still in the index.
- Ask something it can't know, like a customer's order status. It should not invent one.
- Type one of your handoff phrases and confirm the chat appears in the Inbox.
- After the first week, export the conversations (the Inbox gives you one Markdown file per agent) and read them. Every wrong answer points to a missing or conflicting piece of content.
FAQ
Is ChatGPT a RAG chatbot?
Not by default. On its own, ChatGPT answers from what the model learned in training. When it searches the web or reads a file you upload, it's doing retrieval, which is the same principle. A RAG chatbot on your website does that every time, against your content only.
Is a RAG chatbot the same as an AI agent?
No. RAG is about where the answer comes from. An agent is about taking actions, like booking, looking up an order or updating a record. Many support bots do a bit of both. There's a longer breakdown in AI agent vs chatbot.
Do I need a vector database?
Only if you're building it yourself. Hosted tools run the indexing and search for you. If you build your own, you'll pick an embedding model, a store for the vectors and a chunking approach, and you'll own the tuning. The trade-offs are covered in build vs buy.
Should I fine-tune a model instead?
For a support bot, usually not. Fine-tuning changes how a model writes. It's a poor way to teach facts that change, like prices or policies, because every change means training again. With RAG you update the source, a page or a Q&A pair, and nothing needs retraining.