Level 3 · Module 17 · 10 minutes
Retrieval: giving an assistant the right documents
- Explain retrieval: searching a trusted collection before the model answers.
- Describe in simple terms what an embedding is and why it helps find related text.
- Name two limits of retrieval-augmented answers.
An AI model does not know your documents. Its knowledge is fixed when training ends. It cannot see a policy folder, today's prices, a patient file or a new email unless that material is put in front of it. Ask about a document it never saw, and it may answer with a confident guess. Retrieval solves that problem by finding useful text first and handing it to the model with the question.
Search first, answer second
Retrieval-augmented generation, often shortened to RAG, works in a simple order. The question is used to search a collection of approved documents. The system picks the most relevant passages and places them in the prompt next to the question. The model then writes an answer using those passages, and the answer should point back to the source.
The collection might be a help centre, a set of contracts, a product manual or a folder of meeting notes. Retrieval is only as good as that collection. If the right document is missing, out of date or locked away, the answer suffers.
Embeddings: finding text by meaning
How does a system find a passage when the question uses different words? It converts text into an embedding, which is a long list of numbers that represents meaning. Texts with similar meaning end up with numbers close together. A question about cancelling a plan can then find a passage about stopping a subscription even when the two share few words. The search compares numbers, not paper files.
An embedding is not a summary or a saved page. It is a numerical fingerprint of meaning. In a real system an embedding model produces it; in a classroom exercise, cards or hand-made vectors can stand in for the idea.
Citations and honest gaps
A good retrieval answer shows where each important claim came from. The reader can open the source and check. If the search finds nothing useful, the assistant should say so instead of filling the gap from memory. That rule matters more than a polished answer.
Limits to keep in mind
- The search can miss the best passage.
- A short chunk can lose the sentence that changes its meaning.
- Documents can be stale, duplicated or contradictory.
- The retriever can return a document the user is not allowed to see.
- The model can still misread a passage it was given.
Retrieval also does not train the model. The weights stay the same. It simply changes what is in front of the model for that request.
Practice versus a live document system
The lesson exercise simulates retrieval with a small pile of cards. It is a teaching model of search, not a real document system. No embeddings are generated and no private documents are used.
Common misconception
When an assistant uses retrieval, it learns your documents and remembers them in later chats. Retrieval fetches passages for the current request and puts them in the prompt. The model's weights do not change, and nothing is remembered unless the system explicitly stores the chat. Quality depends on the document collection, the search and the permissions.
Guided practice
Choose a question that needs a source, such as how long a return window is. List two documents that might contain the answer, write the exact passage you would expect to find, and add the source you would cite. Then note one reason the search might miss that passage. Use invented documents and keep it on paper; this simulates retrieval and trains nothing.
Knowledge check
Independent practice
Write a short example from your own work or daily life and decide whether it is AI, ordinary software or a mixture. Then explain why. Save it in your notes; no account is required.
Last reviewed: · Report a problem