What is retrieval in AI search?
Retrieval finds the documents or passages in an index that best match a query. In AI search, it selects the text a model reads before it answers.
In short. Retrieval is finding the documents or passages in an index that best match a query. In AI search and retrieval-augmented generation, the retrieved text goes into the prompt, and the model writes its answer from that text. A page that the retrieval step does not return is not part of what the model reads for that answer.
On this page 7 sections
The evidence
- Confirmed:
- Confirmed:
OpenAI's Retrieval API returns at most 10 results per search by default. Developers can raise the limit to 50.2OpenAI API documentation. Checked Dec 1, 2026
- Tested:
- Confirmed:
Google says AI Overviews and AI Mode may issue multiple related searches across subtopics and data sources to build a response, a technique it calls query fan-out.4Google Search Central, updated Dec 10, 2025
Confirmed by the platformTested
Retrieval is the search step inside an AI answer. Before a model writes, a retrieval system looks up the documents or passages that best match the question and hands the best of them to the model.
#How does retrieval work?
Retrieval matches a query against an index that the system built in advance. A keyword index lists the documents that contain each word. This structure is an inverted index. A vector index stores an embedding of each passage. The system scores the matches, ranks them and keeps the highest-ranked results, a cutoff called top-k.
Anthropic's post on Contextual Retrieval lists the steps of a typical pipeline for retrieval-augmented generation (RAG). The system splits the documents into chunks of no more than a few hundred tokens. BM25 finds the top chunks by exact word matches, and embeddings find the top chunks by meaning. A rank fusion step combines the two lists and removes duplicates. The top chunks then go into the prompt.3
In a product, these steps run automatically. OpenAI's retrieval guide says that a file added to a vector store is chunked, embedded and indexed for the developer. A search returns at most 10 results by default, and the limit can go up to 50.2
#What are the main types of retrieval?
Retrieval systems match either words or meaning. The Dense Passage Retrieval paper calls sparse vector models such as TF-IDF and BM25 the standard method for passage retrieval in open-domain question answering. It shows that retrieval can also use dense representations alone.5
- Sparse retrieval matches the words of the query. BM25 is the common ranking function.
- Dense retrieval compares embeddings of the query and the passages. Dense retrieval can find text that uses other words for the same meaning.
- Hybrid search runs both and merges the two lists. Hybrid search explains how.
Many systems then run a second step. A reranker puts the first results in a new order with a more precise model.
#What role does retrieval play in AI search?
Retrieval gives a language model text that is not in its parameters. The paper that introduced RAG says pre-trained models store factual knowledge in their parameters but have limited ability to access and precisely manipulate it. It also names provenance and updating the model's knowledge as open problems. Its RAG models added a dense vector index of Wikipedia that a neural retriever searched.1
AI search engines retrieve from the web. Google's page on AI features says AI Overviews and AI Mode may issue multiple related searches across subtopics and data sources. It calls this technique query fan-out. While the response is generated, Google's models find more supporting web pages to link.4 The guide What is query fan-out? covers how Google runs these searches.
#How is retrieval quality measured?
Anthropic measured retrieval quality with recall at 20, which counts the relevant documents found within the top 20 chunks. It reported the reverse figure: the share of relevant documents that the system failed to retrieve. Combining contextual embeddings with contextual BM25 cut that failure rate by 49%, from 5.7% to 2.9%.3
A page reaches an AI answer only if a retrieval step returns it. What is retrieval-augmented generation (RAG)? covers the full pipeline and what it means for a site.
Read next
AI search
What is retrieval-augmented generation (RAG)?
RAG retrieves documents at query time and gives them to a language model to write a cited answer. How ChatGPT, Claude, Google, Bing and Perplexity use it.
AI search
What is query fan-out?
Query fan-out turns one question into several related searches and builds one answer from the results. Google says AI Overviews and AI Mode may use it.
AI search
How does AI search choose which sources to cite?
AI search retrieves pages from an index, reads passages and cites what it used. What OpenAI, Anthropic, Google, Microsoft and Perplexity document.
AI search
What is semantic search and how does it differ from keyword search?
Semantic search matches the meaning of a query, often with vector embeddings. Keyword search matches its words. Hybrid search runs both and merges the results.
Used in
- How fresh are the pages AI models cite? A median of 277 daysResearch
- What is agentic search?AI search
- How to get cited in ChatGPT searchGEO
- What ChatGPT, Claude, Gemini and Perplexity say about optimizationGEO
- What is grounding in AI?AI search
- What is query fan-out?AI search
- What is retrieval-augmented generation (RAG)?AI search
Related terms
Questions
What is the difference between retrieval and generation?
Retrieval finds text in an index. Generation is the step where a language model writes an answer. In a RAG system, retrieval runs first and its results go into the prompt for generation.
Does retrieval use keywords or embeddings?
It can use either, or both. Keyword retrieval such as BM25 matches the words of a query, and dense retrieval compares embeddings. Hybrid search runs both and merges the results.
How many results does a retrieval step return?
The system sets a limit, called top-k. OpenAI's Retrieval API returns up to 10 results by default and up to 50 on request. Anthropic passed the top 20 chunks to the model in its tests.
About this page
Researched and reviewed by Promptly Found. Reviewed Dec 1, 2026. Next review due Mar 2027.
Notes
- 1
- 2
- 3
- 4
- 5
Cite this page
Promptly Found. (2026, December 1). What is retrieval in AI search? https://promptlyfound.com/glossary/retrieval
Revisions 1
- First published.