Retrieval-augmented generation (RAG)
Retrieving relevant text at query time and putting it in the prompt, so the model answers from your data instead of memory.
RAG combines a retrieval step with a generation step. Given a question, you search your own documents for the most relevant passages, paste them into the prompt as context, and ask the model to answer from them. It is the standard pattern behind assistants that answer from a knowledge base.
The retrieval half is an infrastructure problem; the prompt half decides whether the model actually stays inside the retrieved context, cites it, and admits when the answer is not there. Retrieval recall is the quality ceiling — if the right passage is never retrieved, no prompt can recover the answer.