You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implemented _remove_and_sync and _async_remove_and_sync — previously stubbed with a logger error, causing runtime failures when auto_sync tried to delete utterances
Added _point_ids_for_utterances helper that derives deterministic point UUIDs from route/utterance strings without a Qdrant round-trip (reuses the same uuid5 scheme as add())
Implemented _get_all and _async_get_all as the proper BaseIndex extension points, replacing inline scroll logic that was duplicated across get_utterances and aget_utterances
Simplified get_utterances and aget_utterances to thin wrappers over _get_all/_async_get_all, consistent with how PineconeIndex is structured
Added aget_routes (async) which was missing from QdrantIndex but required by the router sync flow
Fixed aget_utterances fallback: in-memory Qdrant (no aclient) now correctly falls back to the sync path via _get_all
Adds _point_ids_for_utterances to derive deterministic Qdrant point IDs using the same uuid5 scheme as insertion.
Implements _remove_and_sync and _async_remove_and_sync to delete selected utterances from Qdrant instead of logging an unimplemented error.
Introduces _get_all and _async_get_all shared scroll helpers with namespace filtering, empty-index handling, and sync fallback for missing async clients.
Refactors get_utterances, aget_utterances, get_routes_tuples, and aget_routes to return route/utterance tuples and metadata consistently.
ashraq1455
changed the title
fix: async errors and implement missing methods in QdrantIndex and
fix: Async errors and implement missing methods in QdrantIndex
May 18, 2026
Defaulting missing route or utterance payload fields to empty strings can create invalid Utterance objects that later sync or route operations may treat as real records. Filter out malformed payloads or fail explicitly; apply the same guard in aget_utterances.
return [
Utterance(
- route=p.get(SR_ROUTE_PAYLOAD_KEY, ""),- utterance=p.get(SR_UTTERANCE_PAYLOAD_KEY, ""),+ route=p[SR_ROUTE_PAYLOAD_KEY],+ utterance=p[SR_UTTERANCE_PAYLOAD_KEY],
function_schemas=None,
metadata=p.get("metadata", {}) if include_metadata else {},
)
for p in payloads
+ if SR_ROUTE_PAYLOAD_KEY in p and SR_UTTERANCE_PAYLOAD_KEY in p
]
Suggestion importance[1-10]: 5
__
Why: The suggestion correctly identifies that using empty-string defaults for missing SR_ROUTE_PAYLOAD_KEY or SR_UTTERANCE_PAYLOAD_KEY can create misleading Utterance records. This is a reasonable data-integrity improvement, though malformed payloads may be uncommon because records are expected to be written by this index implementation.
Low
Avoid blocking async fallback
Calling the synchronous delete path directly inside _async_remove_and_sync can block the event loop during network I/O. Run the sync fallback in a worker thread so async callers do not stall other tasks when aclient is unavailable.
Why: The suggestion is conceptually valid because calling _remove_and_sync directly inside _async_remove_and_sync may block the event loop when falling back to the sync client. Its impact is moderate and the improved code would also require asyncio to be available in the module.
Low
jamescalam
changed the title
fix: Async errors and implement missing methods in QdrantIndex
fix: async errors and implement missing methods in qdrantindex
May 18, 2026
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
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.
User description
Summary
_remove_and_syncand_async_remove_and_sync— previously stubbed with a logger error, causing runtime failures whenauto_synctried to delete utterances_point_ids_for_utteranceshelper that derives deterministic point UUIDs from route/utterance strings without a Qdrant round-trip (reuses the sameuuid5scheme asadd())_get_alland_async_get_allas the properBaseIndexextension points, replacing inline scroll logic that was duplicated acrossget_utterancesandaget_utterancesget_utterancesandaget_utterancesto thin wrappers over_get_all/_async_get_all, consistent with howPineconeIndexis structuredaget_routes(async) which was missing fromQdrantIndexbut required by the router sync flowaget_utterancesfallback: in-memory Qdrant (noaclient) now correctly falls back to the sync path via_get_allPR Type
Bug fix, Enhancement
Description
Implement Qdrant utterance deletion
Add shared sync/async scroll retrieval
Fix async route and utterance access
Preserve metadata inclusion behavior
Diagram Walkthrough
File Walkthrough
qdrant.py
Complete Qdrant deletion and retrieval APIssemantic_router/index/qdrant.py
_point_ids_for_utterancesto derive deterministic Qdrant pointIDs using the same
uuid5scheme as insertion._remove_and_syncand_async_remove_and_syncto deleteselected utterances from Qdrant instead of logging an unimplemented
error.
_get_alland_async_get_allshared scroll helpers withnamespace filtering, empty-index handling, and sync fallback for
missing async clients.
get_utterances,aget_utterances,get_routes_tuples, andaget_routesto return route/utterance tuples and metadataconsistently.