Retrieval-Augmented Generation (RAG)

AI & Agentic Systems • UX & Product Architecture

Definition

Retrieval-Augmented Generation (RAG) is an architectural pattern that retrieves relevant factual knowledge from external vectorized databases and injects it into an LLM's prompt context prior to response synthesis.

Purpose

Prevents factual hallucinations and delivers up-to-date domain expertise without the massive computational expense of continuous model retraining.

Key Concepts

Vector embeddingssemantic similarity searchchunking strategiesdense retrieval.

How It Works

User queries are embedded into vector space, matched against document databases via cosine similarity, and top chunks are prepended to the prompt context.

Related Terms

Sources