Vibeleaderboard
← Glossary
Glossary · Context and retrieval

Retrieval-augmented generation

Also: RAG

Retrieving external evidence and placing it in context before generation.

RAG combines ingestion, chunking, indexing, query retrieval, optional reranking, context assembly, and grounded generation. Each stage needs separate evaluation because a fluent final answer can hide an upstream retrieval failure.

Put the idea to use

Suppose an assistant answers questions about a project handbook. Retrieval finds relevant passages; generation uses those passages to compose an answer. Ask the assistant to show the passage supporting its conclusion. A fluent answer alone cannot tell you whether the right passage was found.

Retrieval and answer quality are separate checks. If the source passage is irrelevant, improve the search. If the passage is correct but the answer misrepresents it, inspect the generation step. Changing the model may leave the retrieval problem untouched.

Background: LangChain: retrieval and generation.