Skip to content

Retrieval

LLM & Language Models

The process of finding and fetching relevant information from a knowledge base to provide context for AI generation — the 'R' in RAG.

Retrieval is the first step in RAG: given a user query, find the most relevant documents from a knowledge base. The quality of retrieval directly determines the quality of the final AI response — if the wrong documents are retrieved, the AI generates from wrong context.

Modern retrieval combines multiple approaches: dense retrieval (using embeddings and vector search for semantic matching), sparse retrieval (traditional keyword matching like BM25), and hybrid retrieval (combining both). Reranking models then score and reorder results for relevance.

Good retrieval is harder than it looks. Challenges include: retrieving the right granularity (whole documents vs. relevant paragraphs), handling queries that need information from multiple sources, and dealing with contradictory information across documents.

Real-World Example

When you ask Perplexity a complex question, the retrieval system first finds 10-20 relevant web pages, then the LLM synthesizes an answer from those specific sources — retrieval quality determines answer quality.

Related Terms

More in LLM & Language Models

FAQ

What is Retrieval?

The process of finding and fetching relevant information from a knowledge base to provide context for AI generation — the 'R' in RAG.

How is Retrieval used in practice?

When you ask Perplexity a complex question, the retrieval system first finds 10-20 relevant web pages, then the LLM synthesizes an answer from those specific sources — retrieval quality determines answer quality.

What concepts are related to Retrieval?

Key related concepts include RAG (Retrieval-Augmented Generation), Embedding, Vector Database, Semantic Search. Understanding these together gives a more complete picture of how Retrieval fits into the AI landscape.