From the course: Hands-On AI: RAG using LlamaIndex
Unlock the full course today
Join today to access over 24,700 courses taught by industry experts.
Query transformation - LlamaIndex Tutorial
From the course: Hands-On AI: RAG using LlamaIndex
Query transformation
- [Instructor] We are going to close out our discussion of pre-retrieval techniques by talking about query transformation. Query transformation is a process in which a user's initial query is converted into a different format or broken down into subqueries. This transformation can be executed before the query is run against the database or an index. Hence, why it's called a pre-retrieval technique. The purpose of transforming a query is to enhance the effectiveness of what we retrieve from the database and make sure that the response is as accurate and relevant as possible. Also, it just could be the case that your users don't know what it is that they actually want to ask and might need some help from a language model. So let's go ahead and dig into it. So we'll start here by looking at some source code, right? If you're curious about what is going on under the hood, for anything in LlamaIndex, for any library you're working on in general, you should always be reading the source…