# What is RAG (retrieval-augmented generation)?

> RAG lets an AI model look up relevant documents before it answers, so answers rest on your sources. Here's how retrieval-augmented generation works.

Learn · Glossary

Retrieval-augmented generation (RAG) is a way of building AI systems where the model first looks up relevant passages from a set of documents, then writes its answer from them, so answers rest on your sources rather than memory.

- Page: https://sparkmentis.ai/learn/retrieval-augmented-generation

## How it works

- **Index.** Documents are split into passages and turned into embeddings in a vector database.
- **Retrieve.** A question is matched to the closest passages.
- **Generate.** The model answers using those passages, ideally citing them.

## Why it matters

RAG cuts made-up answers and keeps answers current without retraining the model. It's how many tutoring and search tools stay grounded in a syllabus or a textbook.

## Questions

**Is RAG the same as fine-tuning?**

No. Fine-tuning changes the model; RAG gives it documents to read at answer time.

**Where can I learn to build it?**

SparkLab's Advanced AI program covers embeddings, vector databases and RAG.

## Related

- [Generative AI course](https://sparkmentis.ai/features/generative-ai-course.md): SparkLab
- [What are AI agents?](https://sparkmentis.ai/learn/ai-agents.md): Glossary

## Book a demo

Email info@sparkmentis.ai (subject "SparkMentis demo request") with your organization, your role and the products you're interested in.
