Introduction to Knowledge and RAG

Adding Knowledge and performing RAG in Dataiku is done using the Knowledge Banks.

RAG and Knowledge Banks primarily work using Embedding, i.e. a vector representation of a chunk of text. The Embedding is performed by a specialized kind of LLM, the Embedding LLM.

In order to perform RAG in Dataiku, you first must create an Embedding recipe. The Embedding recipe takes your text corpus as input, and outputs a Knowledge Bank.

The Knowledge Bank contains the embedded version of your corpus, that is stored in a Vector Store. A vector store is a specialized kind of database, that allows to quickly search for the “closest vectors”.

You then define Retrieval-augmented LLMs. A retrieval-augmented LLM is the combination of a standard LLM and a Knowledge Bank, with some search settings.

When you submit a query to the Retrieval-augmented LLM (either with the Prompt Studio, a Prompt Recipe, the Chat UIs, or using the LLM Mesh API), Dataiku will automatically:

  • Use the Embedding LLM in order to obtain the embedded representation of the query

  • Use the vector store in the Knowledge Bank in order to search for the embedded vectors (i.e. the documents of your corpus) that are the closest to your query

  • Add the relevant documents to the query

  • Query the actual LLM with the contextual document

  • Respond with the context-aware answer, as well as with information about which documents were used (the “sources” of the augmented query)