liveBook · Manning

Information retrieval

As explained in Introduction to Generative AI, Second Edition

Retrieval is the process of finding relevant information from an external collection in response to a query or representation.

Suppose you ask an AI assistant which restaurants are worth visiting tonight. Its training data may not reflect current reviews. Information retrieval lets it look for relevant information outside that data before answering—for example, by searching a review site or stored documents. section 10.20

In retrieval-augmented generation (RAG), a language model forms or uses a query, retrieves information, and draws on the results to generate a response. Sources can include web search results, past conversations, and documents in a vector database. A vector database searches representations of text that capture similarities in meaning, so a prompt can bring back related material. section 5.7 section 10.20

A more relevant recommendation

Asked for vegan restaurants in Copenhagen, a retrieval-enabled assistant might draw on an earlier rejected steakhouse recommendation, find relevant Yelp reviews, and use both to suggest better options. The answer depends on what it retrieves, not just what the model learned during training. section 10.20

Retrieval can help with fresh facts and reduce invented answers, but it does not make an answer automatically trustworthy. The assistant must recognize when to search, find useful results, and summarize them correctly; the sources themselves may also be unreliable. Citations give people a way to inspect the evidence behind a response. That matters when using AI summaries to learn about a developing scientific field or an ongoing conflict: check consequential claims against credible sources. section 5.7 section 6.7

Figure 10.4 A schematic diagram for an LLM accessing data stored in a vector database and retrieving search results from the web
A white circle with black text

AI-generated content may be incorrect.

The diagram traces how an assistant can draw on stored data and web search results before responding. section 10.20

How Introduction to Generative AI, Second Edition covers it

How deep it goes
Explains the query-search-summary sequence and semantic matching in vector databases at a high level, without implementation steps.
Examples
Uses a vegan-restaurant recommendation involving past preferences and Yelp reviews, alongside everyday searches for purchases and local activities.
What it assumes
Defines retrieval and describes vector databases in plain terms, without requiring knowledge of their implementation.
What you can do after
Evaluate/understand retrieval-enabled answers by checking whether retrieved sources support the summary and whether those sources are credible.
How it connects
Connects retrieval to retrieval-augmented generation, hallucinations, source citations, vector databases, memory, and planning.

Also explained in

Compare how 11 books explain information retrieval →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Introduction to Generative AI, Second Edition. The section links point to the parts of the book it draws on.