What Is RAG in AI?
RAG stands for Retrieval-Augmented Generation. It is a technique used with Generative AI systems, especially language-model applications, to retrieve relevant information from an external knowledge source and provide that information as context to a generative model.
Instead of relying only on information encoded in a model during training, a RAG system can search a connected collection of documents or other data at the time of a query and use relevant retrieved information when generating its response.
In simple words: RAG gives an AI model access to relevant external information before it generates an answer.
Simple example:
Suppose a company has 5,000 internal documents. Instead of expecting an LLM to already know all those documents, a RAG system can search the company's knowledge base when a user asks a question, retrieve the relevant passages and give those passages to the LLM as context.
Suppose a company has 5,000 internal documents. Instead of expecting an LLM to already know all those documents, a RAG system can search the company's knowledge base when a user asks a question, retrieve the relevant passages and give those passages to the LLM as context.