Qdrant Embedding Store

Qdrant is an open-source vector database for embedding-based search. The quarkus-langchain4j-qdrant extension allows you to use Qdrant as an embedding store for Retrieval-Augmented Generation (RAG) with Quarkus LangChain4j.

Dependency

To enable Qdrant integration, add the following dependency to your Quarkus project:

<dependency>
  <groupId>io.quarkiverse.langchain4j</groupId>
  <artifactId>quarkus-langchain4j-qdrant</artifactId>
  <version>1.12.0</version>
</dependency>

Even better, if you use the Quarkus platform BOM (default for projects generated), add the Quarkus Langchain4J BOM and all dependency versions will align:

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>${quarkus.platform.group-id}</groupId>
                <artifactId>${quarkus.platform.artifact-id}</artifactId>
                <version>${quarkus.platform.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>${quarkus.platform.group-id}</groupId>
                <artifactId>quarkus-langchain4j-bom</artifactId> (1)
                <version>${quarkus.platform.version}</version> (2)
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
      <dependency>
        <groupId>io.quarkiverse.langchain4j</groupId>
        <artifactId>quarkus-langchain4j-qdrant</artifactId>
        (3)
      </dependency>
    </dependencies>
1 In your dependencyManagement section, add the quarkus-langchain4j-bom
2 Inherit the version from your platform version
3 VoilĂ , no need for version alignment anymore

Dev Services Support

Dev Services for Qdrant are provided by the quarkus-qdrant extension, which is pulled in transitively. In dev and test modes, a containerized Qdrant instance is automatically started.

You can pre-create collections at startup via dev services configuration:

# Pre-create a collection (name is the map key)
quarkus.qdrant.devservices.collections.my-collection.vector-size=384
quarkus.qdrant.devservices.collections.my-collection.distance=Cosine
The vector size must match the output dimension of your embedding model (e.g., 384 for all-MiniLM-L6-v2, 1536 for OpenAI text-embedding-ada-002).

Migrating from 1.12.x and earlier

Prior to 1.13.x, this extension used the langchain4j gRPC client and exposed connection settings under the quarkus.langchain4j.qdrant.* namespace. These properties no longer exist. Connection to Qdrant is now handled by the quarkus-qdrant extension using its own namespace.

Old property Replacement

quarkus.langchain4j.qdrant.host

quarkus.qdrant.host

quarkus.langchain4j.qdrant.port

quarkus.qdrant.port

quarkus.langchain4j.qdrant.api-key

quarkus.qdrant.api-key

quarkus.langchain4j.qdrant.use-tls

quarkus.qdrant.use-tls

quarkus.langchain4j.qdrant.collection.name

quarkus.langchain4j.qdrant.collection-name

quarkus.langchain4j.qdrant.devservices.enabled

quarkus.qdrant.devservices.enabled

quarkus.langchain4j.qdrant.devservices.qdrant-image-name

quarkus.qdrant.devservices.image-name

quarkus.langchain4j.qdrant.devservices.port

quarkus.qdrant.devservices.port

quarkus.langchain4j.qdrant.devservices.shared

quarkus.qdrant.devservices.shared

quarkus.langchain4j.qdrant.devservices.service-name

quarkus.qdrant.devservices.service-name

quarkus.langchain4j.qdrant.devservices.collection.vector-params.size

quarkus.qdrant.devservices.collections.<name>.vector-size

quarkus.langchain4j.qdrant.devservices.collection.vector-params.distance

quarkus.qdrant.devservices.collections.<name>.distance

The default port changed from 6334 (gRPC) to 6333 (REST). Update or remove any explicit port configuration.
Per-store connection settings (host, port, api-key) are now handled by the quarkus-qdrant extension via the client-name property (see Per-store Qdrant client).

Named Stores

You can configure multiple named Qdrant stores, each using a different collection. This is useful when your application needs to manage embeddings for different domains or tenants in separate collections.

To configure a named store:

quarkus.langchain4j.qdrant.products.collection-name=product_embeddings

To inject a named store, use the @EmbeddingStoreName qualifier:

@Inject
@EmbeddingStoreName("products")
EmbeddingStore<TextSegment> productsStore;

The default store and named stores can coexist. If you only need named stores, disable the default store:

quarkus.langchain4j.qdrant.default-store-enabled=false

Per-store Qdrant client

Individual stores can point to different Qdrant instances via the client-name property, which references a named client from the quarkus-qdrant extension:

# Default Qdrant client
quarkus.qdrant.host=qdrant-primary
quarkus.qdrant.port=6333

# A second Qdrant client named "secondary"
quarkus.qdrant."secondary".host=qdrant-secondary
quarkus.qdrant."secondary".port=6333

# Default store uses the default client (no client-name needed)
quarkus.langchain4j.qdrant.collection-name=documents

# Named store uses the secondary client
quarkus.langchain4j.qdrant.products.collection-name=product_embeddings
quarkus.langchain4j.qdrant.products.client-name=secondary
Only distance=Cosine collections produce correct relevance scores. Other distance metrics are not supported.

Configuration

The Qdrant extension can be configured using the following options:

Configuration property fixed at build time - All other configuration properties are overridable at runtime

Configuration property

Type

Default

Whether the default (unnamed) Qdrant embedding store should be enabled. Set to false when you only want to use named stores.

Environment variable: QUARKUS_LANGCHAIN4J_QDRANT_DEFAULT_STORE_ENABLED

boolean

true

The name of the Qdrant client to use. These clients are configured by means of the quarkus-qdrant extension. If not set, the default Qdrant client will be used.

Environment variable: QUARKUS_LANGCHAIN4J_QDRANT_CLIENT_NAME

string

The name of the Qdrant collection to use.

Environment variable: QUARKUS_LANGCHAIN4J_QDRANT_COLLECTION_NAME

string

The field name of the text segment in the payload.

Environment variable: QUARKUS_LANGCHAIN4J_QDRANT_PAYLOAD_TEXT_KEY

string

text_segment

Named store configurations

Type

Default

The name of the Qdrant client to use. These clients are configured by means of the quarkus-qdrant extension. If not set, the default Qdrant client will be used.

Environment variable: QUARKUS_LANGCHAIN4J_QDRANT__STORE_NAME__CLIENT_NAME

string

The name of the Qdrant collection to use.

Environment variable: QUARKUS_LANGCHAIN4J_QDRANT__STORE_NAME__COLLECTION_NAME

string

The field name of the text segment in the payload.

Environment variable: QUARKUS_LANGCHAIN4J_QDRANT__STORE_NAME__PAYLOAD_TEXT_KEY

string

text_segment

Summary

To use Qdrant with Quarkus LangChain4j:

  1. Add the quarkus-langchain4j-qdrant extension

  2. Use Dev Services (automatic) or configure an external Qdrant instance via quarkus.qdrant.*

  3. Set the collection name via quarkus.langchain4j.qdrant.collection-name

  4. Inject EmbeddingStore<TextSegment> and start ingesting and retrieving documents