fix(memory): replace deprecated search_points with query() API in QdrantOps#3428
Merged
fix(memory): replace deprecated search_points with query() API in QdrantOps#3428
Conversation
…antOps The deprecated gRPC search_points path produced near-zero cosine scores (~0.011) for skill injection, causing all candidates to fall below the 0.20 threshold and zero skills to be injected per turn. Replace SearchPointsBuilder + client.search_points() with QueryPointsBuilder + client.query() as recommended by qdrant-client 1.17.0. The Query API returns correct scores (~0.53) for the same unit-normalized vectors. Also remove the l2_normalize workaround added in #3422 — it had no effect since Ollama embeddings are already unit-normalized (norm ≈ 1.0). Closes #3425
cff63e3 to
5fdc6ca
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
client.search_points(SearchPointsBuilder::new(...))withclient.query(QueryPointsBuilder::new(...))inQdrantOps::searchl2_normalizeworkaround added in fix(memory): normalize gRPC query vector to fix near-zero cosine scores #3422 — Ollama embeddings are already unit-normalized (norm ≈ 1.0), so it had no effectsearch_pointspath returned ~0.011 cosine scores; the newquery()API returns ~0.53 for the same vectorsRoot Cause
The deprecated legacy gRPC
search_pointspath does not handle cosine normalization correctly, producing near-zero scores. Thequery()API (recommended by qdrant-client 1.17.0) returns correct scores. All skill candidates were falling below the 0.20 injection threshold, so zero skills were injected per turn.Test Plan
cargo build -p zeph-memory— passescargo clippy -p zeph-memory -- -D warnings— zero warningscargo nextest run --workspace --lib --bins— 8593 tests passcargo run --features full -- --config .local/config/testing.toml, verify skill injection scores ≥ 0.3 in WARN logCloses #3425