Class VespaEmbeddingStore

java.lang.Object
dev.langchain4j.store.embedding.vespa.VespaEmbeddingStore
All Implemented Interfaces:
EmbeddingStore<TextSegment>

public class VespaEmbeddingStore extends Object implements EmbeddingStore<TextSegment>
Represents the Vespa - search engine and vector database. Does not support storing Metadata yet. Example server configuration contains cosine similarity search rank profile, of course other Vespa neighbor search methods are supported too. Read more here.
  • Constructor Details

    • VespaEmbeddingStore

      public VespaEmbeddingStore(String url, String keyPath, String certPath, Duration timeout, String namespace, String documentType, String clusterName, String rankProfile, Integer targetHits, Boolean avoidDups, Boolean logRequests, Boolean logResponses)
      Creates a new VespaEmbeddingStore instance.
      Parameters:
      url - server url, local or cloud one. The latter you can find under Endpoint of your Vespa application, e.g. https://alexey-heezer.langchain4j.mytenant346.aws-us-east-1c.dev.z.vespa-app.cloud/
      keyPath - local path to the SSL private key file in PEM format. Read docs for details. Null if there is no SSL private key file e.g. for local Vespa server.
      certPath - local path to the SSL certificate file in PEM format. Read docs for details. Null if there is no SSL certificate file e.g. for local Vespa server.
      timeout - for Vespa Java client in java.time.Duration format.
      namespace - required for document ID generation, find more details here.
      documentType - document type, used for document ID generation, find more details here and data querying
      clusterName - cluster name, used for deleting all documents, find more details here
      rankProfile - rank profile from your .sd schema. Provided example schema configures cosine similarity match
      targetHits - sets the number of hits (10 is default) exposed to the real Vespa's first-phase ranking function per content node, find more details here.
      avoidDups - if true (default), then VespaEmbeddingStore will generate a hashed ID based on provided text segment, which avoids duplicated entries in DB. If false, then random ID will be generated.
      logRequests - If true, requests to the Vespa service are logged.
      logResponses - If true, responses from the Vespa service are logged.
  • Method Details