Google Cloud: Retrieval-augmented generation
Reference architecture and explanation of using retrieval to supply external information to a generative model.
Compute College
Understand how an AI application retrieves external information and supplies it to a model before generation.
Retrieval-augmented generation, or RAG, is a workflow that finds relevant information from an external collection and places selected passages into a model’s context before the model generates an answer. The collection may use keyword search, embeddings, metadata filters, or a combination. Retrieval supplies evidence; it does not guarantee that the model will use the evidence correctly.
Memory trick: RAG retrieves the evidence. The model writes the answer. Evaluation checks whether the answer used the evidence.
A model’s trained knowledge may be out of date, lack private company information, or be too broad for a particular decision. RAG lets an application bring current, scoped evidence into the request. The tradeoff is an additional retrieval path, ingestion work, context tokens, latency, and new failure modes when the right document is not found.
For a policy assistant, the application embeds approved policy documents, filters for the employee’s region, retrieves the top candidates for the question, and provides the passages with source titles and effective dates. The answer must cite the passages or say that the available evidence is insufficient.
Example figures are illustrative calculations, not current quoted market prices.
Current example
RAG is a system pattern rather than a single vendor feature. This Google Cloud reference describes the retrieval and generation flow; treat its architecture language as a starting point and measure the latency, quality, and cost of the chosen implementation.
Reference architecture and explanation of using retrieval to supply external information to a generative model.
Source discipline: the reference explains the concept or method; it is not a substitute for measuring a production workload under its actual provider, model, and data conditions.
Adding a vector database does not create grounded answers by itself. If documents are poorly chunked, stale, unauthorized, or ranked incorrectly, the model receives the wrong evidence with high confidence.
Practical takeaway
Map a RAG pipeline from ingestion to answer: prepare documents, attach metadata, retrieve candidates, rerank, assemble context, generate, cite, and evaluate. Measure each stage before optimizing the model.
Decision check: when retrieval finds no authoritative evidence, does the application say so instead of converting absence into a guess?
Compute College track
Step 12 of 18: Retrieval augmented generation