relate is a free, open source databases project written in Rust and released under Apache-2.0. It has 572 GitHub stars, 60 forks and 17 open issues, and was last pushed 16 hours ago. On this registry it ranks #206 of 209 tracked projects in Databases, with 5 head-to-head comparisons available. It gained 66 stars over the last 5 tracked days.

What is relate?

Relate is an embedded, in-memory property-graph database written in Rust that queries in Cypher 25 and ships as a single binary, aimed at developers and AI agents who need graph storage without operating a database server.

What it is

Relate is an embedded property-graph engine written in Rust, distributed as the relate command-line tool and accompanied by bindings for Python, Node.js, the browser through WebAssembly, and a Rust crate. A graph can live as a single .rl file, as a markdown folder, or purely in process memory, with durability provided by an fsync'd write-ahead log and Parquet checkpoints. The same engine also backs an optional one-process server that speaks Bolt, HTTP, and MCP, so a local graph can be reached by clients that expect a network endpoint.

The problem it solves is the operational weight of a graph database for workloads that do not need a cluster. Rather than standing up and administering a graph server, a developer installs one binary and runs Cypher against a directory or an in-memory store; from Python the query executes in-process through a native PyO3 extension module, with no server and no subprocess. The repository treats this as deliberate scope rather than a gap: the working set fits in memory, there is one graph per store, and there is a single user or agent per process.

Key capabilities

  • Cypher 25 queries through the relate CLI, both as one-shot commands such as relate "RETURN 1 + 2 AS sum" and in an interactive shell opened with relate query -d ./friends.
  • Three storage shapes for one engine: a single .rl file, a markdown folder, or a pure in-memory database, made durable by an fsync'd write-ahead log and Parquet checkpoints.
  • Script-friendly --json output that returns data alongside a planCache field and a timings block, as shown in the README's worked example.
  • Multi-statement scripts in a single invocation, including variable-length traversals such as MATCH (:Person {name: 'Alice'})-[:KNOWS]->+(p) RETURN p.name.
  • The same engine exposed through the relate-db Python package, Node.js and browser (WASM) npm packages, and a Rust crate.
  • An optional one-process server speaking Bolt, HTTP, and MCP for clients that cannot embed the engine directly.
  • relate skill install, which gives detected coding agents — Claude Code, Cursor, Codex, Gemini CLI, Copilot among them — the CLI flags, the Cypher dialect, and the gotchas, with relate upgrade keeping that skill current.

Who uses it and how

  • Agent and LLM tooling, reflected in the agent-memory, agentic-ai, and agent-sandbox-tools topics, where one process hosts a single agent and a single graph.
  • Python data work named in the README — scripts, Jupyter notebooks, Streamlit apps, and web backends — where queries run in-process instead of over a socket.
  • Browser and Node.js applications that embed the WASM package rather than calling a remote graph service.
  • Shell automation that consumes relate --json output from a checked-out .rl file or markdown folder, and deployments that need a Bolt, HTTP, or MCP endpoint without a separate database tier.

Getting started

On macOS and Linux, run curl -sSfL https://relatedb.ai/install.sh | bash; on Windows, run irm https://relatedb.ai/install.ps1 | iex. Python users can pip install relate-db and open a store with relate.connect(":memory:"), while Homebrew, npm, the Rust crate, and direct downloads are documented as alternatives.

How it compares

Relate is the embedded counterpart to the Neo4j-style tools named in its topics: its query surface is Cypher 25 and its optional server speaks Bolt, but a graph is a .rl file or an in-memory store rather than a separately administered service. That puts it with the local, in-process option instead of with server-hosted graph databases that assume a dedicated database tier.

When to use it — and when not to

Choose Relate when the working set fits in memory, one graph per store is sufficient, and a single user or agent per process matches the application. Do not choose it as a larger-than-memory warehouse, an analytics engine, or a multi-tenant server, which the project's own docs/limitations.md explicitly rules out as deliberate scope. That document is the right first read before committing, because its boundaries are design decisions rather than pending work.

project readme (upstream, from github) — read inline

Relate

A graph database in a single binary — query it in Cypher, embed it anywhere, deploy nothing.

Relate is an embedded, in-memory property-graph engine written in Rust, with a CLI for interactive and scripted queries. A graph is a single .rl file, a (markdown) folder, or pure in-memory — durable through a fsync'd write-ahead log and Parquet checkpoints. The same engine powers the relate CLI, a Python package, Node.js and browser (WASM) npm packages, a Rust crate, and an optional one-process server speaking Bolt, HTTP, and MCP. No server to babysit, no infrastructure to operate.

