Learning about query mechanics – an overview
In this chapter, we will finally begin to reap the fruits of our work so far. Document ingestion, parsing and segmenting, metadata extraction, and index building were all just preparatory steps for what we are about to discuss: querying. At the heart of any RAG workflow is the idea of being able to bring relevant context into the prompt we use in the LLM query. So far, we have been concerned with constructing and organizing this context, but now, it is time to use it and extract the best possible answers from our interactions with LLMs. In the following sections, we will discuss various techniques that LlamaIndex provides us for the query part. As usual, we will start with the simplest query methods – called naive methods in jargon – and then discuss more advanced query variants.
First, we need to understand the typical steps in the query process: retrieval, postprocessing, and response synthesis.
In Chapter 3...