# Retrieval-Augmented Generation (RAG)

URL: https://eoxlabs.dev/glossary/retrieval-augmented-generation
Last updated: 2026-11-26
Publisher: EOXLABS (https://eoxlabs.dev)

Section: [Glossary](https://eoxlabs.dev/glossary)

Retrieval-augmented generation (RAG) is a technique in which a language model answers using passages retrieved at query time from a separate document store, rather than relying only on what it learned in training. It takes its name from a 2020 paper by Patrick Lewis and colleagues that paired a pre-trained generator with a searchable dense vector index.

## What problem was RAG designed to solve?

The paper, [Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks](https://arxiv.org/abs/2005.11401) (NeurIPS 2020), starts from a limitation of models that store knowledge only in their weights: their "ability to access and precisely manipulate knowledge is still limited," and "providing provenance for their decisions and updating their world knowledge remain open research problems." Its RAG models combine "parametric and non-parametric memory": a pre-trained sequence-to-sequence model, and "a dense vector index of Wikipedia, accessed with a pre-trained neural retriever."

For an organization, that translates into three practical gains. Answers can draw on the organization's own documents, they can stay current without retraining a model, and each answer can point to the passages it used, which supports data provenance.

## What new risks does RAG bring?

The retrieval layer is an attack surface. The OWASP Gen AI Security Project's entry [LLM08:2025 Vector and Embedding Weaknesses](https://genai.owasp.org/llmrisk/llm082025-vector-and-embedding-weaknesses/) warns that weaknesses in how vectors and embeddings "are generated, stored, or retrieved can be exploited" to "inject harmful content, manipulate model outputs, or access sensitive information." OWASP's [LLM01:2025 Prompt Injection](https://genai.owasp.org/llmrisk/llm01-prompt-injection/) adds that techniques like RAG "do not fully mitigate prompt injection vulnerabilities", and describes indirect injection through content the model reads from "external sources, such as websites or files."

## How does EOXLABS build RAG systems?

EOXLABS treats retrieval as part of the security boundary, applying zero trust thinking to the documents as well as the users:

- **Permission-aware retrieval.** Results are filtered by what the person asking is allowed to open, before ranking, in line with OWASP's call for "permission-aware vector and embedding stores".
- **Citations by default.** Every answer carries references to its source passages, and the system records which passages were retrieved for each answer.
- **Retrieved text is untrusted input.** Instructions found inside documents are never treated as instructions to the system.
- **Retrieval is tested on its own.** Whether the right passages came back is measured separately from whether the model's wording was good.

This work sits within EOXLABS's [AI systems practice](https://eoxlabs.dev/capabilities/ai-systems), and keeping the document store clean and current is a [data pipeline](https://eoxlabs.dev/capabilities/data-pipelines) problem as much as a model problem.

## What does a RAG system look like in practice?

An internal policy assistant at a financial services firm answers staff questions from the firm's own procedures. A question about expense approvals retrieves only documents that employee can already open, the answer quotes the relevant clauses, and each quote links to the source paragraph so the employee can check it.

## What is RAG confused with?

- **Fine-tuning.** Fine-tuning changes a model's weights. RAG changes what the model is given at query time, so knowledge can be updated by updating the documents.
- **A cure for wrong answers.** Retrieval narrows what the model draws on. It does not guarantee the model uses the passages faithfully, so citations still need checking.
- **Vector search.** Dense vectors were the original paper's retriever, but keyword search and structured queries are retrieval too.

More AI and data terms are in the [EOXLABS glossary](https://eoxlabs.dev/glossary).

## Related

- [AI Systems and Agents](https://eoxlabs.dev/capabilities/ai-systems): EOXLABS designs AI pipelines and agents in which every output is validated against a schema, traced to its source, reviewed when confidence is low and measured against an evaluation set.
- [Data Pipelines](https://eoxlabs.dev/capabilities/data-pipelines): EOXLABS designs pipelines in which every record can be traced from source to destination: ingestion at the edge, validation with reasons, idempotent transforms, and lineage stored with the data.
- [Data Provenance](https://eoxlabs.dev/glossary/data-provenance): Data provenance records the origin and history of data, down to the source, the process and the person or system responsible. It is what lets a reviewer check a number instead of trusting it.
- [Zero Trust](https://eoxlabs.dev/glossary/zero-trust): Zero trust removes trust based on network location. Every user, device and service proves who it is and what it may do on each request, as described in NIST SP 800-207.

## More glossary

- [Edge-Native](https://eoxlabs.dev/glossary/edge-native)
- [V8 Isolate](https://eoxlabs.dev/glossary/v8-isolate)
- [Cold Start](https://eoxlabs.dev/glossary/cold-start)
