Closed harshil1973 closed 1 week ago
Hey @harshil1973! I'm here to help you with any issues or questions you have while waiting for a human maintainer. Let's tackle this bug together!
I found a similar closed issue that might help you resolve the AttributeError: 'NoneType' object has no attribute 'search'
error when using QueryFusionRetriever
with Qdrant DB. The error suggests that the _aclient
attribute in your QdrantVectorStore
class is None
, indicating that the asynchronous client was not properly initialized.
To address this issue, ensure that the QdrantVectorStore
instance is correctly initialized with either a valid client
or aclient
instance, or with the necessary parameters (url
, api_key
, and collection_name
) so the class can initialize its own client instances correctly.
Here is an example of how to properly initialize the QdrantVectorStore
:
from qdrant_client import QdrantClient, AsyncQdrantClient
from llama_index.vector_stores.qdrant import QdrantVectorStore
qdrant_vector_store = QdrantVectorStore(
collection_name="your_collection_name",
client=QdrantClient(url="your_qdrant_url", api_key="your_api_key"),
aclient=AsyncQdrantClient(url="your_qdrant_url", api_key="your_api_key")
)
Ensure that the QdrantClient
and AsyncQdrantClient
are properly initialized with the correct URL and API key. If you are using the :memory:
mode, note that the data between clients is not synced.
Additionally, you might want to add some debug statements to ensure that the _aclient
is being initialized correctly:
if self._aclient is None:
raise ValueError("Failed to initialize AsyncQdrantClient")
This will help you identify if the client is being set to None
and why.
For more details, you can refer to the relevant parts of the QdrantVectorStore
class initialization [1].
If these steps do not resolve the issue, please provide more information about how you are initializing the QdrantVectorStore
in your code.
To continue talking to Dosu, mention @dosu.
Pass in the async client as well
QdrantVectorStore(..., client=QdrantClient(..), aclient=AsyncQdrantClient(...))
@logan-markewich Is there any way I can use local vector database in both the clients like this cause it is giving error like Storage folder /kaggle/working/ is already accessed by another instance of Qdrant client. If you require concurrent access, use Qdrant server instead.
qdrant_client = QdrantClient(
path = "/kaggle/working/"
)
qdrant_aclient = AsyncQdrantClient(
"/kaggle/working/"
)
Not sure. Seems to be a limitation of qdrant (i always use the docker server image for qdrant and it works well)
Workaround would be using another vector db, using the docker image for the server, setting use_async=False in the retriever, or writing your own retriver that skips async vector store operations (would be fun to write this in a workflow actually)
I am closing this issue for now
Bug Description
This is my code,
Note that
dense_retriever
is working great withoutQueryFusionRetriever
. And this whole code is working forchromadb
also.Version
0.11.1
Steps to Reproduce
I have provided code for that
Relevant Logs/Tracbacks