# Retrieval-augmented generation

A language model that looks up outside text and uses it when it writes an answer.

RAG comes up in [How to test an AI agent, and whether retrieval cuts hallucinations](/research/testing-ai-agents-and-hallucinations). The page explains it plainly: RAG gives the model documents to answer from. It then reads a study of legal AI tools and Vectara's leaderboard to see whether that lowers made-up answers. [n8n AI agents](/research/n8n-ai-agents) shows how common the setup is: n8n features a "RAG chatbot for company documents" among its community templates. If a vendor offers a chatbot over your files, this is the setup they mean.

The name comes from this paper's abstract, which says the model's learned knowledge is the parametric memory and the store it looks up is the non-parametric memory. The plain-words definition above is this site's reading of that abstract.

---

Published 2026-11-05. Web page: https://www.mackenziebowes.com/reference/glossary/retrieval-augmented-generation
