[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-112427":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":23,"hasPages":23,"topics":25,"createdAt":10,"pushedAt":34,"updatedAt":35,"readmeContent":36,"aiSummary":37,"trendingCount":16,"starSnapshotCount":16,"syncStatus":38,"lastSyncTime":39,"discoverSource":40},112427,"relate","relatedb\u002Frelate","relatedb","An embedded local, agent-native graph database supporting Cypher 25 written in Rust. Memory or transactional filesystem.","https:\u002F\u002Frelatedb.ai",null,"Rust",453,44,7,5,0,11,148,278,49,94.87,"Apache License 2.0",false,"main",[26,27,28,29,30,31,32,33],"agent-memory","agent-sandbox-tools","agentic-ai","cypher","emedded-database","graph-database","graphdb","neo4j","2026-11-23 20:42:25","2026-11-23 19:55:12","# Relate\n\n**A graph database in a single binary — query it in Cypher, embed it anywhere, deploy nothing.**\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"img\u002Frelate-hex-ink.png\" alt=\"Relate\" width=\"800\" \u002F>\n\u003C\u002Fp>\n\nRelate is an embedded, in-memory property-graph engine written in Rust, with a\ncommand-line shell for interactive and scripted queries. A graph is a single\n`.rl` file, a directory, or pure in-memory — durable through a fsync'd\nwrite-ahead log and Parquet checkpoints.\nThe same engine powers the `relate` CLI, a Python package, Node.js and browser\n(WASM) npm packages, a Rust crate, and an optional one-process server speaking\nBolt, HTTP, and MCP. No server to babysit, no infrastructure to operate.\n\n📖 **Documentation: [relatedb.ai](https:\u002F\u002Frelatedb.ai\u002F)** — tutorials, guides,\nand the CLI \u002F Cypher \u002F Rust \u002F C API references. The deep references live in\n[`docs\u002F`](docs\u002F) in this repository, and the honest list of what Relate does\nnot do is [`docs\u002Flimitations.md`](docs\u002Flimitations.md). Several entries there\nare deliberate scope, not missing features: the working set fits in memory,\none graph per store, a single user or agent per process — Relate is not a\nlarger-than-memory warehouse, an analytics engine, or a multi-tenant server.\n\n## Install\n\n**CLI (macOS & Linux):**\n\n```bash\ncurl -sSfL https:\u002F\u002Frelatedb.ai\u002Finstall.sh | bash\n```\n\n**CLI (Windows, PowerShell):**\n\n```powershell\nirm https:\u002F\u002Frelatedb.ai\u002Finstall.ps1 | iex\n```\n\nFrom `cmd` or Git Bash, run\n`powershell -ExecutionPolicy ByPass -c \"irm https:\u002F\u002Frelatedb.ai\u002Finstall.ps1 | iex\"`.\nIt installs `relate.exe` to `%LOCALAPPDATA%\\Programs\\relate` and adds that\nfolder to your user `PATH`. It runs the same checks as `install.sh` with\nthe inbox Windows `ssh-keygen`, in Windows PowerShell 5.1 and PowerShell 7\n([ADR-0586](docs\u002Fadr\u002F0586-windows-powershell-installer.md)). The binary\nlinks the C runtime statically, so it needs no Visual C++ redistributable\n([ADR-0587](docs\u002Fadr\u002F0587-windows-static-crt.md)).\n\n> **Piping a script into a shell runs it before you have read it.** Both\n> installers authenticate everything they download (the signed manifest,\n> then the binary's checksum), but the script itself is trusted on the\n> strength of the HTTPS connection to `relatedb.ai`. To read it first,\n> download it, inspect it, then run the local copy:\n>\n> ```bash\n> curl -sSfLo install.sh https:\u002F\u002Frelatedb.ai\u002Finstall.sh && less install.sh && bash install.sh\n> ```\n>\n> ```powershell\n> irm https:\u002F\u002Frelatedb.ai\u002Finstall.ps1 -OutFile install.ps1; notepad install.ps1\n> powershell -ExecutionPolicy ByPass -File .\\install.ps1\n> ```\n>\n> Both scripts are also attached to every\n> [GitHub release](https:\u002F\u002Fgithub.com\u002Frelatedb\u002Frelate\u002Freleases\u002Flatest), as\n> the copy from the tagged commit.\n\nDownloads the release binary for your platform (macOS and Linux, amd64 and\narm64) to `$HOME\u002F.local\u002Fbin`, resolving the latest release from\n[`releases.json`](https:\u002F\u002Frelatedb.ai\u002Freleases.json) — the same release\nmetadata `relate upgrade` reads\n([ADR-0571](docs\u002Fadr\u002F0571-installer-resolves-via-releases-json.md) — and\nthe assets themselves come straight from the GitHub release download route,\nso the installer makes no GitHub API requests and no token is ever needed,\neven behind shared-IP networks\n([ADR-0585](docs\u002Fadr\u002F0585-installer-downloads-via-direct-route.md))). Each\nrelease's `SHA256SUMS` manifest is\nauthenticated against its SSHSIG signature with the stock `ssh-keygen` — the\npublic key is pinned in the script, and the installer **fails closed** on a\nmissing or invalid signature\n([ADR-0115](docs\u002Fadr\u002F0115-sshsig-release-signing.md)). macOS binaries are\nadditionally signed and notarized, so Gatekeeper raises no warning\n([ADR-0123](docs\u002Fadr\u002F0123-macos-codesign-notarize.md)). Prebuilt binaries for\nLinux, macOS, and Windows are on the\n[releases page](https:\u002F\u002Fgithub.com\u002Frelatedb\u002Frelate\u002Freleases\u002Flatest), and an\ninstalled binary self-updates:\n\n```bash\nrelate upgrade          # download, verify, and replace (alias: update)\nrelate upgrade --check  # report current vs latest; changes nothing\n```\n\nOn Windows a running `.exe` cannot replace itself, so `relate upgrade`\npoints you at the PowerShell installer: rerun it to upgrade.\n`relate upgrade --check` works on every platform.\n\n**Python:**\n\n```bash\npip install relate-db   # the import is `import relate`\n```\n\n**npm — Node.js and the browser:**\n\n```bash\nnpm install @relate\u002Frelate        # Node.js 18+ (native bindings)\nnpm install @relate\u002Frelate-wasm   # browser (WebAssembly)\n```\n\n**Rust:**\n\n```bash\ncargo add --git https:\u002F\u002Fgithub.com\u002Frelatedb\u002Frelate relate\n```\n\n\n## Quick start\n\nHand the wheel to your AI agents, or drive it yourself:\n\n```bash\n# Once: install the relate skill bundle — CLI + Cypher + vector + spatial\n# references — into every detected AI agent (Claude Code, Cursor, Codex,\n# Gemini CLI, Copilot, Windsurf, OpenCode, ...)\nrelate skill install\n\n# One-shot query on an in-memory database\nrelate \"RETURN 1 + 2 AS sum\"\n\n# Open (or create) a store and drop into the interactive shell\nrelate query --database .\u002Ffriends\n\n# Script-friendly output\nrelate --json .\u002Ffriends \"MATCH (p:Person) RETURN p.name\"\n\n# Run a file of statements\nrelate -d .\u002Ffriends \u003C setup.cypher\n```\n\n`relate skill install` is optional — it teaches supported agents the CLI\nflags, the Cypher dialect, and the gotchas, so they can drive `relate` for\nyou. `relate upgrade` keeps the bundle current automatically. More in\n[Agent skill](#agent-skill).\n\nAn example session:\n\n```\n$ relate query --database .\u002Ffriends\n\nRelate v1.0.2\nType .help for help, .exit to quit.\n\ncypher> CREATE (alice:Person {name: 'Alice', age: 30});\nNodes created: 1, Properties set: 2, Labels added: 1\n\ncypher> CREATE (bob:Person {name: 'Bob', age: 28});\nNodes created: 1, Properties set: 2, Labels added: 1\n\ncypher> MATCH (a:Person {name: 'Alice'}), (b:Person {name: 'Bob'})\n   ...> CREATE (a)-[:FRIENDS_WITH {since: 2020}]->(b);\nRelationships created: 1, Properties set: 1\n\ncypher> MATCH (p:Person)-[r:FRIENDS_WITH]->(friend)\n   ...> RETURN p.name, friend.name, r.since;\n+--------+-------------+---------+\n| p.name | friend.name | r.since |\n+--------+-------------+---------+\n| Alice  | Bob         | 2020    |\n+--------+-------------+---------+\n```\n\n## Surfaces\n\nOne engine, many front doors: the CLI (Quick start above), the libraries\nbelow, the server surfaces (Bolt, HTTP, MCP), and the extension mount\n([Extensions](#extensions) below).\n\n### Python\n\nQueries execute in-process — a native extension module (PyO3), no server, no\nsubprocess:\n\n```python\nimport relate\n\ndb = relate.connect(\":memory:\")   # or \".\u002Ffriends\" — a directory or .rl file\n\ndb.execute(\"CREATE (p:Person {name: $name, age: $age})\", {\"name\": \"Alice\", \"age\": 30})\ndb.execute(\"CREATE (p:Person {name: $name, age: $age})\", {\"name\": \"Bob\", \"age\": 28})\ndb.execute(\n    \"MATCH (a:Person {name: 'Alice'}), (b:Person {name: 'Bob'}) \"\n    \"CREATE (a)-[:FRIENDS_WITH {since: 2020}]->(b)\"\n)\n\nfor row in db.execute(\"MATCH (p:Person)-[:FRIENDS_WITH]->(f) RETURN p.name, f.name\"):\n    print(f\"{row['p.name']} -> {row['f.name']}\")   # Alice -> Bob\n```\n\nA native `Database` class adds `execute_arrow()` — the result as Arrow IPC\nstream bytes (one serialized conversion from engine rows) for pandas or Polars. Spec: [`docs\u002Fapi\u002Fpython\u002F`](docs\u002Fapi\u002Fpython\u002F); runnable\nexample: [`examples\u002Fpython\u002Fpython_demo.py`](examples\u002Fpython\u002Fpython_demo.py).\n\n### Node.js\n\n```js\nconst { Database } = require(\"@relate\u002Frelate\");\n\nconst db = Database.open(\".\u002Ffriends\");        \u002F\u002F or \":memory:\"\nconst result = db.connect().query(\"MATCH (p:Person) RETURN p.name\");\n\nresult.rows;                   \u002F\u002F [{ \"p.name\": \"Alice\" }, ...]\nresult.stats;                  \u002F\u002F mutation counters, zeros included\nresult.consume().elapsedMs;    \u002F\u002F engine-reported milliseconds\n```\n\nNode 18+; the native library arrives via platform optional-dependencies — no\ninstall scripts. Spec: [`docs\u002Fapi\u002Fjavascript\u002F`](docs\u002Fapi\u002Fjavascript\u002F).\n\n### Browser (WASM)\n\nThe engine compiled to WebAssembly — run Cypher in a page, no server:\n\n```js\nimport init, { RelateDb } from \"@relate\u002Frelate-wasm\";\n\nawait init();\n\nconst db = new RelateDb();                    \u002F\u002F in-memory\nconst result = JSON.parse(db.execute(\"RETURN 1 AS n\", null));\n```\n\nDurable browser storage via OPFS: `await RelateDb.open(\"opfs:\u002F\u002Fgraph\")` —\nruns in a dedicated worker only. Spec: [`docs\u002Fapi\u002Fwasm\u002F`](docs\u002Fapi\u002Fwasm\u002F).\n\n### Rust\n\n`relate::Database` is the engine's public API — the surface every other\nbinding wraps:\n\n```rust\nuse relate::Database;\n\nfn main() -> relate::Result\u003C()> {\n    let db = Database::open(\".\u002Ffriends\")?;\n    let mut conn = db.connect()?;\n\n    conn.query(\"CREATE (n:Person {name: 'Ada'})\")?;\n    let result = conn.query(\"MATCH (n:Person) RETURN n.name AS name\")?;\n    println!(\"{}\", result.rows[0][0]); \u002F\u002F Ada\n    Ok(())\n}\n```\n\nExplicit transactions, cancellation tokens, and read-only,\nfollow, and ephemeral opens. Spec: [`docs\u002Fapi\u002Frust\u002F`](docs\u002Fapi\u002Frust\u002F).\n\n### C\n\nEvery language client wraps one typed C ABI — version 2, additive-only\nafter the first public release:\n\n```c\n#include \"relate.h\"\n\nrelate_database db = NULL;\nrelate_connection conn = NULL;\nrelate_query_result r = NULL;\nchar *err = NULL;            \u002F* out-param errors: start NULL *\u002F\n\nrelate_database_open(\":memory:\", &db, &err);\nrelate_connect_namespace(db, NULL, &conn, &err);\nrelate_query_params(conn, \"RETURN 1 AS n\", NULL, &r, &err);\n```\n\nThe header and library (`librelate_ffi`, static or shared) ship as\n`relate-ffi-\u003Ctarget>.tar.gz` on the\n[releases page](https:\u002F\u002Fgithub.com\u002Frelatedb\u002Frelate\u002Freleases\u002Flatest); every\nfallible call reports through one typed error channel. Contract:\n[`docs\u002Fapi\u002Fc\u002F`](docs\u002Fapi\u002Fc\u002F).\n\n### Java\n\n`ai.relatedb:relate` — Java 17+, JNA over the C ABI, with the native\nlibrary bundled in the jar (one fat jar, or one of five platform\nclassifiers):\n\n```java\ntry (Database db = Database.open(\".\u002Ffriends\");\n     Database.Connection conn = db.connect()) {\n    Result result = conn.query(\"RETURN $n AS n\", java.util.Map.of(\"n\", 1));\n    result.columns();   \u002F\u002F List\u003CString>\n    result.rows();      \u002F\u002F List\u003CList\u003CObject>> — typed values\n}\n```\n\nJars are on the [releases page](https:\u002F\u002Fgithub.com\u002Frelatedb\u002Frelate\u002Freleases\u002Flatest)\nuntil Maven Central goes live. Spec: [`docs\u002Fapi\u002Fjava\u002F`](docs\u002Fapi\u002Fjava\u002F).\n\n### Go\n\nModule `github.com\u002Frelatedb\u002Frelate\u002Fclients\u002Fgo`, cgo against `librelate_ffi`\n(from the release tarballs, or built with `cargo build --release -p\nrelate-ffi`):\n\n```go\ndb, err := relate.Open(\".\u002Ffriends\")\nconn, err := db.Connect()\nresult, err := conn.Query(\"MATCH (p:Person) RETURN p.name\")\n\u002F\u002F result.Columns []string, result.Rows [][]any\n```\n\nSpec: [`docs\u002Fapi\u002Fgo\u002F`](docs\u002Fapi\u002Fgo\u002F).\n\n### Swift\n\nA SwiftPM package (iOS 16+ \u002F macOS 13+, Swift 6) wrapping the C ABI, with\nthe checksummed binary framework attached to every release:\n\n```swift\n\u002F\u002F Package.swift of a consumer\n.package(url: \"https:\u002F\u002Fgithub.com\u002Frelatedb\u002Frelate\", from: \"\u003Crelease>\")\n\u002F\u002F target dependency\n.product(name: \"Relate\", package: \"relate\")\n```\n\n```swift\nlet db = try Database(path: \".\u002Ffriends\")\nlet conn = try db.connect()\nlet result = try conn.query(\"MATCH (p:Person) RETURN p.name\")\n```\n\nSpec: [`docs\u002Fapi\u002Fswift\u002F`](docs\u002Fapi\u002Fswift\u002F).\n\n### Server — Bolt, HTTP, MCP\n\nWhen you want a socket instead of a library:\n\n```bash\nrelate serve --database .\u002Ffriends --bolt 7687 --http 7474 --mcp 7475\n```\n\nOne process, one store, one generated token (printed at startup): Neo4j\ndrivers connect over Bolt — neo4j-browser works out of the box — the HTTP\nQuery API v2 serves JSON, and MCP (streamable HTTP) serves AI hosts. Binds\nloopback by default; runs until SIGINT\u002FSIGTERM. Specs:\n[`bolt`](docs\u002Fapi\u002Fbolt\u002F), [`http`](docs\u002Fapi\u002Fhttp\u002F), [`mcp`](docs\u002Fapi\u002Fmcp\u002F).\n\nDocker — `make docker` builds the server image (multi-stage, a `FROM scratch`\nruntime with static binaries); `make docker-run` runs Bolt (7687), HTTP\n(7474), and MCP (7475) on localhost with a data volume. Auth is on by\ndefault; the token is in the startup banner:\n\n```bash\nTOKEN=$(docker logs \u003Ccontainer> 2>&1 | sed -n 's\u002F.*generated token for user relate: \u002F\u002Fp' | head -1)\npython -c \"from neo4j import GraphDatabase; print(GraphDatabase.driver('bolt:\u002F\u002Flocalhost:7687', auth=('relate', '$TOKEN')).execute_query('RETURN 1 AS n')[0][0]['n'])\"\n```\n\nOr preset it with `-e RELATE_AUTH=relate:secret` (`...=none` disables it —\npublish ports on trusted networks only). Configuration is env-based and\nechoed at startup (`docker logs` is the debugging surface); a fresh store can\nbe seeded before the server starts:\n\n```bash\ndocker run -p 7687:7687 -p 7474:7474 -p 7475:7475 -v \"$PWD\u002Fdata:\u002Fdata\" \\\n  -e RELATE_QUERY=\"UNWIND range(1,100) AS i CREATE (:Person {id: i})\" \\\n  relate-bolt:latest\n\n# fetch-and-seed from a JSON API, or mirror a Neo4j\u002FAura subgraph:\n#   -e RELATE_LOAD='value=https:\u002F\u002F…' + -e RELATE_LOAD_QUERY='UNWIND $value.items AS q MERGE (:Question {id: q.question_id})'\n#   -e RELATE_PULL_FROM=\u002Frun\u002Fsecrets\u002Fneo4j.env + -e RELATE_PULL_QUERY='MATCH (o:Organization)-[r]-() RETURN o, r LIMIT 500'\n```\n\nFor large seeds, two knobs matter (details:\n[Bulk import](docs\u002Fguides\u002Fimport-csv.md#bulk-import-durability-and-batch-size)):\nbatch the writes into few statements — one `UNWIND` per few thousand rows\n— because each autocommit statement pays one WAL fsync under the default\n`full` durability; and relax that barrier for the seed run with\n`-e RELATE_DURABILITY_MODE=everysecond` (a crash can lose ~1s of\nacknowledged writes — drop the variable when serving).\n\n`INSTANCES=N` runs a test fleet of N serve processes with stepped port\nranges. The image is a dev\u002Ftest image: `serve` is plaintext-only and warns\nloudly about it — for encrypted Bolt, front it with a TLS-terminating proxy.\n\n## Features\n\n| Area | What it covers |\n| --- | --- |\n| **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. |\n| **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, never a merge gate. History: [`docs\u002Ftck\u002Fcompliance.md`](docs\u002Ftck\u002Fcompliance.md). |\n| **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. |\n| **Geospatial** | WGS-84 and Cartesian points (2D\u002F3D), `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. |\n| **Profiling** | `EXPLAIN` renders the plan tree; `PROFILE` adds per-operator rows and time. Profiling costs nothing on non-PROFILE runs. |\n| **CLI shell** | Interactive REPL with readline-style editing, dot-commands, output modes `table`, `csv`, `json`, `jsonl`, `markdown`, `cypher`. |\n| **Import \u002F sync** | `LOAD CSV` directly in Cypher; `--fetch-params` binds a fetched URL\u002Ffile JSON document as a parameter; `pull`\u002F`push` mirror subgraphs between Relate and a Neo4j\u002FAura instance; `clone` copies a whole store across layouts — directory ↔ `.rl` bundle, optionally transcoding the snapshot codec. |\n| **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` \u002F `Follow`, ADR-0136). |\n| **Surfaces** | Rust crate, Python + Arrow IPC, JS\u002FJava\u002FGo\u002FSwift over the typed C ABI, Bolt, HTTP, MCP, WASM. |\n\nTask guides — vector similarity, geospatial, CSV import, backup\u002Frestore,\nstorage — live in [`docs\u002Fguides\u002F`](docs\u002Fguides\u002F); tested, runnable recipes for\nmost of the above are in the [cookbook](https:\u002F\u002Frelatedb.ai\u002Fcookbook\u002F).\n\n## CLI reference\n\n### Commands\n\nExit-after lifecycle verbs are positional commands; everything else configures\na query-engine run:\n\n| Command | What it does |\n| --- | --- |\n| `query [STATEMENT]` | Interactive shell, or one-shot\u002Fstdin queries (the default surface) |\n| `skill install\\|remove` | Install \u002F remove the agent-skill bundle |\n| `upgrade` | Self-update the binary (alias: `update`) |\n| `serve` | Host Bolt + HTTP + MCP on one store until SIGINT\u002FSIGTERM |\n| `pull` \u002F `push` | Mirror a subgraph from \u002F into a Neo4j\u002FAura remote (Query API v2) |\n| `clone SOURCE DEST` | Copy a database into a new store and exit — directory ↔ `.rl` on either side, `--to-snapshot-format` to transcode the codec |\n| `extension init\\|install\\|list\\|remove\\|check`, `run` | Mount and dispatch extension commands |\n| `telemetry on\\|off\\|status` | Telemetry controls |\n| `info` | Store metadata (cold read, no open) |\n\n```bash\n# pull a subgraph from Neo4j\u002FAura into a local mirror:\nrelate pull --from neo4j.env --query \"MATCH (o:Organization)-[r]-() RETURN o, r LIMIT 500\" --database .\u002Fmirror\n\n# copy a store into a single-file bundle (backup, transfer):\nrelate clone .\u002Ffriends .\u002Ffriends-backup.rl\n```\n\n### Common flags\n\n| Flag | What it does |\n| --- | --- |\n| `-d`, `--database PATH` | Store target: a directory, `.rl` file, or `:memory:` (default) |\n| `-c`, `--command Q` | One-shot query (same as the positional form) |\n| `--mode MODE` | Output: `table` (default on a terminal), `csv`, `json`, `jsonl`, `envelope`, `markdown`, `cypher` |\n| `--json` \u002F `--jsonl` \u002F `--csv` \u002F `--markdown` | Shortcuts for `--mode` |\n| `--noheader` | Omit column headers |\n| `--param N=V` | Bind a Cypher parameter (repeatable) |\n| `--fetch-params N=SRC` | Fetch a URL or read a file as JSON, bind it as `$N` |\n| `--max-rows N` | Print at most N rows per statement (0 = unlimited) |\n| `--read-only[=FRESH]` | Open an existing store without writing; `FRESH` = `snapshot` (default) or `live` WAL tailing |\n| `--snapshot-format F` | Snapshot codec: `parquet` (default) or `json` — empty stores only |\n| `--durability-mode MODE` | WAL durability: `full` (default), `everysecond`, `snapshot` |\n| `--logical-graph-size-limit SIZE` | Live graph + index cap in logical bytes |\n| `--load-csv-dir PATH` | Allow local `LOAD CSV` under this directory (default denied) |\n| `-h`, `--help` \u002F `--version` | Usage \u002F version (with `--json`: one JSON object) |\n\nFull flag table, env vars, and per-command flags:\n[`docs\u002Fapi\u002Fcli\u002Fspec.md`](docs\u002Fapi\u002Fcli\u002Fspec.md).\n\n### For agents and scripts\n\nOutput and errors are designed to be parsed:\n\n- **Result shape.** `--json` prints a bare array of row objects, `--jsonl`\n  one object per row, and `--mode envelope` one\n  `{\"columns\":[…],\"rows\":[…],\"truncated\":false}` object per result set — an\n  empty result still lists its columns.\n- **Errors.** In machine modes a failed statement also prints\n  `{\"error\":{\"code\",\"exit_code\",\"kind\",\"message\",\"retryable\"}}` on stdout.\n  Branch on exit code: usage `2`, rejected statement (syntax\u002Fsemantic\u002Ftype)\n  `6`, write conflict or locked store `5`, other runtime failure `1`.\n- **Row cap.** Under a detected agent harness (or explicit `--agent-mode`),\n  a statement prints at most 100 rows and says so **in-band** — a capped\n  result never reads as complete. Raise or lift it with `--max-rows N` \u002F\n  `RELATE_MAX_ROWS`.\n- **Typos.** An unknown flag suggests the nearest real one\n  (`--readonly` → `Did you mean '--read-only'?`).\n\n### Agent skill\n\n`relate skill install` writes the skill bundle (`SKILL.md` plus CLI, Cypher,\nvector, and spatial references) into every detected agent's skills directory,\nversion-stamped with an ownership marker — a hand-authored directory is never\noverwritten (`--force` to override). `relate skill remove` is idempotent, and\n`relate upgrade` refreshes an installed bundle automatically.\n\n```bash\nrelate skill install                     # every detected agent\nrelate skill install --agent claude-code # one agent only\nrelate skill remove                      # uninstall (idempotent)\n```\n\nThe Python wheel bundles the same skill for library users.\n\n## Storage\n\nA store is a fsync'd **WAL plus one snapshot codec**\n([ADR-0050](docs\u002Fadr\u002F0050-snapshot-codecs.md)); the layout is\nchosen by the path:\n\n| Store | What it is | Open with |\n| --- | --- | --- |\n| In-memory | RAM only, gone at exit | `relate` |\n| Directory (default) | WAL + Parquet shards under a directory | `relate -d .\u002Ffriends` |\n| Directory, JSON codec | WAL + a readable `graph.json` | `relate -d .\u002Ffriends --snapshot-format json` |\n| Single file (`.rl`) | WAL, snapshot, and catalog inside one host file | `relate -d .\u002Ffriends.rl` |\n\nDurability defaults to `full` (acknowledge after the WAL barrier);\n`everysecond` can lose ~1 s of acknowledged writes, `snapshot` everything\nsince the last completed checkpoint. Do not mix Parquet shards and\n`graph.json` in one directory. The full WAL\u002Fcheckpoint story:\n[storage engine guide](docs\u002Fguides\u002Fstorage-engine.md).\n\n## Extensions\n\nUserland commands mount as `relate run \u003Cname>` — self-contained packages the\nhost drives over MCP stdio. The host owns the store; the extension's only\npower is the `read_cypher`\u002F`write_cypher` calls it makes. First-party\npackages:\n\n| Extension | What it does |\n| --- | --- |\n| `fs-to-graph` | A directory tree as a graph — one `(:File)` per file, `[:CONTAINS]` the tree, fulltext over names and contents |\n| `git-to-graph` | A checkout's history as a graph — commits, parents, changed paths |\n| `dungeon` | A MUD-style keep as a playable game — every verb a Cypher statement against the store |\n\n```bash\nrelate extension install dungeon --from extensions\u002Frelate-dungeon\u002Fpackage\nrelate run dungeon -d keep.rl --command start\n```\n\nScaffold your own with `relate extension init \u003Cname> [--lang sh|py|ts|rust]`.\nThe wire contract, trust tiers, and authoring guide:\n[`docs\u002Fapi\u002Fextensions\u002F`](docs\u002Fapi\u002Fextensions\u002F).\n\n## Telemetry\n\nThe `relate` CLI reports **anonymous** usage metrics — command shapes, feature\nflags, an anonymous install id, and a coarse environment tag. It never sends\nquery text, file paths, or your data. Collection defaults to on, with a\nlayered opt-out:\n\n```bash\nrelate telemetry off       # persist the opt-out\nrelate telemetry status    # e.g. \"disabled (config file)\"\n```\n\n`DO_NOT_TRACK=1` or `RELATE_TELEMETRY=0` also disable it. Only the standalone\nCLI collects metrics; the embedded Rust and Python APIs do not. Full contract:\n[CLI reference](https:\u002F\u002Frelatedb.ai\u002Fdocs\u002Freference\u002Fcli\u002Fflags\u002F).\n\n## Development\n\nRequires the Rust toolchain (MSRV 1.88, pinned in\n[`rust-toolchain.toml`](rust-toolchain.toml)):\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Frelatedb\u002Frelate && cd relate\ncargo build --release\n.\u002Ftarget\u002Frelease\u002Frelate --version\n```\n\n### Testing and lint\n\n```bash\n# Tests\ncargo test -p relate -p relate-front -p relate-executor -p relate-cli -p relate-splitter\nmake test                     # the same, via make\n\n# Lint — the CI gate\nmake lint                     # cargo fmt --all --check + clippy -D warnings\n\n# WASM bundle\nmake build-wasm\n```\n\nLanguage coverage: the openCypher TCK and Neo4j's Cypher suites run in the\nspec harness against the Python wheel on every ready PR — reported coverage,\nnever a merge gate. History and pointer:\n[`docs\u002Ftck\u002Fcompliance.md`](docs\u002Ftck\u002Fcompliance.md).\n\n### Python development\n\n```bash\npip install maturin\ncd surfaces\u002Frelate-python && maturin develop --release\npython -c \"import relate; print(relate.connect(':memory:'))\"\n\n# Python crate Rust-side tests\nPYO3_USE_ABI3_FORWARD_COMPATIBILITY=1 cargo test -p relate-python\n```\n\n### Architecture\n\nEvery architecture, storage, protocol, dialect, public-API, and dependency\ndecision is recorded as an Architecture Decision Record in\n[`docs\u002Fadr\u002F`](docs\u002Fadr\u002F) — the project's decision log, numbered and immutable\nonce accepted. Task guides live in [`docs\u002Fguides\u002F`](docs\u002Fguides\u002F), per-surface\nAPI contracts in [`docs\u002Fapi\u002F`](docs\u002Fapi\u002F), and deep references (Cypher\nsyntax, functions, CLI flags, storage formats, the C ABI) in\n[`docs\u002Freference\u002F`](docs\u002Freference\u002F).\n\n## Contributing\n\nWe accept **issue reports only — no pull requests**. Bugs, feature ideas, and\nquestions all go to the [issue tracker](https:\u002F\u002Fgithub.com\u002Frelatedb\u002Frelate\u002Fissues);\nsee [CONTRIBUTING.md](CONTRIBUTING.md) for what makes a useful report.\n\n## License\n\nApache-2.0 ([ADR-0055](docs\u002Fadr\u002F0055-apache-2-license.md)) — see [LICENSE](LICENSE).\n","Relate 是一个嵌入式、轻量级的本地图数据库，专为 AI 智能体（agent）设计，支持 Cypher 25 查询语言。它采用 Rust 编写，提供内存模式与事务性文件系统两种存储后端，数据以单个 `.rl` 文件或纯内存形式存在，并通过 WAL 日志和 Parquet 快照保障持久性。支持 CLI、Python、Node.js、WASM 及 Rust 原生集成，无需独立服务进程或运维依赖。适用于智能体记忆管理、本地知识图谱构建、沙箱环境状态建模等对低延迟、零部署、单用户\u002F单 agent 场景有强需求的应用。",2,"2026-11-24 04:43:27","CREATED_QUERY"]