View All
ai

RAG Chatbot: Answering Customers From Your Own Documents

Jawad Hakimi6 min read

A RAG chatbot (retrieval-augmented generation) is an AI assistant that, before answering, searches your own documents, such as price lists, policies, manuals and FAQs, pulls out the most relevant passages and gives them to a language model to write the reply. Because the answer is grounded in your content rather than the model's general memory, it is more accurate, can point to its source and stays current when you update a document, with no retraining. It is the standard way to build a customer-facing chatbot that knows your business.

Key Takeaways

  • RAG keeps answers tied to your own documents, which reduces made-up answers but does not remove them entirely.
  • The quality of your documents matters more than the choice of AI model.
  • Dari and Pashto work, but retrieval quality varies by model, so test with real customer questions.
  • A good RAG chatbot says "I don't know" and hands over to a person when the answer is not in its sources.
  • Updating the knowledge base is as simple as replacing a document; no model training is needed.

How Does a RAG Chatbot Work?

A RAG chatbot works in two stages: preparing your documents once, then retrieving from them every time a question arrives.

In the preparation stage, your documents are split into short passages, often a few paragraphs each. Each passage is converted into an embedding, a list of numbers that represents its meaning, and stored in a vector database alongside the original text and details such as the document title and date.

When a customer asks a question, the system converts the question into an embedding too and finds the passages with the closest meaning. Good systems combine this meaning-based search with ordinary keyword search, because product codes, names and prices are often matched better by exact words. A reranking step then picks the best few passages. Finally, the language model receives the question, the selected passages and instructions such as "answer only from these sources, in the customer's language, and say so if the answer is missing".

RAG, Fine-Tuning or a Long Prompt: Which Do You Need?

For most businesses, RAG is the right choice when the chatbot must answer from information that changes or is too large to paste into every request. The alternatives fit narrower cases:

  • A long system prompt works when all your information fits on a few pages, such as a small restaurant's menu and opening hours. It is simple, but becomes slow and expensive as content grows.
  • Fine-tuning adjusts a model's style or behaviour using examples. It is poor at teaching facts that change, such as prices, and needs repeating every time the facts change.
  • RAG handles hundreds or thousands of pages, lets you update content instantly and makes it possible to show which document an answer came from.

Many production systems combine RAG with a short, carefully written system prompt that sets tone, language and boundaries.

Which Documents Should a RAG Chatbot Use?

Use documents that are current, specific and written as clear answers. The best sources are FAQ pages, price lists, service descriptions, policies on delivery, returns and refunds, admission or registration requirements, product specifications and internal help-desk notes.

Before importing anything, clean it up. Remove outdated versions so the chatbot never quotes last year's prices. Split long PDFs into sections with clear headings. Turn scanned images into real text, because a photo of a page cannot be searched. Mark each document with an owner and a review date so someone is responsible for keeping it accurate. For an educational centre, for example, the course catalogue, fee schedule and admission steps would be the core of the knowledge base.

Does RAG Work in Dari and Pashto?

Yes, RAG can work in Dari and Pashto, but quality depends on the embedding model and the language model you choose, so it must be tested rather than assumed. Many current multilingual models handle Persian-script text reasonably, while Pashto is often supported less well than Dari or English.

A few practical points make a large difference. Customers spell the same word in different ways and mix Dari, Pashto and English in one message, so keyword search should be paired with meaning-based search. Some models favour Iranian Persian vocabulary; instructions and example answers in Afghan Dari help keep replies natural. Cross-language retrieval, where a question in Pashto finds an answer in an English document, is possible but less reliable than having the source in the same language. If your audience is mainly Dari and Pashto speakers, translate your most important documents. We cover the front-end side of this in our guide to AI chatbots for Dari and Pashto websites.

How Do You Build a RAG Chatbot? Step by Step

  1. Collect the top questions. Pull the 50 to 100 most common questions from WhatsApp chats, phone notes, emails and social media comments.
  2. Gather and clean the sources. Find the document that answers each question; write a short answer where none exists.
  3. Build the index. Split documents into passages, create embeddings and store them in a vector database with metadata such as language, date and document type.
  4. Write the instructions. Define tone, languages, what the bot must never do (quote prices it cannot find, give legal or medical advice) and when to hand over.
  5. Create a test set. Write questions with the correct expected answers, including tricky ones and questions the bot should refuse.
  6. Test, measure and fix. Most errors come from missing or unclear documents, not the model. Fix the content first.
  7. Connect the channels. Put the chatbot on your website, and if useful in WhatsApp or a Telegram bot, all using the same knowledge base.
  8. Review conversations weekly. Read unanswered and low-rated chats, then add or improve documents.

How Do You Keep a RAG Chatbot Accurate and Safe?

Accuracy and safety come from design choices, not from the model alone. Instruct the chatbot to answer only from retrieved sources and to say clearly when it cannot find the answer. Show source links so customers and staff can check. Separate public documents from internal ones so staff-only content never appears in customer answers. Avoid putting personal customer data into the knowledge base at all.

Always offer a human handoff, and log conversations so you can spot repeated failures. For a full support setup, including routing and escalation, see our guide to AI customer support automation.

What Does a RAG Chatbot Cost?

Costs have two parts: the one-time build and ongoing usage. The build covers document preparation, the retrieval pipeline, the chat interface and testing. Ongoing costs include AI model usage, which is charged per volume of text processed, plus hosting for the vector database. Usage prices change often, so check current rates before estimating. At Sheen, chatbot projects fall under our automation service, from AFN 14,000 for focused assistants and AFN 28,000 for larger multi-channel systems, with custom quotes for complex integrations.

Work With Sheen

Sheen builds RAG chatbots that answer customers from your own documents in Dari, Pashto and English, with clear sources and human handoff. Explore our automation service or book a consultation to review your documents and plan a pilot. Contact info@sheen.af or +93 784 966 018.


Frequently Asked Questions

Will a RAG chatbot ever give wrong answers?

It can, but far less often than a general chatbot when it is built well. Wrong answers usually come from outdated or contradictory documents, retrieval that picks the wrong passage, or instructions that let the model guess. Reduce errors by cleaning sources, showing citations, telling the bot to admit when it cannot find an answer, testing against a fixed question set and reviewing real conversations every week.

How many documents does a RAG chatbot need?

There is no minimum number; what matters is coverage of the questions customers actually ask. Many small businesses start with a handful of well-written pages: FAQs, prices, services, delivery and refund policies. Larger organisations may index hundreds of manuals and policy files. Start with the documents that answer your top 50 questions, then expand based on the questions the chatbot fails to answer.

Is my business data safe in a RAG chatbot?

It can be, if the system is designed carefully. Keep documents and the vector database on infrastructure you control, separate public content from internal content, and never index personal customer records. Review the data-use terms of the AI provider you choose, since policies on storing and training with submitted data differ between providers and plans. Limit admin access and keep logs of who changes the knowledge base.

Can one RAG chatbot work on my website, WhatsApp and Telegram?

Yes. The knowledge base and retrieval logic live on your server, and each channel is a separate front end that sends questions to it and displays the answers. This means you update a document once and every channel answers consistently. Each channel has its own rules and costs, for example WhatsApp Business API pricing and message templates, so check those terms when planning.


Keep reading

Read More