v25 Preview
The v25 release of Dgraph introduces new features and brings the full code base under the Apache-2.0 license, reducing barriers for teams of all sizes to choose Dgraph for AI-ready knowledge graphs.
Availability
As we prepare for the general availability, we’re making a set of preview releases available for use on Hypermode and locally. The fastest way to get started is to sign up for a free Hypermode account.
The run locally, use the Docker image dgraph/standalone:v25.0.0-preview4
.
Features
The following new features are currently available in the preview release:
- Namespaces – logically isolate environments for multi-customer apps
- v2 APIs – write less code with simplified client creation and DQL execution
- Model Context Protocol (MCP) Server – stay in flow by making your Dgraph schema and queries available to your AI coding assistants
Additionally, the following former enterprise features are available in the preview release with no license key required:
- Backups (formerly Binary Backups – non-S3 support has been dropped due to the deprecation of MinIO Gateway and is planned for a future release)
- Query Logs (formerly Audit Logs)
- Database Encryption (formerly Encryption at Rest)
- Learner Nodes
- Change Data Capture
Upcoming preview releases include a simplified import command and native user authentication and authorization (formerly Access Control Lists).
Namespaces
Namespaces allow you to create logically separated environments for your data, enabling multi-customer apps without the overhead of managing a database per customer.
The default namespace is created when the cluster is provisioned. It is named
root
.
Namespace APIs are part of the v2 APIs. The v2 APIs are available in
the dgo/v250
package today. Other SDKs are being updated currently.
Creating a new namespace
To create a namespace, use the CreateNamespace
function.
You can now pass this name to SetSchema
, RunDQL
or similar functions.
Dropping a namespace
To drop a namespace, use the DropNamespace
function.
Rename a namespace
To rename a namespace, use the RenameNamespace
function.
List all namespaces
To list all namespaces, use the ListNamespaces
function.
v2 APIs
Version 25 introduces support for v2 APIs, including simpler client creation and
DQL execution. The v2 APIs are available in the dgo/v250
package today. Other
clients are being updated currently.
Open a connection
The dgo package supports connecting to a Dgraph cluster using connection
strings. Dgraph connection strings take the form dgraph://host:port?arguments
with support for the following arguments:
Argument | Value | Description |
---|---|---|
bearertoken | <token> | an access token |
sslmode | disable require verify-ca | TLS option, the default is disable . If verify-ca is set, the TLS certificate configured in the Dgraph cluster must be from a valid certificate authority. |
To create a client, use the Open
function with a connection string.
Advanced client creation
For more control, you can create a client using the NewClient
function.
You can connect to multiple alphas using NewRoundRobinClient
.
Connect to Hypermode Graph
You can use either Open
or NewClient
to connect to a Hypermode Graph.
Hypermode automatically handles load balancing in multi-node clusters.
Using Open
with a connection string:
Using NewClient
:
Set schema
To set the schema, use the SetSchema
function.
Run a mutation
To run a mutation, use the RunDQL
function.
Run a query
To run a query, use the same RunDQL
function.
Run a query with variables
To run a query with variables, using RunDQLWithVars
.
Run a best effort query
To run a BestEffort
query, use the same RunDQL
function with TxnOption
.
Run a read-only query
To run a ReadOnly
query, use the same RunDQL
function with TxnOption
.
Run a query with RDF response
To get the query response in RDF format instead of JSON format, use the
following TxnOption
.
Run an upsert
The RunDQL
function also allows you to run upserts as well.
A conditional upsert can be run using the @if
directive.
Drop all data
In order to drop all data in the cluster and start fresh, use the
DropAllNamespaces
function.
Model Context Protocol (MCP) Server
The Model Context Protocol (MCP) is a standard for making tools, data, and prompts available to AI models. It can be especially useful in bringing context on your stack into coding assistants.
Version 25 of Dgraph introduces two MCP servers with common tools for AI coding assistants:
mcp
– a server that provides tools and data from your Dgraph clustermcp-ro
– a server that provides tools and data from your Dgraph cluster in read-only mode
Configuration
To add the MCP server to your coding assistant, add the following to your configuration file:
When using Hypermode Graphs, the MCP configuration is available on the graph details screen in the console.
Tools
The MCP servers provide the following tools:
Get-Schema
– fetch the schema of your clusterRun-Query
– run a query on your clusterRun-Mutation
– run a mutation on your clusterAlter-Schema
– modify the schema of your clusterGet-Common-Queries
– provides reference queries to aide in query syntax
Prompt
For clients that support prompts over the MCP protocol, a prompt is available to provide an introduction to the agent.
The full text of the prompt is available in the Dgraph repo.