Qdrant Store for Retrieval Augmented Generation (RAG)
When implementing Retrieval Augmented Generation (RAG), a robust document store is crucial. This guide demonstrates how to leverage a Qdrant database as the document store.
Leveraging the Qdrant Document Store
To make use of the Qdrant document store, you’ll need to include the following dependency:
<dependency>
<groupId>io.quarkiverse.langchain4j</groupId>
<artifactId>quarkus-langchain4j-qdrant</artifactId>
</dependency>
Configuration Settings
Customize the behavior of the extension by exploring various configuration options:
Configuration property fixed at build time - All other configuration properties are overridable at runtime
Configuration property |
Type |
Default |
---|---|---|
Whether Dev Services for Qdrant are enabled or not. Environment variable: |
boolean |
|
Container image for Qdrant. Environment variable: |
string |
|
Optional fixed port the Qdrant dev service will listen to. If not defined, the port will be chosen randomly. Environment variable: |
int |
|
Indicates if the Dev Service containers managed by Quarkus for Qdrant are shared. Environment variable: |
boolean |
|
Service label to apply to created Dev Services containers. Environment variable: |
string |
|
Distance function used for comparing vectors Environment variable: |
|
required |
Size of the vectors Environment variable: |
long |
|
The URL of the Qdrant server. Environment variable: |
string |
required |
The gRPC port of the Qdrant server. Defaults to 6334 Environment variable: |
int |
|
The Qdrant API key to authenticate with. Environment variable: |
string |
|
Whether to use TLS(HTTPS). Defaults to false. Environment variable: |
boolean |
|
The field name of the text segment in the payload. Defaults to "text_segment" Environment variable: |
string |
|
The name of the collection. Environment variable: |
string |
required |
Dev Services
To use the Qdrant Dev Services, 3 configuration properties are required:
-
quarkus.langchain4j.qdrant.devservices.service-name
which specifies the name of the collection to create -
quarkus.langchain4j.qdrant.devservices.collection.vector-params.distance
which specifies the distance function used for comparing vectors -
quarkus.langchain4j.qdrant.devservices.collection.vector-params.size
which specifies the size of the vectors.