Skip to content

[Bug]: QdrantVectorStore does not work with aclient and enable_hybrid #20002

@daradib

Description

@daradib

Bug Description

The QdrantVectorStore's __init__ method, when enable_hybrid is true, calls synchronous methods like get_default_sparse_doc_encoder and use_old_sparse_encoder. These methods, in turn, attempt to use self._client to check for collection existence. However, if only aclient is provided and url/api_key are not passed to the QdrantVectorStore constructor, self._client remains None, raising AttributeError.

Qdrant only supports one client accessing a storage folder, so it's not possible to instantiate a separate sync client in local mode.

A workaround (ignore support for old sparse encoder format):

QdrantVectorStore.use_old_sparse_encoder = lambda self, collection_name: False

Version

0.14.3

Steps to Reproduce

from llama_index.vector_stores.qdrant import QdrantVectorStore
from qdrant_client import AsyncQdrantClient


aclient = AsyncQdrantClient(path="...")
qdrant = QdrantVectorStore(aclient=aclient, collection_name="llamacollection", enable_hybrid=True, fastembed_sparse_model="Qdrant/bm25")

Relevant Logs/Tracbacks

AttributeError: 'NoneType' object has no attribute 'collection_exists'

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageIssue needs to be triaged/prioritized

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions