Vector_store

This module contains functionality related to the the vector_store module for embedding.vector_stores.qdrant.

Vector_store

QdrantVectorStoreFactory

Bases: SingletonFactory

Factory for creating configured Qdrant vector store instances using the Singleton pattern.

Source code in src/embedding/vector_stores/qdrant/vector_store.py
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
class QdrantVectorStoreFactory(SingletonFactory):
    """Factory for creating configured Qdrant vector store instances using the Singleton pattern."""

    _configuration_class: Type = QDrantVectorStoreConfiguration

    @classmethod
    def _create_instance(
        cls, configuration: QDrantVectorStoreConfiguration
    ) -> QdrantVectorStore:
        """Creates a Qdrant vector store based on provided configuration.

        This method instantiates a Qdrant client using the QdrantClientFactory
        and uses it to create a QdrantVectorStore instance with the specified
        collection name from the configuration.

        Args:
            configuration: QDrant connection configuration containing
                           connection parameters and collection name.

        Returns:
            QdrantVectorStore: Configured vector store instance ready for
                              embedding storage and retrieval operations.
        """
        client = QdrantClientFactory.create(configuration)
        return QdrantVectorStore(
            client=client, collection_name=configuration.collection_name
        )