{"head":{"title":"What Is RAG (Retrieval-Augmented Generation)? | OceanLab","description":"RAG finds relevant passages in your own data and gives them to a language model with the question, so answers come from your content. How it works.","canonical":"https://oceanlab.in/glossary/rag"},"crumbs":[{"name":"Home","path":"/"},{"name":"Glossary","path":"/glossary"},{"name":"RAG","path":"/glossary/rag"}],"slug":"rag","term":"RAG (retrieval-augmented generation)","aka":["retrieval-augmented generation","grounded generation"],"category":"AI building blocks","short":"A pattern that finds relevant passages from your own data and gives them to a language model along with the question, so it answers from your content.","body":[["A RAG system has two parts. Retrieval searches your documents, tickets or records for the passages most relevant to the question, often using ",{"href":"/glossary/embedding","text":"embeddings"}," in a ",{"href":"/glossary/vector-database","text":"vector database"},", keyword search, or both. Generation sends those passages and the question to an ",{"href":"/glossary/llm","text":"LLM"},", which writes an answer based on them."],["Because the knowledge lives in your data store, not in the model, you can update it any time without retraining, and the answer can cite the exact passages it used."]],"why":["RAG is the usual way to make an AI assistant answer from company knowledge: policies, product docs, contracts, past cases. It reduces ",{"href":"/glossary/hallucination","text":"hallucinations"}," on factual questions and lets you enforce permissions by only retrieving what the user is allowed to see."],"example":["An insurer's internal assistant answers adjusters' questions about policy wording. It retrieves the clauses from the specific policy version on the claim, answers from them and links each clause, so the adjuster can check it in one click."],"inBuild":null,"mistakes":[["Blaming the model for bad answers when retrieval found the wrong passages. Test retrieval on its own."],["Splitting documents into chunks that cut tables and clauses in half."],["Ignoring permissions, so the assistant can quote documents the user should not see."]],"related":[{"href":"/glossary/embedding","label":"Embedding (vector embedding)","detail":"A list of numbers that represents the meaning of a piece of text, an image or other data, so that similar items have similar numbers."},{"href":"/glossary/vector-database","label":"Vector database","detail":"A database built to store embeddings and quickly find the ones closest to a query vector."},{"href":"/glossary/fine-tuning","label":"Fine-tuning","detail":"Training an existing model further on your own examples so it behaves the way you want, such as following a format, tone or task more reliably."},{"href":"/glossary/hallucination","label":"Hallucination (AI)","detail":"When an AI model produces information that is false or made up, presented as if it were true."}],"tools":[{"href":"/tools/rag-cost-calculator","label":"RAG cost calculator","detail":"Free tool"},{"href":"/tools/fine-tuning-vs-rag","label":"Fine tuning vs RAG","detail":"Free tool"},{"href":"/tools/embedding-cost-calculator","label":"Embedding cost calculator","detail":"Free tool"}],"links":[{"href":"/compare/rag-vs-fine-tuning","label":"RAG vs fine-tuning","detail":"Comparison"},{"href":"/ai-automation","label":"AI automation","detail":"How OceanLab automates company workflows with AI."},{"href":"/ai","label":"AI by industry","detail":"AI use cases, costs and risks per industry."}],"sources":[],"legal":false,"updatedAt":"2026-10-25"}