Code lab 14.2 – Query decomposition
The code for this lab can be found in the CHAPTER14-2_DECOMPOSITION.ipynb
file in the CHAPTER14
directory of the GitHub repository.
Query decomposition is a strategy focused on improving question-answering within the GenAI space. It falls under the category of query translation, which is a set of approaches that focuses on improving the initial stage of the RAG pipeline, retrieval. With query decomposition, we will decompose or break down a question into smaller questions. These smaller questions can either be approached sequentially or independently, depending on your needs, giving more flexibility across different scenarios you might use RAG for. After each question is answered, there is a consolidation step that delivers a final response that often has a broader perspective than the original response with naïve RAG.
There are other query translation approaches such as RAG-Fusion and multi-query, which are focused on sub-questions...