Class QdrantVectorStore

java.lang.Object
org.springframework.ai.vectorstore.qdrant.QdrantVectorStore
All Implemented Interfaces:
Consumer<List<Document>>, DocumentWriter, VectorStore, org.springframework.beans.factory.InitializingBean

public class QdrantVectorStore extends Object implements VectorStore, org.springframework.beans.factory.InitializingBean
Qdrant vectorStore implementation. This store supports creating, updating, deleting, and similarity searching of documents in a Qdrant collection.
Since:
0.8.1
Author:
Anush Shetty, Christian Tzolov
  • Constructor Details

    • QdrantVectorStore

      public QdrantVectorStore(QdrantVectorStore.QdrantVectorStoreConfig config, EmbeddingClient embeddingClient)
      Constructs a new QdrantVectorStore.
      Parameters:
      config - The configuration for the store.
      embeddingClient - The client for embedding operations.
    • QdrantVectorStore

      public QdrantVectorStore(io.qdrant.client.QdrantClient qdrantClient, String collectionName, EmbeddingClient embeddingClient)
      Constructs a new QdrantVectorStore.
      Parameters:
      qdrantClient - A QdrantClient instance for interfacing with Qdrant.
      collectionName - The name of the collection to use in Qdrant.
      embeddingClient - The client for embedding operations.
  • Method Details

    • add

      public void add(List<Document> documents)
      Adds a list of documents to the vector store.
      Specified by:
      add in interface VectorStore
      Parameters:
      documents - The list of documents to be added.
    • delete

      public Optional<Boolean> delete(List<String> documentIds)
      Deletes a list of documents by their IDs.
      Specified by:
      delete in interface VectorStore
      Parameters:
      documentIds - The list of document IDs to be deleted.
      Returns:
      An optional boolean indicating the deletion status.
    • similaritySearch

      public List<Document> similaritySearch(SearchRequest request)
      Performs a similarity search on the vector store.
      Specified by:
      similaritySearch in interface VectorStore
      Parameters:
      request - The SearchRequest object containing the query and other search parameters.
      Returns:
      A list of documents that are similar to the query.
    • afterPropertiesSet

      public void afterPropertiesSet() throws Exception
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      Throws:
      Exception