# Retrieval-augmented generation (RAG) | IonBin

> Retrieval-augmented generation supplies external information to a model when it answers.

Canonical page: https://ionbin.com/wiki/concepts/rag/
Agent guide: https://ionbin.com/llms.txt

This is a readable version of the published page. Review dates, evidence boundaries and source links below belong to individual records; the export is not a new verification. Examples are reference material, not instructions to execute.

Concept

## Retrieval-augmented generation (RAG)

Retrieval-augmented generation supplies external information to a model when it answers. Retrieval can select passages from a library larger than the context window, using keyword, vector or hybrid search. Relevance, permissions and source freshness still need checks; retrieved text does not guarantee a correct answer.

Verified Oct 18, 2026 Review by Apr 16, 2027 2 sources

### What it is

Retrieval-augmented generation connects a model with information fetched from external sources. The term comes from a 2020 research paper by Lewis et al. Rather than loading a whole knowledge base into the [context window](https://ionbin.com/wiki/concepts/context-window/), the system finds the few passages most likely to matter and passes those along.

### How it works

- Documents are split into chunks.

- In a vector-based implementation, each chunk is turned into an [embedding](https://ionbin.com/wiki/concepts/embeddings/). Keyword or hybrid retrieval are other options. Google, for example, offers Gemini Embedding models for semantic search and RAG.

- When a question arrives, the system finds candidate chunks matching the query, potentially reranking or filtering them and adds them to the prompt.

- The model answers from those chunks, ideally citing them.

### Benefits

- **Scale.** Works on libraries far larger than any context window.

- **Freshness.** Updating sources and their index can expose new information without retraining the generator. Stale indexes, caches or retrieval failures can still return old material.

- **Citations.** Answers can point back to the exact source chunk.

### Limits and risks

- **Omissions.** Retrieval can miss necessary passages. Measure retrieval coverage separately from answer quality, and check cited passages actually support the answer.

- **Chunking is a design decision.** Splitting documents badly breaks cross-references.

- **Permissions matter.** Filter retrieval using the requesting user’s access rights; an index must not make private documents available to everyone.

- **More systems to run.** An index, an embedding model and a retrieval service: each one is a place to fail.

### Best-fit stacks

Stack 05

#### [Customer support](https://ionbin.com/use-cases/customer-support/)

Answer faster from a help desk your agent can search, with help-center drafts a person approves.

Stack 07

#### [Research & market intelligence](https://ionbin.com/use-cases/research-intelligence/)

Competitor, market and search research with sources you can cite.

Stack 11

#### [Document & knowledge preparation](https://ionbin.com/use-cases/document-preparation/)

Turn scans and PDFs into checked text with references back to the original documents.

### Agent compatibility

| Tool in this entry | How agents connect |
| --- | --- |
| [Notion](https://ionbin.com/tools/notion/) | MCPAPI/CLIFile import |
| [Google Workspace (Gmail, Drive, Sheets)](https://ionbin.com/tools/google-workspace/) | MCPAPI/CLIFile import |

Levels come from each tool's recorded, sourced compatibility. [How the levels work](https://ionbin.com/wiki/questions/connect-a-tool-to-an-ai-agent/).

### Related entries

[Context window · Concept](https://ionbin.com/wiki/concepts/context-window/)[Should I use RAG or put everything in the context window? · Question](https://ionbin.com/wiki/questions/rag-or-full-context/)[Context rot · Concept](https://ionbin.com/wiki/concepts/context-rot/)[Gemini models (Google) · Model](https://ionbin.com/wiki/models/gemini/)[Data provenance · Concept](https://ionbin.com/wiki/concepts/data-provenance/)[OCR and document layout · Concept](https://ionbin.com/wiki/concepts/ocr-and-layout/)[AI context, memory and orchestration · Concept](https://ionbin.com/wiki/concepts/ai-context-and-memory/)[Build a help center AI can use · Need](https://ionbin.com/wiki/needs/build-a-help-center-ai-can-use/)[Cohere models (Command, Embed, Rerank) · Model](https://ionbin.com/wiki/models/cohere/)[Docs and knowledge workspaces · Service](https://ionbin.com/wiki/services/docs-workspaces/)[Document extraction and OCR tools · Service](https://ionbin.com/wiki/services/document-extraction/)[Embeddings · Concept](https://ionbin.com/wiki/concepts/embeddings/)[Fine-tuning · Concept](https://ionbin.com/wiki/concepts/fine-tuning/)[Hallucination · Concept](https://ionbin.com/wiki/concepts/hallucination/)[How do I give an AI agent memory of our business? · Question](https://ionbin.com/wiki/questions/give-an-agent-memory/)[How do I stop AI from making things up? · Question](https://ionbin.com/wiki/questions/how-to-reduce-ai-hallucinations/)[I need every AI tool to know how our business works · Need](https://ionbin.com/wiki/needs/build-a-company-context-store/)[I need fast, cited research on competitors and my market · Need](https://ionbin.com/wiki/needs/research-competitors-and-market/)[Knowledge cutoff · Concept](https://ionbin.com/wiki/concepts/knowledge-cutoff/)[Should we fine-tune a model or just write better prompts? · Question](https://ionbin.com/wiki/questions/should-we-fine-tune-or-prompt/)[Vector database · Concept](https://ionbin.com/wiki/concepts/vector-database/)

### Sources

- [Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks](https://arxiv.org/abs/2005.11401) · Lewis et al.reference accessed Oct 18, 2026

- [Gemini embeddings](https://ai.google.dev/gemini-api/docs/embeddings) · Googleofficial accessed Oct 18, 2026

Practitioner views are restated in our words and labeled as views, not measured results. Product facts come from official sources dated above.

### Suggest an edit

IonBin's wiki isn't user-edited. Corrections go to our Directory Curator, who checks them against primary sources before anything changes. Spot something wrong or out of date on “Retrieval-augmented generation (RAG)”? Email us with a link to a primary source.

[Suggest an edit by email](mailto:contact@ionbin.com?subject=Suggest%20an%20edit%3A%20Retrieval-augmented%20generation%20(RAG)%20%5Brag%5D&body=Page%3A%20https%3A%2F%2Fionbin.com%2Fwiki%2Fconcepts%2Frag%2F%0AEntry%3A%20concepts%2Frag%0A%0AWhat%20should%20change%3A%0A%0A%0APrimary%20source%20(link)%3A%0A) or write to [contact@ionbin.com](mailto:contact@ionbin.com)

Entry facts

**Type**: [Concepts & glossary](https://ionbin.com/wiki/concepts/)

**Status**: Reviewed

**Verified**: Oct 18, 2026

**Review by**: Apr 16, 2027 (every 180 days)

**Sources**: [1 official · 1 other](https://ionbin.com/wiki/concepts/rag/#sources)

 Tools

[Notion](https://ionbin.com/tools/notion/)[Google Workspace (Gmail, Drive, Sheets)](https://ionbin.com/tools/google-workspace/)

The wiki carries no sponsored placements or affiliate links. [Editorial policy](https://ionbin.com/editorial-policy/).
