A .NET client for Relate by Neo4j, the open-source embedded Cypher graph database built for AI agents. The engine runs inside your process: there is no server, container or credentials to manage. Open :memory: for a scratch graph, or a single .rl file you can commit to a repo. Full documentation lives at relate.ambystech.io.
Install
dotnet add package Ambystech.Relate
| Package | Relate engine | C ABI |
|---|---|---|
| 0.1.x | 1.0.2 | v2 |
Quick start
using Ambystech.Relate;
using var db = RelateDatabase.Open("./team.rl"); // or RelateDatabase.Open() for :memory:
db.Run("""
CREATE (ada:Person {name: 'Ada'}), (relate:Project {name: 'relate'}),
(ada)-[:WORKS_ON {since: 2024}]->(relate)
""");
var result = db.Run(
"MATCH (p:Person)-[w:WORKS_ON]->(:Project {name: $project}) RETURN p.name AS name, w.since AS since",
new { project = "relate" });
foreach (var row in result)
{
Console.WriteLine($"{row["name"]} since {row.Get<int>("since")}");
}
Features
- Driver-style API —
RelateDatabase,RelateSession,RelateTransaction, typed records and rich graph values (nodes, relationships, paths, temporals, points, durations, vectors) - ADO.NET provider —
RelateDbConnection,RelateDbCommand,RelateDbDataReaderand aDbProviderFactory - Vector search plus traversal —
SEARCHand graph traversal in the same Cypher statement, for agent memory - Bundled engine — the native library ships in the package for
win-x64,linux-x64,linux-arm64,osx-x64andosx-arm64 - Modern .NET — targets
net8.0andnet10.0, source-generated interop, trimming- and AOT-annotated
Community package by Ambystech. Not affiliated with or endorsed by Neo4j, Inc. Relate is Apache-2.0 software by Neo4j.