technical-term · Context & knowledge · foundational · Reviewed
Retrieval-augmented generation
A pattern that retrieves external information at inference time and supplies selected results to a generative model.
Definition
Retrieval-augmented generation combines a retrieval system with a model so responses can be conditioned on external, updateable sources. Retrieval can improve grounding and attribution, but it does not guarantee that selected content is relevant, current, complete, authorized, or true.
The architecture is established; production quality depends heavily on corpus governance, retrieval evaluation, and trust boundaries.
Why it matters
RAG changes the evidence available to the model without changing model weights.
The retrieval pipeline is part of the assurance surface: ingestion, indexing, access control, ranking, provenance, and citation all require evaluation.
System anatomy
- Corpus
- The governed source material available for retrieval.
- Retriever
- The method that selects candidates for a query.
- Context assembly
- Ranking, filtering, and formatting the material shown to the model.
- Attribution
- Links between claims and the exact retrieved sources.
Important distinctions
- Memory
- RAG is a retrieval pattern; it is not automatically an agent’s validated personal or project memory.
- Ground truth
- Retrieved content can be incorrect, stale, conflicting, or poisoned.
Implementation signals
- Enforce source-level access before retrieval
- Evaluate retrieval separately from generation
- Carry provenance and trust labels into context
Failure modes
- Prompt injection stored inside the corpus
- A plausible answer cites irrelevant chunks
- Sensitive content is filtered after rather than before retrieval
Sources and further study
- arXiv / NeurIPS — Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks
Introduces retrieval-augmented generation as a combination of learned generation and explicit retrieved non-parametric memory.
Use in this library: Primary definition. The paper establishes an influential architecture, not a guarantee that retrieved content is current, correct, authorized, or safe to use.
paper · paper · Published 2020-05-22 - Anthropic — Effective context engineering for AI agents
A working model for treating model-visible context as a finite resource that must be selected and maintained.
Use in this library: First-party case study. This first-party account documents one organization, product, or implementation context and should not be generalized without local evidence.
engineering · engineering · Published 2025-09-29 - OWASP GenAI Security Project — Memory Is a Feature. It Is Also an Attack Surface
A focused account of why persistent agent memory requires integrity, provenance, and poisoning defenses.
Use in this library: First-party case study. This first-party account documents one organization, product, or implementation context and should not be generalized without local evidence.
engineering · engineering · Published 2026-05-13