Demystify RAG with OpenShift AI and Elasticsearch

Understand how retrieval-augmented generation (RAG) works and how users can implement a RAG workflow using Red Hat OpenShift AI and Elasticsearch vector database.

Explore OpenShift AI 

Overview: Demystify RAG with OpenShift AI and Elasticsearch

Retrieval-augmented generation (RAG) is a natural language processing (NLP) technique in which contextual information is combined with the power of large language models (LLMs) to generate more accurate responses. In recent years, RAG has become a sort of de facto approach to enhance models with enterprise’s or user’s own data. Per IDC, "By 2025, two-thirds of businesses will leverage a combination of generative AI and RAG to power domain-specific, self-service knowledge discovery, improving decision efficacy by 50%." 

LLMs are trained on a large corpus of data. So, when users interact with such models, the output is based solely on the information that was used in training the model. Often these large LLMs are trained on public data and not an enterprise's own data. Any recent information or information that has changed from the time of training will not be accounted for when generating responses. This is where RAG helps. First, more recent information is stored in a vector database. At the time of inference, when a user submits a question, information relevant to the question is retrieved from the vector database. Then the LLM uses this to generate a more contextually appropriate response to the question. 

Red Hat OpenShift AI is an AI/ML platform that runs on top of OpenShift for building, tuning, and deploying predictive and generative AI models. Likewise, Elastic’s Elasticsearch database is a distributed analytics and search engine as well as a complete vector database. In this learning path, we will demonstrate how RAG works and how it can be implemented on top of Red Hat OpenShift AI and Elastic’s Elasticsearch database in order to enhance LLMs with contextual information.

Prerequisites:

  • Access to an OpenShift cluster with OpenShift AI installed on it.

In this learning path, you will:

  • Understand the RAG workflow.
  • Implement RAG on Red Hat OpenShift AI.