Retrieval-Augmented Generation (RAG) combines information retrieval with language generation. A retriever searches a collection of documents and supplies relevant passages to a language model. Retrieval can use lexical methods such as BM25, dense vector similarity, or hybrid methods that combine both.

RAG systems should be evaluated with representative questions and relevance labels. Recall at k measures the fraction of relevant items retrieved in the first k results. Mean reciprocal rank rewards systems that rank the first relevant result highly. Normalized discounted cumulative gain can account for graded relevance when those labels are available.

A generated answer should be grounded in the supplied evidence. If evidence is missing or insufficient, a reliable system should say so rather than inventing details. Citations should point to the source material and should be checked for correctness.

Chunk size, overlap, embedding model, reranking, and query formulation can change retrieval performance. These choices should be compared under the same evaluation queries. Similarity scores are ranking signals, not probabilities that an answer is true.
