
Most teams that want to build an AI chatbot with your own data have the same problem: a general chatbot sounds confident but knows nothing about your products, prices, policies or customers. Training a model from scratch is not the answer. The method almost every business chatbot uses instead is called retrieval-augmented generation, or RAG.
This guide explains RAG in plain English, compares the hosted options from Google and OpenAI with a custom pipeline, shows what the hosted tools currently cost, and lists the checks that decide whether a chatbot is safe to put in front of customers or staff.
Key takeaways
- RAG means the chatbot searches your documents first, then writes its answer from the passages it found, so answers can cite a source.
- Hosted tools now do much of the work. Google’s Gemini File Search and OpenAI’s file search both index your files and retrieve from them (Google, OpenAI).
- A custom pipeline is worth it when you need strict per-user access, many data sources, your own hosting, or control over every step.
- The hard part is not the model. It is clean documents, access control and a test set of real questions.
In this guide
- What RAG is, in plain English
- How a RAG chatbot answers
- Hosted file search vs a custom pipeline
- What the hosted tools cost
- Privacy and access control
- Testing before launch
- FAQ
What RAG is, in plain English
A large language model learns general knowledge during training. It has never seen your returns policy, your internal SOPs or last month’s price list. RAG fixes that without retraining. When a user asks a question, the system first searches a library built from your content, picks the most relevant passages, and gives them to the model along with the question. The model then answers from those passages.
Think of it as an open-book exam. The model is a good writer; your documents are the book. Because the answer comes from specific passages, the chatbot can show which document it used, and you can update its knowledge by updating the documents instead of training a new model.
How a RAG chatbot answers

