From the course: Level up LLM applications development with LangChain and OpenAI

Unlock the full course today

Join today to access over 24,400 courses taught by industry experts.

Retrieval with query analysis

Retrieval with query analysis

- [Instructor] So now we move on to the next and last parts, where we want to define retrieval with query analysis. So we want to run another chain, which is to allow retrieval with query analysis. So we're going to run everything all at once. So let's see here. We're going to define a new chain, which will be a custom chain, where we're going to execute everything all at once, starting with this first step, intermediary step, which is to select the right retriever by using query_analyzer. So, basically, with query_analyzer, we're going to generate a structured output that returns the information of both the person and the query. And based on the output, we're going to access the information of the person to then select which retriever to use. So that's going to be up here. We're going to then select either HARRISON or ANKUSH based on the user query. Once we select the right retriever, we're going to then be able to invoke it and then generate an output in natural language. like we…

Contents