Glossary term
Glossary term
Memory and Retrieval
Query optimization involves refining a query to make it more efficient, precise, or context-aware so the AI retrieves the best possible answers faster. This could include rephrasing, ranking priorities, or eliminating unnecessary noise in the input before processing it.
HyDE (Hypothetical Document Embeddings) is a query optimization technique that generates a fake answer before retrieval.
Microsoft Research's RaFe and Anthropic's Contextual Retrieval both apply query optimization in RAG.
LlamaIndex offers query transformations like sub-question, step-back, and multi-step query optimization.