watsonx.ai

 View Only

Automating RAG with IBM Granite Model and LangChain

By Łukasz Ćmielowski posted Fri January 05, 2024 08:57 AM

  

In its simplest form, RAG requires 3 steps:

  • Index knowledge base passages (once)
  • Retrieve relevant passage(s) from a knowledge base (for every user query)
  • Generate a response by feeding the user query and the passage retrieved from the database into a large language model (for every user query).

Watsonx.ai foundation models are supported from Langchain eco-system now. You can communicate with IBM Granite models using langchain code. You can also easily combine those models with RetrievalQA chain type, Chroma vectorstore, and HuggingFaceEmbeddings (designed by langchain to simplify/automate the RAG task), .

If you are interested in step by step description of the solution please check this medium story out!. Code snippets and sample notebook attached. Enjoy!.


#watsonx.ai
#ai-spotlight
0 comments
37 views

Permalink