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 |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 Environment variable: |
boolean |
|
The name of the Qdrant client to use. These clients are configured by means of the Environment variable: |
string |
|
The name of the Qdrant collection to use. Environment variable: |
string |
|
The field name of the text segment in the payload. Environment variable: |
string |
|
Type |
Default |
|
The name of the Qdrant client to use. These clients are configured by means of the Environment variable: |
string |
|
The name of the Qdrant collection to use. Environment variable: |
string |
|
The field name of the text segment in the payload. Environment variable: |
string |
|
Summary
To use Qdrant with Quarkus LangChain4j:
-
Add the
quarkus-langchain4j-qdrantextension -
Use Dev Services (automatic) or configure an external Qdrant instance via
quarkus.qdrant.* -
Set the collection name via
quarkus.langchain4j.qdrant.collection-name -
Inject
EmbeddingStore<TextSegment>and start ingesting and retrieving documents