Search

Retrieval-augmented generation (RAG)

Retrieval-augmented generation, or RAG, is an AI (artificial intelligence) framework that augments the capabilities of large language models (LLMs) by incorporating knowledge retrieval from external sources. This enables LLMs to provide more accurate, relevant, and up-to-date responses to a wider range of questions and prompts.

RAG works by first retrieving a set of relevant documents from an external knowledge source, such as Wikipedia or a company’s internal knowledge base. These documents are then combined with the original prompt and fed into the LLM, which generates a final response. The retrieved documents provide the LLM with additional context and information, which it can use to improve the accuracy and relevance of its responses.

RAG has several advantages over traditional LLM-based approaches:

Improved accuracy: RAG can provide more accurate responses because it has access to a wider range of information.

Increased relevance: RAG can provide more relevant responses because it can consider the context of the query and retrieve information that is specifically relevant to that context.

Greater flexibility: RAG can be used to answer a wider range of questions and prompts, including those that require factual knowledge or common sense.

 

RAG is still a relatively new technology, but it has already been shown to be effective in a number of applications, including question answering, summarization, and translation. As RAG continues to develop, we can expect to see it become an even more powerful tool for enhancing the capabilities of LLMs.

 

<< Return to Glossary

Subscribe to our newsletter

Join over 1,000+ other people who are mastering AI in 2024

You will be the first to know when we publish new articles

Subscribe to our newsletter

Join over 1,000+ other people who are mastering AI in 2024