GraphDB Logo
11.5
11.4 11.3 11.2 11.1 11.0 10.8 10.7 10.6 10.5 10.4 10.3 10.2 10.1 10.0 9.11 EE 9.11 SE 9.11 Free Other versions

Getting Started with GraphDB

  • What is GraphDB?
  • How to install GraphDB
  • Working with Workbench

Managing Repositories

  • Overview of repositories
  • Creating and editing repositories
  • Configuring a repository
  • Connecting to remote locations and data sources
  • Using plugins
  • Inferencing
  • Data storage
  • Monitoring and terminating queries and update requests
  • Accessing relational databases with data virtualization
  • Federation from multiple SPARQL endpoints with FedX
  • Graph replacement optimization
  • Managing repositories and locations via the GraphDB REST API

Loading and exploring data

  • Loading data
  • Updating data with SPARQL templates
  • Exploring your data
  • SPARQL queries
  • SPARQL plugins
  • Visualize and explore
  • Visualize geospatially linked data
  • GraphQL
  • GraphQL schemas and endpoint management
  • Semantic similarity searches
  • Querying GPT models
  • Talk to Your Graph
  • Graph path search
  • Reasoning
  • Exporting data

Working with connectors

  • Connecting to external components and services
  • General full-text search with the Connectors
  • Lucene GraphDB Connector
  • Solr GraphDB Connector
  • Elasticsearch GraphDB Connector
  • OpenSearch GraphDB Connector
  • Kafka GraphDB Connector
  • Kafka Sink Connector
  • ChatGPT Retrieval GraphDB Connector
  • MongoDB integration
  • Text mining plugin
  • Embedding model configuration for vector search
    • Using a local embedding model deployed with Graphwise Transformer
    • Using an OpenAI embedding model
    • Using an alternative model provider through the EmbeddingModel interface of langchain4j

Working with clusters

  • Overview of clusters
  • Creating and managing a cluster
  • Cluster states and election procedures
  • Using a cluster
  • Multi-region cluster deployments

Administration

  • Setting up your license
  • Security
  • Backup and restore
  • Monitoring and troubleshooting
  • Docker and Helm
  • Configuring GraphDB memory
  • Performance optimizations
  • Administration via HTTP with curl
  • Migrating GraphDB configurations
  • Migrating GraphQL configurations from Semantic Objects to GraphDB
  • How to deploy GraphDB in AWS
  • How to deploy GraphDB in Azure
  • How to deploy GraphDB in GCP
  • Using GraphDB’s LLM tools with external clients

Tutorials

  • Running the interactive user guides
  • GraphDB Fundamentals Video Series
  • Loading and querying data
  • GraphDB and W3C standards
  • Customization and other advanced development
  • Talk to Your Graph examples
  • Vector search in nested fields with Elasticsearch

Reference

  • Architecture and components
  • GraphDB command line tools
  • Directories and configuration properties
  • RDF formats
  • SPARQL compliance
  • SPARQL functions reference
  • SPARQL extensions reference
  • GraphDB APIs
  • OWL compliance
  • W3C specifications
  • Benchmarks
  • GraphDB system statements
  • Glossary
  • JavaScript functions

Help

  • FAQ
  • Support
  • Release notes
  • Vulnerabilities
You are viewing an older version of this document. For the latest, see version .
You are viewing an older version of the GraphDB documentation. For the latest, see .

Embedding model configuration for vector search¶

What’s in this document?

  • Using a local embedding model deployed with Graphwise Transformer

  • Using an OpenAI embedding model

  • Using an alternative model provider through the EmbeddingModel interface of langchain4j

Both Elasticsearch GraphDB Connector and OpenSearch GraphDB Connector support integrated vector search, which uses an embedding model to generate vectors and provide better recall than full-text search. You can use a variety of models to generate the embeddings, including OpenAI embedding models, Elasticsearch (when using Elasticsearch), or locally deployed models. Before you can create a connector instance with vector search capabilities, you need to first choose and configure the embedding model.

Note

This does not apply if you are using Elasticsearch to create the embeddings. Refer to the Elasticsearch documentation for more information on how to configure the creation of the embeddings in that scenario.

The Embedding Model Clients can also read a set of system properties configured through GraphDB. These properties can configured through GraphDB, but are described in the configuration section of the Embedding Model Clients project.

Using a local embedding model deployed with Graphwise Transformer¶

You can use a locally deployed model to generate the embeddings, allowing for advanced customization and increased security. In fact, GraphDB is distributed with a client for such a locally deployed Hugging Face transformer model, which can be deployed using the Graphwise Transformer tool.

The github page of the Graphwise Transformer provides thorough instructions on how to deploy the model using Graphwise Transformer.

Once you have deployed the model, when creating the connector instance you need to configure the embeddingModel parameter to com.ontotext.embeddings.GraphwiseTransformerClient. By default both the transformer and the client are configured with the sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2 model. To change the default model used by Graphwise Transformer:

  1. Set the default_model property in the config.properties file of the Graphwise Transformer to your <model_name>, as described in the configuration section of the Graphwise Transformer documentation.

  2. Set the GraphDB configuration property graphwise.transformer.embedding.model.name to <model_name> before starting GraphDB.

Note

The default model sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2 has a limit of 128 tokens. Text above that limit will be automatically truncated by the model. The Graphwise Transformer client will also truncate texts for embeddings larger than 4 megabytes because bigger documents will not fit GRPC limitations. If you have texts for embeddings bigger than these limitations, make sure you apply document chunking and create vector fields over the chunks of the documents.

Tip

If you are using a locally deployed embedding model, consider CUDA cards for faster generation. The model will automatically be placed on the most performant available device.

Using an OpenAI embedding model¶

You can also use an OpenAI embedding model to create the embeddings for vector search.

When using OpenAI to create the embeddings, the following GraphDB configuration properties must be configured prior to starting GraphDB:

  • openai.embedding.model.name — the name of the OpenAI model you want to use for the embeddings

  • openai.embedding.model.api.key — your OpenAI API key

  • openai.embedding.model.dimensions — the embedding model dimensions

Then, when creating the GraphDB Elasticsearch GraphDB Connector and OpenSearch GraphDB Connector, configure the embeddingModel property (or the Embedding model if using the GraphDB Workbench) to com.ontotext.embeddings.OpenAiEmbeddingModel.

Using an alternative model provider through the EmbeddingModel interface of langchain4j¶

You can use an alternative model provider by implementing the EmbeddingModel interface of langchain4j. To do so, package the implementation and all its dependencies and put it in the connector classpath (.../lib/plugins/elasticsearch-connector/).

When you create the connector in GraphDB, specify the fully classified class name of the implementation class in Java using the embedding model field of the connector.

Tip

You can base your solution on the examples in our Embedding Model clients project.


We are on Stack Overflow

stackoverflow logo
Get quick answers on technical questions from the community as well as Graphwise experts using the graphdb tag

Download documentation

  • PDF
  • ePUB

Contacts

  • Support · graphdb-support@graphwise.ai
  • Sales · sales@graphwise.ai
  • General · info@graphwise.ai

More info

  • About Graphwise
  • About Ontotext
  • Semantic web

Follow us


Copyright © 2015-2026, ONTOTEXT AD, doing business as Graphwise Graphwise | Privacy