Retrieval-augmented generation (RAG) grounds a generative language model with question-relevant context retrieved from an external source before answer generation. It combines an LLM, a guiding prompt, and retrieval tools that access structured databases or unstructured text and images. This extends pretrained models toward private, fresher, more transparent, and less hallucination-prone applications without treating their outputs as inherently reliable. section 13.4.1 section 13.5
A practical RAG pipeline proceeds through these stages:
- Prepare source data by dividing documents into passages, converting passages into fixed-length semantic embeddings, and storing them in an indexed vector database. section 13.4.1
- Embed the user’s question and retrieve the most similar passages or invoke another retrieval tool, such as a weather-forecast API. section 13.4.1
- Combine the question with the retrieved context in a prompt, then ask the LLM to generate an answer constrained by that information. section 13.4.1
- Validate results with human feedback or supervision because probabilistic models can still produce incorrect answers despite grounding. section 13.4.1
Private-data question answering
A proprietary influence network can answer “Who were the influencers of cyclotron research funding?” through an AI interface, avoiding direct Cypher queries, graph navigation, and manual dashboard interpretation. A vector implementation embeds private documents, runs similarity search for “What is known about cyclotron research?”, and returns the top two text chunks for generation. section 13.4
Witness-statement summarization
Supplying all witness statements connected to CASE123 turns an otherwise impossible case-specific request into a manageable summarization task. Removing one critical statement can reverse the answer to whether the perpetrator is left-handed, demonstrating that confident generation cannot compensate for incomplete retrieval. section 14.2.1 section 14.2.2































