Retrieval
What is retrieval?
Retrieval is the process of searching an external information source and selecting items relevant to a current query, goal, or decision. The source may be a document index, database, search engine, memory store, knowledge graph, or file collection.
In AI systems, retrieval brings information to the model rather than expecting the model to contain every needed fact.
How retrieval works
The system first represents the information need as a query. It then searches an index and returns candidate results with relevance signals. Common approaches include:
- keyword search, which matches words or terms;
- vector search, which compares embeddings for semantic similarity;
- metadata filtering, which narrows results by fields such as date or owner;
- hybrid search, which combines multiple methods.
A reranking stage may then reorder the candidates using a stronger relevance model.
Simple example
Suppose an agent needs the refund rule for a damaged product. Retrieval can search policy documents, filter for the correct region and effective date, and return the most relevant passage. That passage can then enter the model’s context for interpretation.
The retrieval output should include source identity and useful metadata, not only isolated text.
Retrieval versus RAG and generation
Retrieval finds information. [Retrieval-Augmented Generation](/glossary/retrieval-augmented-generation/) combines retrieval with a language model that generates an answer from the selected evidence.
Generation produces new text; retrieval returns existing items. A system may retrieve documents without generating anything, or generate an answer without external retrieval.
Retrieval also differs from memory. Memory describes information retained for later use. Retrieval is the operation used to find relevant stored information. It can search agent memory, but it can also search ordinary documents that were never written as memories.
What affects retrieval quality?
Quality depends on document preparation, chunk size, index freshness, query construction, embedding choice, filters, ranking, and access control. A semantically similar passage is not always factually appropriate, current, or authorized.
Useful evaluation asks whether the needed item appears within the top results, not merely whether the final answer sounds good. Missed evidence and irrelevant evidence require different fixes.
Why it matters
Retrieval gives agents targeted access to information too large, private, or changeable to place permanently in every prompt. It can reduce context size and improve grounding.
However, retrieval is not automatic truth. Agents should preserve provenance, handle empty or conflicting results, and avoid treating similarity as proof. See [Memory in AI Agents](/memory-in-ai-agents/) for how retrieval fits into the memory lifecycle.
Learn More
Memory in AI AgentsContinue with the full AIRundown guide →