# What is RAG? AI that answers from your documents

Address: https://sebastianmusial.pl/en/glossary/rag/ · Glossary: https://sebastianmusial.pl/en/glossary/

RAG is a way to make AI answer from your own documents rather than general knowledge from the internet. Here is how it works, when it makes sense and what to ask before someone builds it for you.

- Full name: Retrieval-Augmented Generation
- Also called: knowledge base for AI, document-grounded AI

**Definition.** RAG (retrieval-augmented generation) is a way of building AI assistants in which a language model, before answering, searches a company’s documents, such as its services, policies or manuals, for relevant passages and writes the answer from them. The answers reflect the company’s current knowledge and can point to where the information came from.

## How does RAG work?

1. **Preparing the knowledge.** Your documents are split into short passages and stored so they can be searched by meaning, not just by matching words.
2. **Retrieval.** When someone asks a question, the system finds the few passages that fit it best.
3. **The answer.** The language model receives the question together with those passages and writes an answer based only on them, ideally citing the source.

The model does not “learn” your documents permanently. Each time, it only gets what fits the question. When your price list changes, you replace the document and the next answer uses the new one.

## What is RAG useful for in a business?

- A chatbot on your website that answers from your services, prices and FAQs instead of guessing.
- An internal assistant for your team: procedures, manuals, contracts, product documentation.
- Customer service: a suggested reply to an email, based on previous agreements and your policies.

What such an assistant looks like in practice, and how to prepare documents for it, is covered in the article on [an AI assistant that answers from your documents](https://sebastianmusial.pl/en/blog/ai-assistant-that-answers-from-your-documents/).

## What will RAG not fix?

RAG is only as good as the documents it is given. If your services page is out of date or two documents contradict each other, the assistant will repeat the muddle. It reduces the risk of made-up answers but does not remove it, so a good assistant admits when it found nothing and hands the question to a person. You also need to decide who may see which documents, so the assistant never shows someone information they should not have.

## Frequently asked questions

**Is RAG the same as training your own model?**
No. With RAG the model does not change; it simply receives the relevant passages with each question. Training (fine-tuning) changes the model itself and is usually used to teach it a style or format, not a company’s current knowledge.

**Does my company data go to the AI provider?**
The relevant passages are sent to the model along with the question, so it is worth checking the provider’s terms: whether data is used for training, where it is processed and how long it is kept.

See also: [LLM](https://sebastianmusial.pl/en/glossary/llm/), [AI assistant](https://sebastianmusial.pl/en/glossary/ai-assistant/), [AI hallucinations](https://sebastianmusial.pl/en/glossary/ai-hallucinations/), [Fine-tuning](https://sebastianmusial.pl/en/glossary/fine-tuning/), [Context window](https://sebastianmusial.pl/en/glossary/context-window/)

Sources: [Lewis et al. (2020): Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks](https://arxiv.org/abs/2005.11401)

---

Updated: 2026-11-28. Sebastian Musiał, kontakt@sebastianmusial.pl (I reply within 24 hours). Quote after a call, no price list on the site.
All pages: https://sebastianmusial.pl/llms.txt · The whole English text in one file: https://sebastianmusial.pl/en/llms-full.txt
