The upsert_available method in the Qdrant class currently inherits the default implementation from the VectorDb abstract base class, which returns False. However, Qdrant does support the upsert operation — both Qdrant.upsert / Qdrant.async_upsert are implemented in agno, and the underlying qdrant_client.QdrantClient.upsert / AsyncQdrantClient.upsert calls back this directly. So this method should return True to accurately reflect the capabilities of the underlying database.
This discrepancy can lead to:
- Misleading behavior: Code that relies on
upsert_available to check for upsert support will incorrectly assume that upsert is not available.
- Missed optimizations: Developers might avoid using upsert even though it is supported, leading to less efficient code.
Expected Behavior
The upsert_available method in the Qdrant class should return True because Qdrant supports the upsert operation.
Steps to Reproduce
Create an instance of the Qdrant class:
from agno.vectordb.qdrant import Qdrant
qdrant_db = Qdrant(collection="my_collection", url="http://localhost:6333")
Check the value of upsert_available:
print(qdrant_db.upsert_available()) # Output: False (incorrect)
Proposed Fix
Override the upsert_available method in the Qdrant class to return True:
def upsert_available(self) -> bool:
"""Check if upsert is available in Qdrant."""
return True
Additional Context
Qdrant's Python client supports the upsert operation, as confirmed by its documentation and source code. The agno Qdrant class already implements both upsert and async_upsert, and insert itself routes through client.upsert(...).
The current implementation of upsert_available in Qdrant does not reflect this capability, which is likely an oversight — exactly analogous to the ChromaDB issue fixed in #1698 / #1699.
Why This Matters
- Correctness: The
upsert_available method should accurately reflect the capabilities of the underlying database.
- Efficiency: Developers can use upsert to simplify their code and avoid unnecessary checks for document existence.
- Consistency: This fix ensures that the
Qdrant class behaves as expected when integrated with other parts of the framework — most notably, knowledge-base loading flows that batch-load PDFs from a folder rely on upsert_available() to dedupe; with the current value, documents get reinserted instead of upserted.
class Qdrant(VectorDb):
def upsert_available(self) -> bool:
"""Check if upsert is available in Qdrant."""
return True
The
upsert_availablemethod in theQdrantclass currently inherits the default implementation from theVectorDbabstract base class, which returnsFalse. However, Qdrant does support theupsertoperation — bothQdrant.upsert/Qdrant.async_upsertare implemented in agno, and the underlyingqdrant_client.QdrantClient.upsert/AsyncQdrantClient.upsertcalls back this directly. So this method should returnTrueto accurately reflect the capabilities of the underlying database.This discrepancy can lead to:
upsert_availableto check for upsert support will incorrectly assume that upsert is not available.Expected Behavior
The
upsert_availablemethod in theQdrantclass should returnTruebecause Qdrant supports the upsert operation.Steps to Reproduce
Create an instance of the
Qdrantclass:Check the value of
upsert_available:Proposed Fix
Override the
upsert_availablemethod in theQdrantclass to returnTrue:Additional Context
Qdrant's Python client supports the
upsertoperation, as confirmed by its documentation and source code. The agnoQdrantclass already implements bothupsertandasync_upsert, andinsertitself routes throughclient.upsert(...).The current implementation of
upsert_availableinQdrantdoes not reflect this capability, which is likely an oversight — exactly analogous to the ChromaDB issue fixed in #1698 / #1699.Why This Matters
upsert_availablemethod should accurately reflect the capabilities of the underlying database.Qdrantclass behaves as expected when integrated with other parts of the framework — most notably, knowledge-base loading flows that batch-load PDFs from a folder rely onupsert_available()to dedupe; with the current value, documents get reinserted instead of upserted.