📖 Documentation: relatedb.ai — tutorials, guides, and the CLI / Cypher / Rust / C API references. The deep references live in docs/ in this repository, and the honest list of what Relate does not do is docs/limitations.md. Several entries there are deliberate scope, not missing features: the working set fits in memory, one graph per store, a single user or agent per process — Relate is not a larger-than-memory warehouse, an analytics engine, or a multi-tenant server.

Install

macOS & Linux:

curl -sSfL https://relatedb.ai/install.sh | bash
relate skill install    # optional: teach your AI coding agents to drive relate

If relate is not found afterwards, add ~/.local/bin to your PATH — the installer prints the line to use.

Windows (PowerShell):

irm https://relatedb.ai/install.ps1 | iex
relate skill install    # optional: teach your AI coding agents to drive relate

The skill gives every detected agent (Claude Code, Cursor, Codex, Gemini CLI, Copilot, …) the CLI flags, the Cypher dialect and the gotchas; relate upgrade keeps it current — Agent skill.

Homebrew, Python, npm, Rust, direct downloads, and how every download is verified: Other install options.

Quick start

Copy the whole block into a terminal — outputs are the # lines.

# A one-shot query on an in-memory database
relate "RETURN 1 + 2 AS sum"

# +-----+
# | sum |
# +-----+
# | 3   |
# +-----+

# Create a small graph in a store (a directory; name it friends.rl for one file)
relate -d ./friends "CREATE (:Person {name: 'Alice'})-[:KNOWS]->(:Person {name: 'Bob'})-[:KNOWS]->(:Person {name: 'Charlie'})"

# Script-friendly JSON: whom does Alice know?
relate --json -d ./friends "MATCH p = (:Person {name: 'Alice'})-[:KNOWS]->() RETURN p"

# {"data": [{"p": [
#   {"id": 0, "kind": "node", "labels": ["Person"], "properties": {"name": "Alice"}},
#   {"end_node": 1, "id": 0, "kind": "relationship", "properties": {}, "start_node": 0, "type": "KNOWS"},
#   {"id": 1, "kind": "node", "labels": ["Person"], "properties": {"name": "Bob"}}
# ]}], "planCache": "miss", "timings": {…}}

# Several statements at once: give Charlie a friend, then ask who Alice can reach
relate -d ./friends "
MATCH (c:Person {name: 'Charlie'}) CREATE (c)-[:KNOWS {since: 2024}]->(:Person {name: 'Dana'});
MATCH (:Person {name: 'Alice'})-[:KNOWS]->+(p) RETURN p.name AS reachable ORDER BY reachable;
"

# +-----------+
# | reachable |
# +-----------+
# | "Bob"     |
# | "Charlie" |
# | "Dana"    |
# +-----------+

# Explore the same store in the interactive shell (end statements with ;  .quit to exit)
relate query -d ./friends

# cypher>

Python and JavaScript

Python

Queries execute in-process — a native extension module (PyO3), no server, no subprocess — so it runs wherever Python does: scripts, Jupyter notebooks, Streamlit apps, web backends, or an agent's tool code:

# pip install relate-db
import relate

db = relate.connect(":memory:")   # or "./friends" — a directory or .rl file

db.execute("CREATE (p:Person {name: $name, age: $age})", {"name": "Alice", "age": 30})
db.execute("CREATE (p:Person {name: $name, age: $age})", {"name": "Bob", "age": 28})
db.execute(
    "MATCH (a:Person {name: 'Alice'}), (b:Person {name: 'Bob'}) "
    "CREATE (a)-[:FRIENDS_WITH {since: 2020}]->(b)"
)

for row in db.execute("MATCH (p:Person)-[:FRIENDS_WITH]->(f) RETURN p.name, f.name"):
    print(f"{row['p.name']} -> {row['f.name']}")   # Alice -> Bob

Draw a result as an interactive graph:

# pip install neo4j-viz
from relate.viz import to_visualization_graph

graph = to_visualization_graph(db.execute("MATCH p = ()-[:FRIENDS_WITH]->() RETURN p"))
graph.render()  # an interactive graph in Jupyter

A native Database class adds execute_arrow() — the result as Arrow IPC stream bytes (one serialized conversion from engine rows) for pandas or Polars. Spec: docs/api/python/; runnable example: examples/python/python_demo.py.

