AI Foundations
RAG
RAG (Retrieval-Augmented Generation) is a technique where a language model retrieves information from a knowledge base before generating each response, producing fact-grounded answers without hallucinations.
Also known as: Retrieval-Augmented Generation
How RAG works
A RAG system runs in two steps:
- Retrieval: the user request is turned into a vector that captures meaning. A vector database returns the most relevant knowledge snippets.
- Generation: the language model receives the question along with the retrieved snippets and produces the answer grounded in those sources.
Why RAG reduces hallucinations
Plain language models answer from their training data and can invent content. RAG forces the model to lean on concrete knowledge sources. Answers become traceable, can be cited, and stay current because the sources are maintained locally.
RAG at LoyJoy
Every LoyJoy AI agent operates with RAG on a tenant-specific knowledge base. Sources can be websites, PDFs, databases, or SharePoint.