RAG (Retrieval-Augmented Generation) is a technique where a language model retrieves relevant information from an external knowledge source before generating its answer.
Instead of relying solely on the static knowledge learned during training, a RAG system first searches an external database (for example internal company documents or an up-to-date knowledge base) for matching text passages on every query.
Those retrieved passages are then passed to the language model together with the actual user question as additional context, so the generated answer is grounded in real, verifiable sources rather than potentially outdated or incomplete training knowledge.
This measurably reduces hallucinations and lets a language model be supplied with current or company-specific knowledge without the need for expensive retraining.



