Learn · Glossary
What is RAG (retrieval-augmented generation)?
Definition
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.
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.
See SparkMentis with your own use case.
Tell us what you’re working on and we’ll walk you through it live. Or write to us at info@sparkmentis.ai.
