Skip to main content

Weaviate

https://weaviate.io/

Maven Dependency


<dependency>
<groupId>dev.langchain4j</groupId>
<artifactId>langchain4j-weaviate</artifactId>
<version>0.36.2</version>
</dependency>

APIs

  • WeaviateEmbeddingStore

Usage

ParameterDescriptionRequired/Optional
apiKeyYour Weaviate API key. Not required for local deployment.Optional
schemeThe scheme, e.g. "https" of cluster URL. Find it under Details of your Weaviate cluster.Required
hostThe host, e.g. "langchain4j-4jw7ufd9.weaviate.network" of cluster URL. Find it under Details of your Weaviate cluster.Required
portThe port, e.g. 8080.Optional
objectClassThe object class you want to store, e.g. "MyGreatClass". Must start from an uppercase letter.Optional (default: Default)
avoidDupsIf true (default), then WeaviateEmbeddingStore will generate a hashed ID based on the provided text segment, which avoids duplicated entries in DB. If false, then a random ID will be generated.Optional (default: true)
consistencyLevelConsistency level: ONE, QUORUM (default) or ALL. Find more details here.Optional (default: QUORUM)
useGrpcForInsertsUse GRPC instead of HTTP for batch inserts only. You still need HTTP configured for search.Optional
securedGrpcThe GRPC connection is secured.Optional
grpcPortThe port, e.g. 50051.Optional
textFieldNameThe name of the field that contains the text of a TextSegment.Optional (default: text)
metadataFieldNameThe name of the field where Metadata entries are stored. If set to an empty string (""), Metadata entries will be stored in the root object. It is recommended to use metadataKeys if using root object.Optional (default: _metadata)
metadataKeysMetadata keys that should be persisted.Optional

Examples