When a user’s wording does not resemble the language in stored documents, direct vector search can miss useful chunks. HyDE addresses this by asking an LLM to generate a hypothetical answer, then embedding and searching with that synthetic text. section 4.3
A practical HyDE workflow:
- Receive the user’s question. section 4.3
- Prompt an LLM to generate a paragraph that answers the question. section 4.3
- Use the generated text for vector similarity search in the database. section 4.3
From thirst to drinks
A user asks, “What should I order if I’m thirsty?” Although a menu’s drinks section may not match those exact words, a generated answer about suitable drinks can provide a closer semantic search representation. section 4.3
