Glossary

What is retrieval-augmented generation (RAG)?

Searching your content for passages relevant to a question and handing them to the model as it writes the answer.

Retrieval-augmented generation (RAG) is the technique of searching your content for the passages most relevant to a question and handing those passages to the language model as it writes its answer. Retrieval finds; generation writes. The reply is shaped by what retrieval found, so it can state facts the model never saw in training and can change the moment the content changes.

The name comes from a 2020 paper by Patrick Lewis and colleagues, which paired a text generator with a retriever over a Wikipedia index. In customer support the index is your own knowledge base, and the pipeline is: split the content into chunks, turn each chunk into an embedding, store it, embed the question as it arrives, find the nearest chunks, and place them in the prompt with instructions to answer only from them.

It matters because RAG is why a support agent can be accurate about your business without fine-tuning, and why a missing page means a missing answer. It is also where quality is won or lost. A chunk that splits a table in half, a crawler that captured navigation menus instead of the article, or a question phrased unlike any page all produce weak retrieval, and weak retrieval produces a vague or wrong reply. Where the idea runs out: retrieval finds similar text, not true text. If two pages disagree, RAG returns both and the model chooses, so the knowledge base needs one version of the truth.

See it in a real chat

PepoChat runs on this site. Ask the agent in the corner anything about the product.

Get started for free