- Collect. Gather the content the chatbot should know: help articles, product sheets, PDFs, policies, FAQs, past support replies.
- Chunk. Split long documents into short passages with labels such as title, product, date and audience.
- Embed and store. Convert each passage into an embedding, a list of numbers that captures meaning, and store it in a vector index with access tags.
- Retrieve. When a question arrives, find the passages whose meaning is closest, often combined with keyword search.
- Answer. Send the question and the passages to the model with instructions to answer only from them and cite the source.
Retrieval quality decides answer quality. Anthropic reported that adding context to each chunk before indexing cut failed retrievals by 49%, and by 67% when combined with reranking (Anthropic). Small changes in how you chunk and search matter more than which model you pick.
Planning a chatbot on your own documents? Eoxys has delivered 700+ projects since 2009. Get a real project estimate within 24 hours. NDA on request.
Hosted file search vs a custom pipeline
In 2026 you no longer have to build every step yourself. The main model providers offer managed retrieval that handles chunking, embeddings and search:
- Gemini File Search (Google) imports files into a store, chunks and embeds them, and returns citations showing which parts of the documents were used (Gemini docs).
- OpenAI file search is a tool in the Responses API that retrieves from vector stores of uploaded files “through semantic and keyword search”, with metadata filtering (OpenAI docs).
- Cloud platforms such as Amazon Bedrock Knowledge Bases and Azure AI Search offer managed RAG inside your own cloud account (AWS, Microsoft).
| Hosted file search | Custom RAG pipeline | |
|---|---|---|
| Time to a first version | Days | Weeks |
| Control over chunking and ranking | Limited to the provider’s options | Full |
| Per-user document permissions | Basic, through metadata filters | Built to your rules |
| Data sources | Mostly uploaded files | Files, databases, CRM, helpdesk, live APIs |
| Hosting | Provider’s cloud | Your cloud or servers |
| Best for | FAQ and help-centre bots, pilots | Internal knowledge bases, regulated data, multi-system bots |
Our rule of thumb: start with a hosted tool if your content is a few hundred public or low-risk documents. Choose a custom pipeline when the chatbot will see personal data, internal files with different permission levels, or data that lives in other systems. Our AI and machine learning team builds both, and our chatbot developers connect them to your website, app or WhatsApp.
What the hosted tools cost
Model tokens are billed on top in every case, because the retrieved passages are added to each prompt. These are the retrieval prices listed by each provider:
| Item | Google Gemini File Search | OpenAI file search |
|---|---|---|
| Indexing | Embeddings charged at Gemini Embedding rates, $0.15 per 1M tokens (Google pricing) | Not listed separately |
| Storage | Not charged as a separate line item | $0.10 per GB per day, first 1 GB included (OpenAI pricing) |
| Searching | Retrieved document tokens charged as normal model tokens | $2.50 per 1,000 tool calls (OpenAI pricing) |
For most business chatbots the retrieval fees are small next to the build: document clean-up, integrations, testing and monitoring. Our AI agent cost guide breaks down a full budget, and our WhatsApp chatbot cost guide covers channel costs.
Privacy and access control
A RAG chatbot is only as safe as its permissions. OWASP lists vector and embedding weaknesses in its 2025 Top 10 for LLM applications, warning that weak access controls can let a model “retrieve and disclose personal data, proprietary information, or other sensitive content” (OWASP LLM08). Documents can also carry hidden instructions, a form of prompt injection (OWASP LLM01).
- Tag every passage with who may see it, and filter at retrieval time, not after the answer is written.
- Keep personal data out of the index unless the use case needs it, and record why it is there.
- Strip or flag instructions inside documents and tell the model to treat retrieved text as data.
- Log questions, retrieved passages and answers so you can audit mistakes.
If the chatbot handles personal data of people in India, the DPDP Act applies; for EU users, GDPR. See our DPDP compliance guide for AI apps.
Testing before launch
Do not launch on a handful of demo questions. Build a test set of 50 to 200 real questions from support tickets, sales calls and staff, each with the correct answer and source document. Then measure:
| Check | What good looks like |
|---|---|
| Retrieval | The right passage appears in the top results |
| Grounding | The answer only states what the passages say |
| Citations | Every answer links to the document it used |
| Refusals | It says it does not know when the documents do not cover a question |
| Permissions | Users never receive passages they are not allowed to see |
Rerun the same set after every document update or model change. After launch, track failed answers and costs, as covered in our AI agent observability guide. For a store-facing example, see our AI chatbot for ecommerce guide.
FAQ
Do I need to train a model on my data?
Usually not. RAG gives an existing model your documents at answer time, which is cheaper and easier to update than training. Fine-tuning changes how a model behaves, such as tone or output format, but it is a poor way to teach facts that change. Most business chatbots start with good prompts plus RAG.
What data can a RAG chatbot use?
Almost any text you own: PDFs, help-centre articles, product catalogues, policies, spreadsheets and support history. A custom pipeline can also pull live data from your CRM, helpdesk or database through APIs. Clean, current and well-labelled documents matter more than volume, so remove outdated versions before indexing.
How long does it take to build?
A pilot on hosted file search with a small, clean document set can be ready in days. A production chatbot with several data sources, per-user permissions, a test set and monitoring usually takes several weeks. The biggest variable is preparing the documents and agreeing who may see what, not writing code.
Can Eoxys build a chatbot on our own data?
Yes. We build RAG chatbots for websites, apps and internal teams, with access controls, citations and a test set agreed with you before launch. We can use hosted file search or a custom pipeline in your cloud. Get a real project estimate within 24 hours, with an NDA on request.
Work with Eoxys
Eoxys IT Solution LLP has built websites, apps and AI products since 2009, with 700+ projects delivered. See the work on our portfolio, or explore our AI and machine learning solutions.
Tell us what your chatbot should know and who will use it, and we will recommend the simplest setup that passes your tests. Get a real project estimate within 24 hours. NDA on request. Prefer to talk? Call +91 96678 22661.
Related reading:
- How Much Does It Cost to Build an AI Agent in 2026?
- AI Agent Observability: How to Trace and Debug Your Agents
- DPDP Compliance for AI Apps: What to Fix Before May 2027
Sources
Checked on 29 Oct 2026 against Google’s Gemini File Search and pricing docs, OpenAI’s file search guide and pricing page, AWS and Microsoft RAG documentation, Anthropic’s Contextual Retrieval post and the OWASP Top 10 for LLM applications.


