RAG (retrieval-augmented generation)
RAG retrieves passages relevant to a question from your own documents and puts them into the prompt so the model can answer from them.
It is two systems in sequence, a search step and a generation step. The answer can only be as good as the passages that the search returned.
RAG lets a model answer about private or fresh information without retraining it. The pipeline is: split documents into chunks, embed and index them, retrieve the best candidates for each question, optionally rerank, and generate an answer with citations.
Common mistake. Debugging wrong answers by rewriting the prompt before checking whether the right passage was retrieved at all.
In practice. Measure retrieval alone with recall at k on real questions, fix the biggest failure group, and only then evaluate faithfulness of the generated answers.