← Embeddings, RAG & Vector Search
05 · Embeddings, RAG & Vector Search · Topic 02

What is RAG?

Retrieval-Augmented Generation, or RAG, retrieves relevant information and supplies it to a model before it answers.

What is it?

RAG combines retrieval with generation so a model can use information supplied at runtime.

A RAG system searches a source collection, places selected results into the model context, and asks the model to answer from that context. The source may be documents, a database, or another trusted system.

Think of it like...

Think of it like asking a librarian before writing an answer.

The librarian finds relevant pages, and the writer uses those pages to answer. The analogy covers the retrieve-then-generate flow, not human-like understanding.

How it works

1 · AskReceive the queryThe application receives the user's question.
2 · SearchRetrieve candidatesFind relevant documents or records.
3 · SelectBuild contextKeep useful evidence within the context limit.
4 · GenerateWrite the answerAsk the model to use the supplied evidence.
5 · CiteShow sourcesMake important claims easier to check.

Real-world examples

Everyday example · Help center

Input: a question about account settings

AI / System: retrieves relevant help articles

Output: an answer grounded in those articles

Business example · Internal policy

Input: a question about company policy

AI / System: searches approved internal documents

Output: a cited answer for the employee

What it is NOT

RAG ≠ Fine-tuning

RAG: supplies information at runtime.

Fine-tuning: changes learned model behavior through training.

RAG ≠ Search Only

RAG: retrieves information and uses a model to generate an answer.

Search: returns matching results without necessarily generating an answer.

RAG ≠ Guaranteed Truth

RAG: gives the model selected evidence.

Guaranteed truth: cannot be provided by retrieval alone.

Remember this

RAG retrieves relevant evidence and gives it to the model before generation.

Independent explainer

Video

visual explainer
↑