Node.js

// npm install @relate/relate   (or: pnpm add / yarn add @relate/relate)
const { Database } = require("@relate/relate");

const db = Database.open("./friends");        // or ":memory:"
const result = db.connect().query("MATCH (p:Person) RETURN p.name");

result.rows;                   // [{ "p.name": "Alice" }, ...]
result.stats;                  // mutation counters, zeros included
result.consume().elapsedMs;    // engine-reported milliseconds

Node 18+; the native library arrives via platform optional-dependencies — no install scripts. Spec: docs/api/javascript/.

Markdown mode

A graph can live in a folder of markdown notes: every node is a note, every relationship a [[wikilink]] in its frontmatter, and the property you name with --markdown-body-properties (default body) is the note's text. Open the folder in Obsidian, edit it in any editor, diff it in git — and query it with Cypher.

relate -d ./story --snapshot-format markdown --markdown-body-properties text "CREATE (:Mascot {name: 'Archie', text: 'Archie guards the graph and never forgets a relationship.'})-[:LOVES]->(:Database {name: 'Relate', text: 'A graph database in a single binary.'})"

head story/*/*.md

# ==> story/Database/index.md <==
# # Database
#
# - [[Database/Relate]]
#
# ==> story/Database/Relate.md <==
# ---
# type: Database
# name: Relate
# ---
#
# A graph database in a single binary.
#
# ==> story/Mascot/Archie.md <==
# ---
# type: Mascot
# name: Archie
# LOVES:
#   - "[[Database/Relate]]"
# ---
#
# Archie guards the graph and never forgets a relationship.
#
# ==> story/Mascot/index.md <==
# # Mascot
#
# - [[Mascot/Archie]]

# Query it again — no flags needed, the folder remembers them
relate -d ./story "MATCH (m:Mascot)-[:LOVES]->(d) RETURN m.name, d.name, m.text"

# +----------+----------+-------------------------------------------------------------+
# | m.name   | d.name   | m.text                                                      |
# +----------+----------+-------------------------------------------------------------+
# | "Archie" | "Relate" | "Archie guards the graph and never forgets a relationship." |
# +----------+----------+-------------------------------------------------------------+

An existing vault of /.md notes opens the same way: the vault guide.

Relate Features

Area What it covers
Cypher Reading and writing (MATCH, OPTIONAL MATCH, CREATE, MERGE, SET, REMOVE, DELETE, FOREACH, INSERT), composing (WITH, UNWIND, UNION, CALL {} subqueries, subquery expressions), schema DDL (indexes, constraints, graph types), 80+ built-in functions, and modern pattern matching — label expressions, quantified path patterns, path selectors. One dialect: current Cypher.
Language floor The openCypher TCK is the dialect floor, measured by the project's spec harness: Neo4j's Cypher suites — the upstream TCK among them — run against the engine's Python wheel on every ready PR, as reported coverage plus the ADR-0661 regression gate (a scenario main does not already carry as failing is red). History: docs/tck/compliance.md.
Vector search vector() properties, vector.similarity.* scoring functions, CREATE VECTOR INDEX plus the SEARCH clause for index-backed top-K with pre-filtering, and hybrid vector + full-text queries.
Geospatial WGS-84 and Cartesian points (2D/3D), point.distance(), radius and bounding-box predicates (point.withinBBox), and R-tree point indexes (CREATE POINT INDEX). The dialect covers points only — richer geometry is host-language work.
Profiling EXPLAIN renders the plan tree; PROFILE adds per-operator rows and time. Profiling costs nothing on non-PROFILE runs.
CLI shell Interactive REPL with readline-style editing, dot-commands, output modes table, csv, json, jsonl, markdown, cypher.
Import / sync LOAD CSV directly in Cypher; --fetch-params binds a fetched URL/file JSON document as a parameter; pull/push mirror subgraphs between Relate and a Neo4j/Aura instance; clone copies a whole store across layouts — directory ↔ .rl bundle, optionally transcoding the snapshot codec.
Read-only & follow --read-only opens an existing store without writing or checkpointing; --read-only=live follows a native directory's WAL while another process writes it. The same access modes — snapshot and live freshness — ride serve and the Rust API (OpenMode::ReadOnly / Follow, ADR-0136).
Surfaces Rust crate, Python + Arrow IPC, JS/Java/Go/Swift over the typed C ABI, Bolt, HTTP, MCP, WASM.

Task guides — vector similarity, geospatial, CSV import, backup/restore, storage — live in docs/guides/; tested, runnable recipes for most of the above are in the cookbook.

Server — Bolt, HTTP, MCP

When you want a socket instead of a library:

relate serve --database ./friends --bolt 7687 --http 7474 --mcp 7475

One process, one store, one generated token (printed at startup): Neo4j drivers connect over Bolt — neo4j-browser works out of the box — the HTTP Query API v2 serves JSON, and MCP (streamable HTTP) serves AI hosts. Binds loopback by default; runs until SIGINT/SIGTERM. Specs: bolt, http, mcp.

Other languages

Rust

relate::Database is the engine's public API — the surface every other binding wraps:

use relate::Database;

fn main() -> relate::Result<()> {
    let db = Database::open("./friends")?;
    let mut conn = db.connect()?;

    conn.query("CREATE (n:Person {name: 'Ada'})")?;
    let result = conn.query("MATCH (n:Person) RETURN n.name AS name")?;
    println!("{}", result.rows[0][0]); // Ada
    Ok(())
}

Explicit transactions, cancellation tokens, and read-only, follow, and ephemeral opens. Spec: docs/api/rust/.

C

Every language client wraps one typed C ABI — version 2, additive-only after the first public release:

#include "relate.h"

relate_database db = NULL;
relate_connection conn = NULL;
relate_query_result r = NULL;
char *err = NULL;            /* out-param errors: start NULL */

