MMOOZZGG.com

Glossary

What is retrieval-augmented generation (RAG)

In short

Retrieval-augmented generation (RAG) is a scheme in which an AI first finds the right passages in your documents and then answers using them.

Search and RAG · retrieval-augmented generation

MMOOZZGG.com editorsChecked: 1 min read

For a child

Imagine a test where you may use the textbook. First you find the right page, then you write the answer in your own words. RAG does the same: the AI first searches the book, then answers.

In plain words

An AI model knows only what it was trained on. It does not know your documents, prices and rules. RAG solves this: for each question the system finds matching pieces in a knowledge base and passes them to the model together with the question. The model then answers from the text it found. The answer becomes more accurate, and you can show which document it came from.

For business

You need RAG when an AI must answer from internal data: policies, contracts, a catalog, a support knowledge base. It is cheaper than fine-tuning a model, and you can update the data every day without retraining. The main risks are a poorly prepared knowledge base and a bad way of cutting documents into pieces. Then the AI finds the wrong passage and answers with confidence, but wrongly. So before rollout, teams check what share of questions gets the right passage, and they write this metric into the pilot.

For a specialist

Retrieval-augmented generation joins the parametric memory of a model with a non-parametric memory. A retriever takes the top-k passages from an outside corpus, and a generator writes an answer based on the query and the retrieved context. The term comes from the work of Lewis and co-authors (2020). A typical pipeline: chunking documents, indexing embeddings in a vector database, search (dense, lexical BM25 or hybrid), reranking with a cross-encoder, building the prompt, generation and a groundedness check. Types: naive RAG (one search step), advanced RAG (query rewriting, HyDE, reranking), modular RAG (replaceable pipeline blocks), GraphRAG (search over a knowledge graph and community summaries) and agentic RAG (the agent decides when and where to search and takes several steps). Quality is measured by the recall@k of the retriever and the faithfulness of the answer.

Example

A customer asks: “Can I return a product after 20 days?” The system finds the clause on return terms in the knowledge base. The model answers from it and gives a link to the rule.

Related terms

Questions and answers

How is RAG different from fine-tuning a model? Fine-tuning changes the model itself; RAG gives the model the right documents at the moment of the question. RAG is easier to update and cheaper.

Fine-tuning helps when you need to change the style or a skill of the model.

What types of RAG exist? Naive (one search, then an answer), advanced (with query rewriting and reranking), modular, graph-based GraphRAG and agentic, where the AI decides by itself what to search for and where.

Sources

Where companies use it

Not sure whether your company needs this?

AI solutions map
Contact us