mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 10:58:17 -05:00
HyDE - Advanced RAG — Improving retrieval using Hypothetical Document Embeddings(HyDE) #4074
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @machiidev on GitHub (Feb 23, 2025).
Feature Request
OpenWebUI has powerful RAG functionality. This function uses the vectorized user questions to query documents in embedding index and generates prompts including the best matching documents.
Unfortunately often a query with the questions does not find the best fitting documents in the index. So the HyDE approach suggests to generate a hypothetical answer at first. This answer is then used for querying the document index for better results. Then the results together with the original question and the hypothetical answer is combind to the prompt to get the answer.
Further Readings:
https://medium.aiplanet.com/advanced-rag-improving-retrieval-using-hypothetical-document-embeddings-hyde-1421a8ec075a
https://medium.com/towards-data-science/how-to-use-hyde-for-better-llm-rag-retrieval-a0aa5d0e23e8
** Solution
Add HyDE functionality beside standard RAG functions. Option to generate hypothetical answers (maybe with own prompt, length parameter, temperature, different model, ...) and then use this answer in prompt for final answer generation.