relate_database_open(":memory:", &db, &err);
relate_connect_namespace(db, NULL, &conn, &err);
relate_query_params(conn, "RETURN 1 AS n", NULL, &r, &err);

The header and library (librelate_ffi, static or shared) ship as relate-ffi-.tar.gz on the releases page; every fallible call reports through one typed error channel. Contract: docs/api/c/.

Java

ai.relatedb:relate on Maven Central — Java 17+, JNA over the C ABI, with the native library bundled in the jar (one fat jar, or one of five platform classifiers). The quickest try is a JBang script — save it as Hello.java and run jbang Hello.java:

///usr/bin/env jbang "$0" "$@" ; exit $?
//DEPS ai.relatedb:relate:1.3.1
//RUNTIME_OPTIONS --enable-native-access=ALL-UNNAMED

import ai.relatedb.Database;

class Hello {
    public static void main(String... args) {
        try (Database db = Database.open("./friends");
             Database.Connection conn = db.connect()) {
            conn.query("CREATE (:Person {name: 'Alice'})-[:KNOWS]->(:Person {name: 'Bob'})");
            Database.Result result = conn.query(
                "MATCH (a:Person)-[:KNOWS]->(b) RETURN a.name AS from, b.name AS to");
            System.out.println(result.columns() + " " + result.rows());
            // [from, to] [[Alice, Bob]]
        }
    }
}

result.columns() is a List, result.rows() a List> of typed values. Spec: docs/api/java/.

Go

Module github.com/relatedb/relate/clients/go, cgo against librelate_ffi (from the release tarballs, or built with cargo build --release -p relate-ffi):

db, err := relate.Open("./friends")
conn, err := db.Connect()
result, err := conn.Query("MATCH (p:Person) RETURN p.name")
// result.Columns []string, result.Rows [][]any

Spec: docs/api/go/.

.NET

C#, F# and Visual Basic via Relate.Net (.NET 8+), over the typed C ABI. The adopted client lives under clients/dotnet, with typed parameters, graph values, transactions and result metadata. Build the native library from this checkout, then reference the managed project. See the API specification and runnable example.

Swift

A SwiftPM package (iOS 16+ / macOS 13+, Swift 6) wrapping the C ABI, with the checksummed binary framework attached to every release:

// Package.swift of a consumer
.package(url: "https://github.com/relatedb/relate", from: "<release>")
// target dependency
.product(name: "Relate", package: "relate")
let db = try Database(path: "./friends")
let conn = try db.connect()
let result = try conn.query("MATCH (p:Person) RETURN p.name")

Spec: docs/api/swift/.

Browser (WASM)

The engine compiled to WebAssembly — run Cypher in a page, no server:

// npm install @relate/relate-wasm   (or: pnpm add / yarn add @relate/relate-wasm)
import init, { RelateDb } from "@relate/relate-wasm";

await init();

