Hypothetical Question Retriever
Required Graph Shape
Lexical Graph with Hypothetical Questions
Description
The user question is embedded using the same embedder that has been used before to create the question embeddings. A vector similarity search is executed on the previously generated questions. k (number previously configured by developer / user) most similar questions are found and their related Chunks are retrieved.
Usage
This pattern can yield better results in the vector similarity search than a question-to-chunk similarity search as used in e.g. Basic Retrievers or Parent-Child Retrievers. However, it also requires more pre-processing effort and cost in LLM calls for the question generation.
Further reading
- Implementing advanced RAG strategies with Neo4j (November 2023)