Repository navigation
fix(vector_store): normalize QdrantStore.search_vectors() to return "metadata" - #841
Conversation
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
PR Summary by QodoFix QdrantStore search results to expose metadata (not payload)
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
There was a problem hiding this comment.
Pull request overview
This PR fixes Qdrant vector search result normalization by aligning Qdrant’s returned metadata key with the rest of the vector store ecosystem (HybridSearch / PineconeStore), preventing metadata from being silently dropped and ensuring metadata filtering works correctly.
Changes:
- Updated
QdrantCollection.search_points()to return result metadata under the"metadata"key (instead of"payload"). - Extended Qdrant store deep-dive tests to assert the normalized shape and to verify
HybridSearch.filter_by_metadata()matches against Qdrant results.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
semantica/vector_store/qdrant_store.py |
Normalizes Qdrant search result dictionaries to expose "metadata" instead of "payload". |
tests/vector_store/test_vector_store_deepdive.py |
Adds assertions ensuring Qdrant results expose "metadata" and validates hybrid metadata filtering behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTo customize comments, go to the Qodo configuration screen, or learn more in the docs. |
db700b2 to
b7ac05b
Compare
…metadata" QdrantStore.search_vectors() returned results keyed by "payload" while HybridSearch and PineconeStore both expect/return "metadata". This silently dropped metadata from Qdrant results and caused HybridSearch.filter_by_metadata to reject every candidate when a filter was applied (empty result sets). Fixes semantica-agi#840
Adds an Unreleased/Fixed entry for semantica-agi#841 (closes semantica-agi#840) — QdrantStore search results were keyed "payload" instead of "metadata", breaking HybridSearch.filter_by_metadata() for Qdrant results.
KaifAhmad1
left a comment
There was a problem hiding this comment.
Verified end-to-end:
- Diff is a single-line rename in
QdrantCollection.search_points()(qdrant_store.py:168),"payload"→"metadata". - Traced the full call chain (
QdrantStore.search_vectors()→QdrantSearch.similarity_search()→QdrantCollection.search_points()) — no intermediate re-keying, so this one line is the sole source of the bug and the fix is complete, not partial. - Confirmed
PineconeStore.search_vectors()already returns"metadata", so this genuinely aligns Qdrant with the existing convention rather than introducing a new one. - Grepped the repo for any consumer reading
result["payload"]off vector-store search output — none found, so the rename breaks nothing downstream. - Ran
pytest tests/vector_store/: 167 passed, 36 skipped, same 6 pre-existingtest_pinecone_store.pyfailures reproduced independently on unmodifiedmain(unrelated mocking issue, confirmed via direct branch comparison, not justgit stash). - New test (
test_qdrant_store) directly asserts the key rename and exercisesHybridSearch.filter_by_metadata()against real Qdrant-shaped results — matches the actual bug path from #840, not just the surface rename.
Minor non-blocking note: the module docstring and insert_vectors()'s payloads param still use Qdrant's native "payload" terminology for the storage side — fine to leave, since this PR is scoped to the search result key other modules consume.
Approving.
Summary
QdrantStore.search_vectors()returned results keyed by"payload", whileHybridSearchandPineconeStoreboth use"metadata". This silently dropped metadata from Qdrant results and causedHybridSearch.filter_by_metadata()to reject every candidate when a filter was applied (empty result sets).QdrantCollection.search_points()to return"metadata"instead of"payload", matching the convention already used byPineconeStore.search_vectors().Fixes #840
Test plan
tests/vector_store/test_vector_store_deepdive.py::test_qdrant_storeto assert Qdrant search results expose"metadata"(not"payload") and thatHybridSearch.filter_by_metadata()matches against them correctly.pytest tests/vector_store/— 141 passed, 61 skipped, same 6 pre-existingtest_pinecone_store.pyfailures as on unmodifiedmain(unrelated mocking issue, verified viagit stash).