const db = new RelateDb();                    // in-memory
const result = JSON.parse(db.execute("RETURN 1 AS n", null));

Durable browser storage via OPFS: await RelateDb.open("opfs://graph") — runs in a dedicated worker only. Spec: docs/api/wasm/.

CLI reference

Commands

Exit-after lifecycle verbs are positional commands; everything else configures a query-engine run:

Command What it does
query [STATEMENT] Interactive shell, or one-shot/stdin queries (the default surface)
skill install|remove Install / remove the agent-skill bundle
upgrade Self-update the binary (alias: update)
serve Host Bolt + HTTP + MCP on one store until SIGINT/SIGTERM
pull / push Mirror a subgraph from / into a Neo4j/Aura remote (Query API v2)
clone SOURCE DEST Copy a database into a new store and exit — directory ↔ .rl on either side, --to-snapshot-format to transcode the codec
extension init|install|list|remove|check, run Mount and dispatch extension commands
telemetry on|off|status Telemetry controls
info Store metadata (cold read, no open)
# pull a subgraph from Neo4j/Aura into a local mirror:
relate pull --from neo4j.env --query "MATCH (o:Organization)-[r]-() RETURN o, r LIMIT 500" --database ./mirror

# copy a store into a single-file bundle (backup, transfer):
relate clone ./friends ./friends-backup.rl

Common flags

Flag What it does
-d, --database PATH Store target: a directory, .rl file, or :memory: (default)
-c, --command Q One-shot query (same as the positional form)
--mode MODE Output: table (default on a terminal), csv, json, jsonl, envelope, markdown, cypher
--json / --jsonl / --csv / --markdown Shortcuts for --mode
--noheader Omit column headers
--param N=V Bind a Cypher parameter (repeatable)
--fetch-params N=SRC Fetch a URL or read a file as JSON, bind it as $N
--max-rows N Print at most N rows per statement (0 = unlimited)
--read-only[=FRESH] Open an existing store without writing; FRESH = snapshot (default) or live WAL tailing
--snapshot-format F Snapshot codec: parquet (default) or json — empty stores only
--durability-mode MODE WAL durability: full (default), everysecond, snapshot
--logical-graph-size-limit SIZE Live graph + index cap in logical bytes
--load-csv-dir PATH Allow local LOAD CSV under this directory (default denied)
-h, --help / --version Usage / version (with --json: one JSON object)

Full flag table, env vars, and per-command flags: docs/api/cli/spec.md.

For agents and scripts

Output and errors are designed to be parsed:

  • Result shape. --json prints a bare array of row objects, --jsonl one object per row, and --mode envelope one {"columns":[…],"rows":[…],"truncated":false} object per result set — an empty result still lists its columns.
  • Errors. In machine modes a failed statement also prints {"error":{"code","exit_code","kind","message","retryable"}} on stdout. Branch on exit code: usage 2, rejected statement (syntax/semantic/type) 6, write conflict or locked store 5, other runtime failure 1.
  • Row cap. Under a detected agent harness (or explicit --agent-mode), a statement prints at most 100 rows and says so in-band — a capped result never reads as complete. Raise or lift it with --max-rows N / RELATE_MAX_ROWS.
  • Typos. An unknown flag suggests the nearest real one (--readonly → Did you mean '--read-only'?).

Agent skill

relate skill install writes the skill bundle (SKILL.md plus CLI, Cypher, vector, and spatial references) into every detected agent's skills directory, version-stamped with an ownership marker — a hand-authored directory is never overwritten (--force to override). relate skill remove is idempotent, and relate upgrade refreshes an installed bundle automatically.

relate skill install                     # every detected agent
relate skill install --agent claude-code # one agent only
relate skill remove                      # uninstall (idempotent)

The Python wheel bundles the same skill for library users.

Storage

A store is a fsync'd WAL plus one snapshot codec (ADR-0050); the layout is chosen by the path:

Store What it is Open with
In-memory RAM only, gone at exit relate
Directory (default) WAL + Parquet shards under a directory relate -d ./friends
Directory, JSON codec WAL + a readable graph.json relate -d ./friends --snapshot-format json
Single file (.rl) WAL, snapshot, and catalog inside one host file relate -d ./friends.rl

Durability defaults to full (acknowledge after the WAL barrier); everysecond can lose ~1 s of acknowledged writes, snapshot everything since the last completed checkpoint. Do not mix Parquet shards and graph.json in one directory. The full WAL/checkpoint story: storage engine guide.

Extensions

Userland commands mount as relate run — self-contained packages the host drives over MCP stdio. The host owns the store; the extension's only power is the read_cypher/write_cypher calls it makes. First-party packages:

Extension What it does
fs-to-graph A directory tree as a graph — one (:File) per file, [:CONTAINS] the tree, fulltext over names and contents
git-to-graph A checkout's history as a graph — commits, parents, changed paths
dungeon A MUD-style keep as a playable game — every verb a Cypher statement against the store
relate extension install dungeon --from extensions/relate-dungeon/package
relate run dungeon -d keep.rl --command start

Scaffold your own with relate extension init [--lang sh|py|ts|rust]. The wire contract, trust tiers, and authoring guide: docs/api/extensions/.

Telemetry

The relate CLI reports anonymous usage metrics — command shapes, feature flags, an anonymous install id, and a coarse environment tag. It never sends query text, file paths, or your data. Collection defaults to on, with a layered opt-out:

relate telemetry off       # persist the opt-out
relate telemetry status    # e.g. "disabled (config file)"

DO_NOT_TRACK=1 or RELATE_TELEMETRY=0 also disable it. Only the standalone CLI collects metrics; the embedded Rust and Python APIs do not. Full contract: CLI reference.

Other install options

CLI (macOS & Linux):

curl -sSfL https://relatedb.ai/install.sh | bash

CLI (Homebrew, macOS & Linux):

brew install relatedb/tap/relate

The project tap installs the release binary and records the install as package-managed, so relate upgrade defers to brew upgrade relate instead of replacing what Homebrew owns (ADR-0659).

CLI (Windows, PowerShell):

irm https://relatedb.ai/install.ps1 | iex

From cmd or Git Bash, run powershell -ExecutionPolicy ByPass -c "irm https://relatedb.ai/install.ps1 | iex". It installs relate.exe to %LOCALAPPDATA%\Programs\relate and adds that folder to your user PATH. It runs the same checks as install.sh with the inbox Windows ssh-keygen, in Windows PowerShell 5.1 and PowerShell 7 (ADR-0586). The binary links the C runtime statically, so it needs no Visual C++ redistributable (ADR-0587).

