Skip to content

feat: return scores from vector queries - #1355

Merged
zhenghaoz merged 1 commit into
gorse-io:masterfrom
zhangzhenghao:feat/query-vectors-score
Aug 2, 2026
Merged

feat: return scores from vector queries#1355
zhenghaoz merged 1 commit into
gorse-io:masterfrom
zhangzhenghao:feat/query-vectors-score

Conversation

@zhangzhenghao

@zhangzhenghao zhangzhenghao commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add ScoredVector and make QueryVectors return vector similarity scores
  • propagate scores from SQLite, Qdrant, Milvus, and Weaviate with higher values meaning greater similarity
  • carry scored vectors through the vector-store gRPC proxy by changing QueryVectorsResponse.vectors field 1 directly to ScoredVector
  • add a shared dot-product test that verifies query results are ordered by descending score

Score semantics

  • Qdrant: use the native query score
  • Milvus: use the native score and negate L2 distance
  • SQLite and Weaviate: negate distance

Testing

  • go test ./storage/vectors -run '^(TestNoDatabase|TestSQLite|TestProxy)$' -count=1
  • go vet ./storage/vectors ./protocol
  • go test ./protocol ./storage/vectors ./logics ./master ./server ./worker -run '^$'
  • go test ./... -run '^$' -count=1
  • git diff --check

@codecov

codecov Bot commented Aug 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 58.97436% with 32 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.64%. Comparing base (ea88b44) to head (d4522a9).

Files with missing lines Patch % Lines
storage/vectors/milvus.go 0.00% 28 Missing ⚠️
storage/vectors/sqlite.go 75.00% 1 Missing and 1 partial ⚠️
storage/vectors/qdrant.go 90.00% 1 Missing ⚠️
storage/vectors/weaviate.go 91.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1355      +/-   ##
==========================================
+ Coverage   72.28%   72.64%   +0.36%     
==========================================
  Files          94       94              
  Lines       18278    18312      +34     
==========================================
+ Hits        13212    13303      +91     
+ Misses       3660     3634      -26     
+ Partials     1406     1375      -31     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@zhangzhenghao
zhangzhenghao force-pushed the feat/query-vectors-score branch 2 times, most recently from a0574a8 to 08d3de5 Compare August 2, 2026 01:40
@zhangzhenghao
zhangzhenghao force-pushed the feat/query-vectors-score branch from 08d3de5 to d4522a9 Compare August 2, 2026 01:47
@zhenghaoz
zhenghaoz merged commit 674ca73 into gorse-io:master Aug 2, 2026
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants