This section walks you through setting up the Qdrant VectorStore to store document embeddings and perform similarity searches.

Qdrant is an open-source, high-performance vector search engine/database.


  • Qdrant Instance: Set up a Qdrant instance by following the installation instructions in the Qdrant documentation.

  • If required, an API key for the EmbeddingClient to generate the embeddings stored by the QdrantVectorStore.

To set up QdrantVectorStore, you’ll need the following information from your Qdrant instance: Host, GRPC Port, Collection Name, and API Key (if required).

It is recommended that the Qdrant collection is created in advance with the appropriate dimensions and configurations. If the collection is not created, the QdrantVectorStore will attempt to create one using the Cosine similarity and the dimension of the configured EmbeddingClient.


Then add the Qdrant boot starter dependency to your project:


or to your Gradle build.gradle build file.

dependencies {
    implementation 'org.springframework.ai:spring-ai-qdrant-store-spring-boot-starter'

The Vector Store, also requires an EmbeddingClient instance to calculate embeddings for the documents. You can pick one of the available EmbeddingClient Implementations.

For example to use the OpenAI EmbeddingClient add the following dependency to your project:


or to your Gradle build.gradle build file.

dependencies {
    implementation 'org.springframework.ai:spring-ai-openai-spring-boot-starter'
Refer to the Dependency Management section to add the Spring AI BOM to your build file. Refer to the Repositories section to add Milestone and/or Snapshot Repositories to your build file.

To connect to Qdrant and use the QdrantVectorStore, you need to provide access details for your instance. A simple configuration can either be provided via Spring Boot’s application.properties,

spring.ai.vectorstore.qdrant.host=<host of your qdrant instance>
spring.ai.vectorstore.qdrant.port=<the GRPC port of your qdrant instance>
spring.ai.vectorstore.qdrant.api-key=<your api key>
spring.ai.vectorstore.qdrant.collection-name=<The name of the collection to use in Qdrant>

# API key if needed, e.g. OpenAI
Check the list of configuration parameters to learn about the default values and configuration options.

Now you can Auto-wire the Qdrant Vector Store in your application and use it

@Autowired VectorStore vectorStore;

// ...

List <Document> documents = List.of(
    new Document("Spring AI rocks!! Spring AI rocks!! Spring AI rocks!! Spring AI rocks!! Spring AI rocks!!", Map.of("meta1", "meta1")),
    new Document("The World is Big and Salvation Lurks Around the Corner"),
    new Document("You walk forward facing the past and you turn back toward the future.", Map.of("meta2", "meta2")));

// Add the documents to Qdrant

// Retrieve documents similar to a query
List<Document> results = vectorStore.similaritySearch(SearchRequest.query("Spring").withTopK(5));

Manual Configuration

Instead of using the Spring Boot auto-configuration, you can manually configure the QdrantVectorStore. For this you need to add the spring-ai-qdrant dependency to your project:


or to your Gradle build.gradle build file.

dependencies {
    implementation 'org.springframework.ai:spring-ai-qdrant'

To configure Qdrant in your application, you can use the following setup:

public QdrantVectorStoreConfig qdrantVectorStoreConfig() {

    return QdrantVectorStoreConfig.builder()

Integrate with OpenAI’s embeddings by adding the Spring Boot OpenAI starter to your project. This provides you with an implementation of the Embeddings client:

public VectorStore vectorStore(QdrantVectorStoreConfig config, EmbeddingClient embeddingClient) {
    return new QdrantVectorStore(config, embeddingClient);

Metadata filtering

You can leverage the generic, portable metadata filters with the Qdrant vector store.

For example, you can use either the text expression language:

    .withQuery("The World")
    .withFilterExpression("author in ['john', 'jill'] && article_type == 'blog'"));

or programmatically using the Filter.Expression DSL:

FilterExpressionBuilder b = new FilterExpressionBuilder();

    .withQuery("The World")
        b.in("john", "jill"),
        b.eq("article_type", "blog")).build()));
These filter expressions are converted into the equivalent Qdrant filters.

Configuration properties

You can use the following properties in your Spring Boot configuration to customize the Qdrant vector store.

Property Description Default value


The host of the Qdrant server.



The gRPC port of the Qdrant server.



The API key to use for authentication with the Qdrant server.



The name of the collection to use in Qdrant.



Whether to use TLS(HTTPS).