Piping a script into a shell runs it before you have read it. Both installers authenticate everything they download (the signed manifest, then the binary's checksum), but the script itself is trusted on the strength of the HTTPS connection to relatedb.ai. To read it first, download it, inspect it, then run the local copy:

curl -sSfLo install.sh https://relatedb.ai/install.sh && less install.sh && bash install.sh
irm https://relatedb.ai/install.ps1 -OutFile install.ps1; notepad install.ps1
powershell -ExecutionPolicy ByPass -File .\install.ps1

Both scripts are also attached to every GitHub release, as the copy from the tagged commit.

Downloads the release binary for your platform (macOS and Linux, amd64 and arm64) to $HOME/.local/bin, resolving the latest release from releases.json — the same release metadata relate upgrade reads (ADR-0571 — and the assets themselves come straight from the GitHub release download route, so the installer makes no GitHub API requests and no token is ever needed, even behind shared-IP networks (ADR-0585)). Each release's SHA256SUMS manifest is authenticated against its SSHSIG signature with the stock ssh-keygen — the public key is pinned in the script, and the installer fails closed on a missing or invalid signature (ADR-0115). macOS binaries are additionally signed and notarized, so Gatekeeper raises no warning (ADR-0123), and Windows binaries are additionally Authenticode-signed with an RFC 3161 timestamp (ADR-0594). Prebuilt binaries for Linux, macOS, and Windows are on the releases page, and an installed binary self-updates:

relate upgrade          # download, verify, and replace (alias: update)
relate upgrade --check  # report current vs latest; changes nothing

On Windows a running .exe cannot replace itself, so relate upgrade points you at the PowerShell installer: rerun it to upgrade. relate upgrade --check works on every platform.

CLI (Windows): download relate-windows-amd64.exe from the releases page, then check its Authenticode signature before the first run:

Get-AuthenticodeSignature .\relate-windows-amd64.exe |
  Format-List Status, TimeStamperCertificate,
    @{ Label = 'SignerSubject'; Expression = { $_.SignerCertificate.Subject } }

Status must be Valid with a TimeStamperCertificate present — the RFC 3161 timestamp keeps the signature valid after the certificate expires — and the SignerSubject (the SignerCertificate subject) must name the expected publisher: the code-signing certificate held in DigiCert Software Trust Manager, set up in RELEASING.md (ADR-0594).

Python:

pip install relate-db   # the import is `import relate`

npm — Node.js and the browser:

npm install @relate/relate        # Node.js 18+ (native bindings)
npm install @relate/relate-wasm   # browser (WebAssembly)

Rust:

cargo add --git https://github.com/relatedb/relate relate

Docker

make docker builds the server image (multi-stage, a FROM scratch runtime with static binaries); make docker-run runs Bolt (7687), HTTP (7474), and MCP (7475) on localhost with a data volume. Auth is on by default; the token is in the startup banner:

TOKEN=$(docker logs <container> 2>&1 | sed -n 's/.*generated token for user relate: //p' | head -1)
python -c "from neo4j import GraphDatabase; print(GraphDatabase.driver('bolt://localhost:7687', auth=('relate', '$TOKEN')).execute_query('RETURN 1 AS n')[0][0]['n'])"

Or preset it with -e RELATE_AUTH=relate:secret (...=none disables it — publish ports on trusted networks only). Configuration is env-based and echoed at startup (docker logs is the debugging surface); a fresh store can be seeded before the server starts:

docker run -p 7687:7687 -p 7474:7474 -p 7475:7475 -v "$PWD/data:/data" \
  -e RELATE_QUERY="UNWIND range(1,100) AS i CREATE (:Person {id: i})" \
  relate-bolt:latest

# fetch-and-seed from a JSON API, or mirror a Neo4j/Aura subgraph:
#   -e RELATE_LOAD='value=https://…' + -e RELATE_LOAD_QUERY='UNWIND $value.items AS q MERGE (:Question {id: q.question_id})'
#   -e RELATE_PULL_FROM=/run/secrets/neo4j.env + -e RELATE_PULL_QUERY='MATCH (o:Organization)-[r]-() RETURN o, r LIMIT 500'

For large seeds, two knobs matter (details: Bulk import): batch the writes into few statements — one UNWIND per few thousand rows — because each autocommit statement pays one WAL fsync under the default full durability; and relax that barrier for the seed run with -e RELATE_DURABILITY_MODE=everysecond (a crash can lose ~1s of acknowledged writes — drop the variable when serving).

INSTANCES=N runs a test fleet of N serve processes with stepped port ranges. The image is a dev/test image: serve is plaintext-only and warns loudly about it — for encrypted Bolt, front it with a TLS-terminating proxy.

Development

Requires the Rust toolchain (MSRV 1.99, pinned in rust-toolchain.toml):

git clone https://github.com/relatedb/relate && cd relate
cargo build --release
./target/release/relate --version

Testing and lint

# Tests
cargo test -p relate -p relate-front -p relate-executor -p relate-cli -p relate-splitter
make test                     # the same, via make

# Lint — the CI gate
make lint                     # cargo fmt --all --check + clippy -D warnings

# WASM bundle
make build-wasm

Language coverage: the openCypher TCK and Neo4j's Cypher suites run in the spec harness against the Python wheel on every ready PR — reported coverage, plus the ADR-0661 regression gate (a scenario main does not already carry as failing is red). History and pointer: docs/tck/compliance.md.

Python development

pip install maturin
cd surfaces/relate-python && maturin develop --release
python -c "import relate; print(relate.connect(':memory:'))"

# Python crate Rust-side tests
PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1 cargo test -p relate-python

Architecture

Every architecture, storage, protocol, dialect, public-API, and dependency decision is recorded as an Architecture Decision Record in docs/adr/ — the project's decision log, numbered and immutable once accepted. Task guides live in docs/guides/, per-surface API contracts in docs/api/, and deep references (Cypher syntax, functions, CLI flags, storage formats, the C ABI) in docs/reference/.

Contributing

We accept issue reports only — no pull requests. Bugs, feature ideas, and questions all go to the issue tracker; see CONTRIBUTING.md for what makes a useful report.

License

Apache-2.0 (ADR-0055) — see LICENSE.

Frequently asked questions

Is relate free to use?

relate is open source under the Apache-2.0 licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does relate do?

An embedded local, agent-native graph database supporting Cypher 25 written in Rust. Memory or transactional filesystem.

What is relate written in?

relate is primarily written in Rust. Its source is publicly available at https://github.com/relatedb/relate, and it has 572 GitHub stars.