RAG Explained: How Businesses Make AI Answer From Their Own Documents
What is RAG? A plain explanation of how AI answers from your own documents, with a worked clinic example, where it fails and a checklist to use first.
What is RAG? Retrieval-augmented generation is a way to make an AI model answer from your own documents: the system first searches your files for the passages that match the question, adds them to the prompt, and only then lets the model write the reply. It works without retraining the model, which is why businesses use it for support bots and staff Q&A. The honest qualification is that RAG lowers the chance of made-up answers but does not remove it, and every source I read says the answer is only as good as what the search step finds.
- Three steps. The system retrieves passages, augments the prompt with them, then generates the answer. The name is the recipe.
- Where it wins. Private, current or company-specific facts such as timings, policies and manuals, with no model retraining.
- Where it fails. Wrong passages found, stale files, badly cut chunks and a model that still drifts. The failure table below pairs each cause with a fix.
- A small example. A made-up clinic question runs through every step with the arithmetic, then breaks on purpose.
What Is RAG? The Plain Definition
RAG is a design pattern that connects a language model to a store of your documents, so it looks facts up before it answers. AWS defines it as making a model consult an authoritative knowledge base outside its training data before it responds, and IBM calls it an architecture that connects a model to external knowledge bases. Both pages were read on 24 November 2026.
The problem it solves is that a model knows only what it was trained on. AWS lists the symptoms as false answers when the model has none, out-of-date or generic answers, and answers drawn from non-authoritative sources. It compares an unaided model to a confident new hire who has not kept up with events.
Databricks states the business version plainly: the model does not know your data, and a support bot needs answers specific to your company. The alternative, retraining or fine-tuning a model, is called expensive by both AWS and IBM. RAG is the cheaper route to the same goal of domain-specific answers.
How RAG Works, Step by Step
RAG works in two phases: a preparation phase that you repeat when documents change, and a question phase that runs every time someone asks. The sources count the steps differently (IBM five, Databricks four, GeeksforGeeks five), so the table below lines them up as read on 24 November 2026.
| Phase | Step | What happens | Named by |
|---|---|---|---|
| Prepare | 1. Collect and clean | Gather PDFs, web pages and database rows, and strip or mask personal details | IBM, Databricks |
| Prepare | 2. Chunk | Split each document into small pieces that fit the model's context window | IBM, GeeksforGeeks, Databricks |
| Prepare | 3. Embed and store | Turn each chunk into a vector (a list of numbers that captures its meaning) and save it in a vector database | AWS, IBM, GeeksforGeeks |
| Ask | 4. Retrieve | Turn the question into a vector and fetch the closest chunks | AWS, IBM, GeeksforGeeks |
| Ask | 5. Augment | Put the question and the retrieved chunks into one new prompt | All five |
| Ask | 6. Generate | The model writes the answer from that prompt, and can cite the chunks | All five |
| Keep | 7. Refresh | Re-embed documents on a schedule or as they change | AWS, GeeksforGeeks, Databricks |
The context window is the amount of text a model can read at once, and chunking exists to stay inside it. IBM names the four core parts: the knowledge base, the retriever that fetches chunks, the integration layer that builds the prompt (LangChain and LlamaIndex are frameworks for it) and the generator, which is the model. Google Cloud adds hybrid search, which mixes meaning-based and keyword search, and a re-ranker that scores results so the best come first.
A Small RAG Example: One Clinic Question, Start to Finish
Here is the full cycle on a made-up case: a fictional dental clinic in Mysuru with three documents and a patient asking, "Are you open on Sunday, and what happens if I cancel the same day?" None of these numbers is real. They exist to show the method.
Preparation. The clinic's documents are a 150-word timings sheet, a 1,200-word cancellation and deposit policy and a 2,400-word treatment FAQ, which is 3,750 words in all. Cut into chunks of 150 words, that is 1 + 8 + 16 = 25 chunks, each embedded and stored.
Retrieval. The question becomes a vector and the system fetches the three closest chunks, 3 × 150 = 450 words. That is 450 ÷ 3,750 = 12% of the clinic's text, and the model never sees the other 88%. This is why RAG scales to document sets far larger than a prompt can hold.
Augmentation. The system builds a prompt like this one:
Answer only from the extracts below. If the answer is not in them, say you are not sure and offer to pass the chat to the clinic team. Name the extract you used.
Extract 1 (Timings, updated 3 November 2026): Monday to Saturday, 10 am to 7 pm. Sunday closed.
Extract 2 (Cancellation policy, updated 3 November 2026): Cancel at least 24 hours before the slot and the deposit moves to a new date. Later than that, the deposit is kept.
Extract 3 (Treatment FAQ): Missed orthodontic appointments may delay your treatment plan.
Question: Are you open on Sunday, and what happens if I cancel the same day?
Generation. The model answers that the clinic is closed on Sundays and that a same-day cancellation forfeits the deposit, citing extracts 1 and 2. Extract 3 is a near miss a good model ignores, which shows retrieval returns the closest chunks, not only the right ones.
The "answer only from the extracts" instruction in that prompt is the same idea Elyx's AI chatbot service describes: bots that answer from information you approve and say plainly when they are unsure. The page does not say how the retrieval is built, so that is a question for a scoping call.
Where RAG Fails, and What Usually Goes Wrong
RAG fails most often at retrieval: if the wrong chunks come back, the model answers confidently from the wrong text. Google Cloud says so directly, warning that irrelevant retrieval can give an answer that is grounded but off-topic or incorrect. IBM adds that RAG can reduce hallucinations (made-up answers) but cannot make a model error-proof.
The table collects the failures the five sources name. The fixes are my reading of what each source implies.
| What goes wrong | Cause | Fix | Source |
|---|---|---|---|
| Wrong or irrelevant passages | Weak embeddings, poor ranking, vague question | Test embedding models on your own questions; add hybrid search and a re-ranker | Databricks, Google Cloud, GeeksforGeeks |
| Answer misses context or is too vague | Chunks too small lose meaning, chunks too large become general | Tune chunk size against real questions | IBM |
| Stale answers | Index not refreshed after documents change | Scheduled re-ingestion, and delete superseded files | AWS, Databricks |
| Diluted or cut-off answers | Too much text pushed into the context window | Retrieve fewer, better chunks | Databricks |
| Slow replies | Retrieval, ranking and generation add steps | Measure response time before launch | Databricks, GeeksforGeeks |
| Unknown quality | Ordinary accuracy tests do not fit a two-part system | Combine human review, relevance scoring and groundedness checks | Databricks, Google Cloud |
| Leaked source data | A breached vector database can allow embeddings to be reversed, per IBM | Encrypt it and limit who can reach it | IBM |
The same clinic question, failing
Suppose the clinic's folder still holds a 2024 timings sheet saying "Sunday 10 am to 1 pm". The retriever now returns both timings chunks, and the model may pick either, because both look equally relevant. The fix is not a smarter model but a cleaner folder: delete the old sheet, or add dates to every file so the newest wins.
Databricks says indexes go stale quickly without scheduled ingestion, and AWS says the refresh can run in real time or in batches. Decide who owns that job before launch.
RAG, Fine-Tuning, Prompt Engineering or a Long Prompt: How to Choose
Use RAG when the facts change or are private, use fine-tuning when you need the model to behave differently, and use a plain long prompt when everything fits. Databricks calls RAG the right place to start and fine-tuning the choice when you want the model's behaviour to change or to learn a different "language". IBM notes the two are often contrasted but can work together.
| Method | What it changes | Data it needs | Watch out for | Source |
|---|---|---|---|---|
| Prompt engineering | The instructions you give | None | Less control than fine-tuning | Databricks |
| Long prompt (paste the documents) | Gives the model all your text each time | Your documents, if they fit | Breaks once the set outgrows the context window | Google Cloud |
| RAG | Fetches the relevant text per question | A searchable knowledge base | Longer prompts and more compute | Databricks |
| Fine-tuning | The model's own behaviour | Thousands of labelled examples | Labelled data and compute cost | Databricks |
A common question is whether bigger context windows make RAG obsolete. Google Cloud treats a long context window as a good way to give a model source material, and says RAG is the route when you have more than fits or want to cut the tokens, time and cost of each call.
My reading for a small business: if your policies, price list and FAQs fit in a few dozen pages, paste them into a prompt first as the cheapest test. Move to RAG when the set grows, changes weekly, or must be limited by who is asking.
What Businesses Use RAG For
Businesses use RAG mainly for customer-support bots, internal question-and-answer tools and search that returns a written answer instead of a list of links. IBM also lists research, content generation, market analysis and recommendations, while Databricks names question-and-answer chatbots, search augmentation and knowledge engines.
Databricks gives three company examples, all vendor-reported and unchecked by me. Experian built a chatbot called Latte, Cycle & Carriage built an assistant over technical manuals and support transcripts, and JetBlue built BlueBot, where finance sees SAP data and filings while operations sees only maintenance information. The JetBlue case matters for small firms because it shows retrieval can be limited by role.
At small-business scale my reading is three starter jobs: a bot that answers fee, timing and policy questions, a staff search over standard operating procedures, and a drafting helper that pulls from past quotes. If the bot must also act, such as booking or updating a CRM, it is moving toward an agent, which the plain-English guide to AI agents explains.
RAG for an Indian Business: Languages, Scanned Files, WhatsApp and Personal Data
Four things change the advice in India: the languages customers type in, the state of the documents, the channel and the personal data in them. None of the five sources is about India, so what follows is my reading unless a source is named.
- Languages. Google Cloud says retrieval can use multi-language embeddings, and Elyx's chatbot page says replies in English, Hindi or Kannada are tested against a business's real questions before launch. Test the same way: write ten questions in Hindi, Kannada and Roman-script Hinglish, and check that each finds the right chunk.
- Scanned and photographed files. A price list photographed on a phone has no text to chunk until it is read by OCR (software that turns images of text into text). Google Cloud lists better layout parsing among the ways to improve quality, which is the same problem in a different form.
- Channel. RAG is the knowledge behind the bot, and WhatsApp is only where customers meet it. The WhatsApp chatbot guide for India covers the setup, costs and rules for that channel, and the guide to website chatbots covers the website side.
- Personal data. A document store holding customer names or records is one more place personal data lives. Databricks suggests masking personal details at preparation, AWS says retrieval can be limited by authorisation level, and IBM warns about breached vector databases. Add the store to the data ledger described in India's DPDP Act and your website.
Running cost is the gap in my evidence: I found no sourced Indian price for building or running a RAG system, so I give none. Elyx's chatbot page says AI model usage is billed by the provider separately from the build, which is the line to ask any vendor about.
What Is Documented and What Is My Reading
Keeping the two apart lets you check the claims that matter. The first list comes from the named pages as read on 24 November 2026.
Documented by the sources:
- RAG retrieves, augments the prompt and generates, and avoids the cost of retraining (AWS, IBM, Databricks).
- It cannot make a model error-proof (IBM) and depends heavily on retrieval quality (Google Cloud, GeeksforGeeks, Databricks).
- Indexes go stale without scheduled updates (Databricks, AWS).
- Over 60% of organisations are building AI retrieval tools, per "recent surveys" that Databricks does not name, so treat it as a vendor claim.
My reading, not documented:
- The fix column in the failure table and the paste-it-first advice.
- The Indian-language, scanned-file and data-ledger points.
- The clinic example, which is invented to show the method.
A RAG Checklist to Use Before You Build or Buy
A RAG checklist is a short set of checks that prove the answers are right before customers see them. Copy this one and work down it with whoever builds the system.
- List the questions first. Write 30 real customer questions, awkward ones included, with the correct answer beside each.
- Clean the source folder. Remove old versions, date every file and name one owner.
- Check every file has text. Scanned or photographed files need OCR before chunking.
- Decide who may see what. Customer-facing and staff-only documents should not share one open index.
- Test retrieval separately. For each question, check the right chunk comes back before judging the model's wording.
- Test the answer. It should match the source, cite it, and say "not sure" when the document is silent.
- Plan the handover. A person takes over sensitive or unclear questions, with the chat attached.
- Set a refresh schedule and ask for running costs. Name who re-embeds files, and who pays for model usage, hosting and the vector store.
- Read the first real chats. Fix the gaps in the documents, not only the prompt.
What to Do Next
Start with your own documents: collect the 30 questions, clean the folder and try a pasted-prompt test before paying for any build. If the set outgrows that, a RAG-style assistant is the next step.
Elyx's AI chatbot service covers bots that answer from approved content and hand over to your team. Engagements start from ₹9,999, and every project is quoted to your requirements, in writing, after a call, so you can request a quote. For a wider view of where AI helps a small firm, read the 25 ways Indian small businesses can use AI.
Sources
- What is RAG? Retrieval-Augmented Generation AI Explained, Amazon Web Services
- What is RAG (Retrieval Augmented Generation)?, IBM
- What is Retrieval-Augmented Generation (RAG), GeeksforGeeks
- What is Retrieval-Augmented Generation (RAG)?, Google Cloud
- What is Retrieval Augmented Generation (RAG)?, Databricks
Frequently asked questions
What is RAG in AI?
RAG, short for retrieval-augmented generation, is a technique where an AI system searches a set of documents for relevant passages and gives them to a language model with the question. The model then writes its answer from that text instead of from memory alone. AWS and IBM both describe it as a way to add company knowledge without retraining.
How does RAG work in simple terms?
RAG works like an open-book exam: the system finds the right pages, puts them in front of the model and asks for an answer based on them. Documents are cut into chunks and turned into vectors, the question is matched to the closest chunks, and the model writes the reply.
What is the difference between RAG and an LLM?
An LLM, or large language model, is the part that writes the answer, while RAG is the system around it that fetches the facts. IBM lists the model as the "generator", one component of a RAG system.
What is the difference between RAG and fine-tuning?
RAG lets a model look up an external source, while fine-tuning trains the model further on domain examples. Databricks says RAG is the right place to start, and fine-tuning suits cases where you want the model's behaviour to change. IBM adds that the two can be combined.
Does RAG stop AI from making things up?
RAG reduces made-up answers but does not stop them. IBM says it cannot make a model error-proof, and Google Cloud warns that poor retrieval can still produce a grounded-sounding but wrong answer. Test with real questions and let the bot say it is unsure.
Do I need a vector database for RAG?
Not always, though many RAG systems use one. Databricks says "some, but not all" language-model applications use vector databases for fast similarity search. A small document set may work with simpler search or a long prompt.
Will bigger context windows make RAG obsolete?
Bigger context windows make RAG unnecessary for small document sets, not for large ones. Google Cloud says RAG is the route when you have more source material than fits or want to cut the cost of each call.
Do off-the-shelf chatbot tools support RAG?
Many may, but the research I used names no specific product, so check each vendor's own documentation. Ask where your files are stored, how often they refresh, whether answers cite sources and who sees the data.
What is RAG versus MCP or CAG?
RAG fetches text to put in a prompt, and the five sources I read do not define MCP or CAG, so I will not define them from memory. Databricks describes hybrid designs in which RAG supplies unstructured grounding while tools and structured data handle precise tasks. Read each one's official documentation before comparing them.
What does RAG status mean?
RAG status is a different term: in project management it means a red, amber or green rating of how a project is going. This article is about retrieval-augmented generation, and the two share only the abbreviation.





