Repository navigation
test(rag): compare hybrid and semantic ranking in the eval harness - #24
Conversation
|
Clean implementation, and tests pass on current |
|
Thanks for the suggestion. I moved the comparison into the evaluation harness and updated this PR.
The current public fixture gives these results at K=5:
For context, an earlier exploratory local bilingual trial with EmbeddingGemma 300M had audited source-hit@5 counts of 47/50 for weighted and 50/50 for semantic-only ranking. That small work-derived, agent-audited set predates 0.18.0; it is not an independent production benchmark, and I have not rerun it on the new base. These are source hits, not answer-quality scores. No private documents, queries or paths are included here. That observation motivated a comparison tool, rather than a general claim that semantic-only ranking is better. The branch now includes upstream 0.18.0 without rewriting its published history, and the merge conflict is resolved. |
Compare hybrid and semantic-only document ranking in the evaluation harness without adding a product search mode. This revises the original proposal following review:
MCP_RAG_FUSION=semanticis removed, and release configuration retains its existing modes.Harness.CompareRankingsruns both variants against the same temporary index, encoder and QA set. It returns aggregate metrics with the hybrid fusion setting, cutoff and document cap; source text, paths and questions are not returned.make eval-comparereports the public fixture at caps 0 and 1, without rewriting or applying the hybrid baseline threshold to the experimental variant.The evaluation search entry point is compiled only with
-tags=eval. It shares normal query limits, errors and retrieval plumbing, skips keywords and recency/source/confidence boosts, and retains source filters, document diversity and trust metadata. The choice is per call, with no mutable engine mode. Missing vectors, loading vectors, provider fallback and reranker failures cannot silently substitute a different retrieval method. Normal MCP search behavior is preserved.Validation:
make test vet evalpassed;make evalnow also runs the evaluation-only RAG regression testsgo test -race -tags=eval ./internal/rag ./internal/rag/eval ./internal/configpassedmake eval-comparereproduced weighted 31/33 versus semantic 19/33 source hits at 5 with cap 0, and 31/33 versus 20/33 with cap 1The fixture encoder is a deterministic 64-dimensional ASCII-token hash, so these numbers exercise ranking mechanics and do not measure multilingual embedding quality. No universal improvement or default change is claimed.
Updated against upstream 0.18.0 by merging
main, preserving the published branch history. This contribution is independent of #21, #22, #23 and #25. No private documents, questions, corpus paths or generated corpus are included.