Vector DBs & RAG (50 Qs)•Part 3: Advanced Internals, Scale & Production Patterns (Senior / Lead)
What is Hypothetical Document Embeddings (HyDE) and when does it improve retrieval?
senior LevelData Structures
In Simple Words: HyDE uses an LLM to generate a hypothetical, hallucinatory ideal answer to the user's question before searching:
- User asks: "How do I configure MTU for jumbo frames on Linux?"
- LLM hallucinates a synthetic response with realistic commands (
ip link set mtu 9000). - Embed the synthetic answer instead of the short query.
- Search the vector database using the answer's embedding.
- Why it works: Answer-to-document vector similarity is significantly higher than question-to-document vector similarity in vector space!