Skip to content
Eldan.ai
Glossary

RAG (retrieval-augmented generation)

RAG retrieves passages relevant to a question from your own documents and puts them into the prompt so the model can answer from them.

It is two systems in sequence, a search step and a generation step. The answer can only be as good as the passages that the search returned.

RAG lets a model answer about private or fresh information without retraining it. The pipeline is: split documents into chunks, embed and index them, retrieve the best candidates for each question, optionally rerank, and generate an answer with citations.

Common mistake. Debugging wrong answers by rewriting the prompt before checking whether the right passage was retrieved at all.

In practice. Measure retrieval alone with recall at k on real questions, fix the biggest failure group, and only then evaluate faithfulness of the generated answers.

  • Chunking

    Chunking is splitting documents into pieces small enough to index and retrieve individually. The size and boundaries decide what search can find: too large and a chunk mixes topics, too small and it loses the context that makes it meaningful. Splitting along headings and list items usually beats fixed character counts.

  • Hybrid search

    Hybrid search combines keyword search, which is good at exact terms such as error codes and names, with vector search, which is good at paraphrases and meaning. The two ranked lists are merged, commonly with reciprocal rank fusion. On most real corpora the combination beats either method alone.

  • Grounding

    Grounding means tying a model's answer to supplied sources: it should say only what the retrieved passages support, cite them, and admit when the sources do not contain the answer. A grounded system is checkable by a reader. Faithfulness is the metric that tests whether each claim appears in the sources.

  • Recall at k

    Recall at k is the share of questions for which at least one relevant passage appears among the top k retrieved results. It measures the ceiling of a RAG system: if the right passage is not retrieved, the generator cannot use it. You compute it on a set of real questions with known answer locations.

Cite this page

Eldan Abdrashim. "RAG (retrieval-augmented generation)." Eldan.ai, 23 November 2026. https://eldan.ai/glossary/rag.

The date you read it is added when you copy.

BibTeX

@online{abdrashim2026rag,
  author = {Eldan Abdrashim},
  title = {RAG (retrieval-augmented generation)},
  organization = {Eldan.ai},
  date = {2026-11-23},
  year = {2026},
  month = nov,
  url = {https://eldan.ai/glossary/rag},
  langid = {english}
}

All terms

Section: Retrieval. Last updated 23 Nov 2026.