HyDE and Query Rewriting: 7 of 12 vs 10 of 12
My search put the right page first 7 times out of 12. A pretend answer did it 10 times.
Video #45 ยท RAG and vector search
Steps in the video
Files
- compare.py (26 lines)
- handbook.md (28 lines)
- rewrite.py (19 lines)
- search.py (28 lines)
Tested with
Python 3.12.15 | ollama==0.6.3
What this does not show
A made-up handbook with nine sections and twelve vague questions that I wrote, made vaguer after a first easier set showed almost no difference. One small model, one embedder, one run, prompts not tuned. A difference of one or two questions is small. Clear questions were not tested.
Sources
Learning IT by Example.