Enhanced AI Capabilities with Vector Support & Optimized Caching Performance

We are thrilled to announce the general availability of Dgraph v24, which includes DQL and GraphQL support for Vector data type, HNSW vector indexes, and similarity search.

Adding embeddings, from OpenAI, Mistral, or open-source models, to your knowledge graph unlocks new AI capabilities and use cases, such as semantic search, entity resolution, recommendations, classification, or GraphRAG.

In addition to vector support, this release optimizes performance across the board. Thanks to our new focus internally and the extensive contributions from our vibrant community - 89 commits from 24 contributors - thank you!

Dgraph v24 includes:

  1. Refined Caching Mechanisms
  2. Native Vector Support
  3. Community Contributions

Refined Caching Mechanisms

Our new caching improvements significantly boost performance by focusing on storing large keys efficiently, reducing disk reads, and handling multiple transactions more effectively. Performance tests show a 32% improvement in writes. A separate change reducing over-fetching when filtering by types unlocks up to 1000x improvement in reads for customers with complex GraphQL schemas.

Native Vector Support

Dgraph v24 now supports native vector types, making it easier than ever to integrate advanced AI-driven search functionalities into your applications. Whether using DQL or GraphQL, you can now harness the power of semantic searches with vector embeddings directly within your queries.

Vectors in DQL

v24 extends DQL by introducing:

  • float32vector data type
  • hnsw index for float32vector data type supporting euclidian, cosine, and dotproduct metrics.
  • dot math function to compute the various distances on vectors.
  • similar_to query function.

Here is a simple DQL Schema using a vector:

<Issue.description>: string .
<Issue.vector_embedding>: float32vector @index(hnsw(metric:"euclidean")) .

type <Issue> {

Learn more about Using Vector similarity search in DQL

Vectors in GraphQL

v24 extends GraphQL by introducing:

  • @embedding directive to use a [Float!] predicate as a vector.
  • hnsw search directive to create hnsw indexes.
  • querySimilarbyID and querySimilarbyEmbedding: two auto-generated GraphQL queries to perform similarity search on entities having embeddings predicates.

Here is simple GraphQL Schema using a vector embedding:

type Project {
  id: ID!
  title: String! @id
  title_v: [Float!] @embedding @search(by: ["hnsw(metric: euclidean, exponent: 4)"])

Learn more about Using Vector similarity search in GraphQL

Community Contributions

This release wouldn’t be possible without the hard work of our community. As we mentioned above, it includes 89 commits from 24 different contributors. We are immensely grateful to everyone who has contributed to making this release a success and will continue to work through the submitted issues and feedback. Please contribute on GitHub or the Community forum.

Dgraph v24 is packed with features that enhance scalability and performance. We encourage you to upgrade and take advantage of these new capabilities. For more details, visit our documentation.