Skip to content
hivellmPublic

About

Nexus is a modern graph database built for read-heavy workloads with first-class KNN (K-Nearest Neighbors) support. Inspired by Neo4j's architecture, it combines the power of graph traversal with vector similarity search for hybrid RAG (Retrieval-Augmented Generation) applications.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

4 stars

Watchers

0 watching

Forks

Latest commit

ย 

History

1,465 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Nexus Graph Database

โšก High-performance property graph database with native vector search and binary-RPC-first clients

Rust Edition License Status Tests Compatibility

Quick Start โ€ข Transports โ€ข Documentation โ€ข SDKs โ€ข Roadmap โ€ข Contributing


๐ŸŽฏ What is Nexus?

Nexus is a property graph database built for read-heavy workloads with first-class vector search. Inspired by Neo4j's storage architecture, it combines graph traversal with approximate nearest-neighbor search for hybrid RAG, recommendation, and knowledge-graph applications.

Think Neo4j meets vector search, shipped as a single Rust binary with a CLI, six first-party SDKs, and three transports (native binary RPC, HTTP/JSON, RESP3).

Highlights (v3.0.0)

  • Neo4j-compatible Cypher โ€” MATCH / CREATE / MERGE / SET / DELETE / REMOVE / WHERE / RETURN / ORDER BY / LIMIT / SKIP / UNION / WITH / UNWIND / FOREACH / CASE / EXISTS subqueries / list & map comprehensions / pattern comprehensions and 250+ functions & procedures. 300/300 Neo4j diff-suite tests pass (Neo4j 2025.09.0, 2026-04-19). See the openCypher status table at the bottom.
  • APOC compatibility โ€” ~100 procedures across apoc.coll.* / apoc.map.* / apoc.text.* / apoc.date.* / apoc.schema.* / apoc.util.* / apoc.convert.* / apoc.number.* / apoc.agg.*. Drop-in replacement for most of the Neo4j APOC surface. Matrix: docs/procedures/APOC_COMPATIBILITY.md.
  • Full-text search โ€” Tantivy 0.22 backend behind the Neo4j db.index.fulltext.* procedure namespace. Per-index analyzer catalogue (standard / whitespace / simple / keyword / ngram / english / spanish / portuguese / german / french), BM25 ranking, WAL-integrated auto-maintenance on CREATE / SET / REMOVE / DELETE, optional async writer with refresh_ms cadence, crash-recovery replay. >60k docs/sec bulk ingest, <5 ms p95 single-term query.
  • Constraint enforcement โ€” UNIQUE / NODE KEY / NOT NULL (node + relationship) / property-type (IS :: INTEGER|FLOAT|STRING|BOOLEAN|BYTES|LIST|MAP) enforced on every CREATE / MERGE / SET / REMOVE / SET LABEL path. Cypher 25 FOR (n:L) REQUIRE (...) DDL grammar wired.
  • Advanced types โ€” BYTES scalar family (bytes() / bytesFromBase64 / bytesSlice / โ€ฆ), write-side dynamic labels (CREATE (n:$label) / SET n:$label / REMOVE n:$label), composite B-tree indexes, LIST<T> typed collections, transaction savepoints (SAVEPOINT / ROLLBACK TO SAVEPOINT / RELEASE SAVEPOINT), GRAPH[<name>] preamble.
  • External node IDs (new in 2.1.0) โ€” caller-supplied stable identifiers via the reserved _id property. CREATE (n {_id: '...'}) ON CONFLICT ERROR|MATCH|REPLACE, MERGE (n {_id: '...'}), and MATCH (n {_id: ...}) all hit a dedicated O(log n) catalog index (forward + reverse LMDB sub-DBs, WAL-replay safe). ExternalId wire format covers Hash (Blake3 / SHA-256 / SHA-512), Uuid, String (โ‰ค256 B), and Bytes (โ‰ค64 B). REST surface: POST /data/nodes with external_id + conflict_policy, GET /data/nodes/by-external-id. All six SDKs ship create_node_with_external_id + get_node_by_external_id helpers. See docs/reference/external-node-ids.md.
  • Native KNN โ€” per-label HNSW indexes with cosine / L2 / dot metrics. Bytes-native embeddings on the RPC wire (no base64 tax).
  • Binary RPC default โ€” length-prefixed MessagePack on port 15475; 3โ€“10ร— lower latency and 40โ€“60% smaller payloads vs HTTP/JSON. nexus://host:15475 URL scheme used by CLI + every SDK.
  • Full auth stack โ€” API keys, JWT, RBAC, rate limiting, audit log with fail-open policy.
  • Three-layer back-pressure โ€” per-key rate limiter + per-connection RPC semaphore + global AdmissionQueue (bounded concurrency with FIFO wait + 503 Retry-After on timeout). Light-weight diagnostic endpoints bypass the queue. docs/security/OVERLOAD_PROTECTION.md.
  • Multi-database โ€” isolated databases in a single server instance, CLI + Cypher + SDK.
  • SIMD-accelerated hot paths โ€” AVX-512 / AVX2 / NEON runtime dispatch. 12.7ร— KNN dot @ dim=768 on Zen 4, 7.9ร— sum_f64 @ 262K rows, all with proptest-enforced parity vs scalar.
  • V2 sharded cluster (core) โ€” hash-based shards, per-shard Raft consensus, distributed query coordinator, /cluster/* management API. +201 V2-dedicated tests.
  • 2310+ workspace tests passing on cargo +nightly test --workspace (0 failed, 67 ignored). 2019 lib-only on cargo +nightly test -p nexus-core --lib.

๐Ÿš€ Quick Start

Install (pre-built binary)

# Linux / macOS
curl -fsSL https://raw.githubusercontent.com/hivellm/nexus/main/scripts/install/install.sh | bash

# Windows (PowerShell)
powershell -c "irm https://raw.githubusercontent.com/hivellm/nexus/main/scripts/install/install.ps1 | iex"

The installer puts nexus-server and nexus (CLI) on PATH and registers a system service.

Install (from source)

git clone https://github.com/hivellm/nexus
cd nexus
cargo +nightly build --release --workspace
./target/release/nexus-server        # default: 127.0.0.1:15474 (HTTP) + 127.0.0.1:15475 (RPC)

First query with the CLI

./target/release/nexus query "RETURN 1 + 2 AS sum, 'hello' AS greeting"
# โ”Œโ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
# โ”‚ sum โ”‚ greeting โ”‚
# โ•žโ•โ•โ•โ•โ•โ•ชโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ก
# โ”‚ 3.0 โ”‚ hello    โ”‚
# โ””โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

The CLI defaults to nexus://127.0.0.1:15475 (binary RPC). Every subcommand (query, db, user, key, schema, data) goes through RPC. See crates/nexus-cli/README.md for the full command reference.

First query from a SDK (Rust)

use nexus_sdk::NexusClient;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = NexusClient::new("nexus://127.0.0.1:15475")?;
    let result = client.execute_cypher("MATCH (n:Person) RETURN n.name LIMIT 10", None).await?;
    println!("{} rows via {}", result.rows.len(), client.endpoint_description());
    Ok(())
}

See sdks/ for install + quick-start in every language.

First query over HTTP (legacy / diagnostic)

curl -X POST http://localhost:15474/cypher \
  -H "Content-Type: application/json" \
  -d '{"query": "RETURN 1 + 2 AS sum"}'
# {"columns":["sum"],"rows":[[3]],"execution_time_ms":1}

๐Ÿงฌ Transports

URL form Transport Default port Use case
nexus://host[:port] Binary RPC (MessagePack) 15475 Default. CLI + SDK. Fastest path.
http://host[:port] HTTP/JSON 15474 Browser builds, firewalls, diagnostic.
https://host[:port] HTTPS/JSON 443 Public-internet HTTP with TLS.
resp3://host[:port] RESP3 (Redis-style) 15476 redis-cli / iredis / Grafana debug tail.

Every CLI and SDK reads a URL scheme, honours the NEXUS_SDK_TRANSPORT / NEXUS_TRANSPORT env var, and falls back to an explicit transport field in config. The URL scheme wins over env/config. Full spec: docs/specs/sdk-transport.md.

There is no nexus-rpc:// or nexus+rpc:// scheme. The canonical single-token scheme is nexus.

๐ŸŒŸ Features

Graph engine

  • Property graph model โ€” labels + types + properties on nodes and relationships.
  • Cypher subset โ€” familiar Neo4j syntax. See docs/specs/cypher-subset.md.
  • Record-store architecture โ€” 32-byte nodes, 48-byte relationships, O(1) traversal via linked adjacency lists.
  • ACID transactions โ€” single-writer + epoch-based MVCC, WAL for crash recovery.
  • 19 GDS procedures โ€” PageRank (standard / weighted / parallel), betweenness, eigenvector, Dijkstra, A*, Yen's k-paths, Louvain, label propagation, triangle count, clustering coefficients.

Vector search (native)

  • HNSW indexes per label (cosine / l2 / dot).
  • Bytes-native embeddings on the RPC wire โ€” send NexusValue::Bytes of little-endian f32 directly, no base64.
  • Hybrid queries โ€” combine CALL vector.knn with graph traversal in a single Cypher statement.

Performance

  • Runtime SIMD dispatch โ€” NEXUS_SIMD_DISABLE=1 for emergency rollback, no rebuild.
  • Linear-time Cypher parser โ€” O(Nยฒ) โ†’ O(N) fix, ~290ร— faster on 32 KiB queries.
  • Hierarchical cache (L1/L2/L3) with 90%+ hit rates.
  • Runtime-dispatched CRC32C for WAL (hardware-accelerated).
  • JIT query compilation (Cranelift) for hot paths.

Benchmarks โ€” Nexus vs Neo4j 5.15 Community

Nexus native RPC vs Neo4j Bolt, both in Docker, shared tiny dataset (100 nodes / 50 edges), 2 warmup + 10 measured runs per scenario, release build. Harness: crates/nexus-bench (--compare mode).

  • 56 / 56 head-to-head wins for Nexus (0 parity, 0 behind, 0 gap; 42 Nexus-only features skipped).
  • Nexus p50 is between 0.08ร— and 0.55ร— of Neo4j p50 โ€” median 4.7ร— faster, best case 12.5ร—.
Category Scenarios Median speedup
aggregation 5 9.1ร—
constraint 3 6.7ร—
hybrid (vector + graph) 1 5.6ร—
filter 4 5.3ร—
label_scan 2 5.3ร—
subquery 6 4.7ร—
scalar 14 4.3ร—
write 5 4.2ร—
point_read 2 4.1ร—
order 2 3.3ร—
procedure 4 3.0ร—
traversal 7 2.6ร—

Top wins: aggregation.avg_score_a 12.5ร— ยท aggregation.count_all 11.1ร— ยท ecosystem.call_in_transactions 10.0ร— ยท aggregation.stdev_score 9.1ร— ยท aggregation.min_max_score 8.3ร—. Closest margin still Nexus-ahead: traversal.two_hop_chain 1.8ร—. Full report at target/bench/report.md after running crates/nexus-bench/README.md.

The 74-test cross-bench numbers under docs/performance/BENCHMARK_NEXUS_VS_NEO4J.md are the older Dec-2025 record and are superseded by the 2.5.0 re-baseline in docs/performance/BENCHMARK_2026.md; reproduction recipe + concurrent-load matrix ships with scripts/benchmarks/run-vs-neo4j.sh.

Security + Ops

  • API keys + JWT + RBAC with rate limiting (1k/min, 10k/hour default).
  • Audit logging โ€” fail-open with nexus_audit_log_failures_total metric; never converts IO pressure into mass 500s. Rationale: docs/security/SECURITY_AUDIT.md ยง5.
  • Prometheus metrics โ€” /prometheus endpoint exposes query / cache / connection / audit counters.
  • Master-replica replication โ€” WAL streaming, async / sync modes, automatic failover.
  • V2 sharded cluster (core) โ€” hash-partitioned shards with per-shard Raft consensus, distributed query coordinator, cross-shard traversal, /cluster/* management API. Opt-in via [cluster.sharding]. See docs/guides/DISTRIBUTED_DEPLOYMENT.md.

๐Ÿ—๏ธ Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                         Client transports                             โ”‚
โ”‚  Binary RPC (15475)   โ”‚    HTTP/JSON (15474)   โ”‚   RESP3 (15476)      โ”‚
โ”‚  nexus_protocol::rpc  โ”‚    axum routes         โ”‚   resp3 TCP listener โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
          โ”‚                         โ”‚                        โ”‚
          โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                        โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                   Cypher Executor                        โ”‚
โ”‚        Pattern Match โ€ข Expand โ€ข Filter โ€ข Project         โ”‚
โ”‚         Heuristic Cost-Based Query Planner               โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                        โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚            Transaction Layer (MVCC)                      โ”‚
โ”‚      Epoch-Based Snapshots โ€ข Single-Writer Locking       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                        โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                   Index Layer                            โ”‚
โ”‚   Label Bitmap โ€ข B-tree โ€ข Full-Text โ€ข KNN (HNSW)         โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                        โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                  Storage Layer                           โ”‚
โ”‚  Catalog (LMDB) โ€ข WAL โ€ข Record Stores โ€ข Page Cache       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
Layer Tech Purpose
Binary RPC listener nexus_protocol::rpc + tokio Default transport, multiplexed connections.
HTTP router axum REST + SSE + MCP + UMICP + GraphQL.
RESP3 listener Hand-written parser redis-cli-compatible debug port.
Catalog LMDB via heed Label / type / key ID mappings.
Record stores memmap2 fixed-size records 32-byte nodes, 48-byte relationships.
Page cache Custom (Clock / 2Q / TinyLFU) 8 KB pages, hot-data retention.
WAL Append-only with CRC32C Crash recovery + replication stream.
KNN hnsw_rs Per-label HNSW vector index.
Executor Custom Cypher parser + planner + operators.

Full detail: docs/ARCHITECTURE.md.

๐Ÿ—„๏ธ Multi-database

-- Via Cypher (CLI / SDK / HTTP all work)
SHOW DATABASES
CREATE DATABASE mydb
:USE mydb
RETURN database() AS current_db
DROP DATABASE mydb
# Via the CLI
nexus db list
nexus db create mydb
nexus db switch mydb
nexus db info
nexus db drop mydb

Every SDK ships equivalent methods (list_databases / listDatabases / etc.). Databases are fully isolated โ€” separate catalogs, stores, and indexes. See docs/users/guides/MULTI_DATABASE.md for the full lifecycle guide.

๐Ÿ“ฆ Official SDKs

Six first-party SDKs, all tracking the same 3.0.0 line. Every SDK shares the URL grammar, command-map table, and error semantics defined in docs/specs/sdk-transport.md.

SDK Install Docs RPC status
๐Ÿฆ€ Rust nexus-sdk = "3.0.0" sdks/rust/ โœ… shipped
๐Ÿ Python pip install hivehub-nexus-sdk sdks/python/ โœ… shipped
๐Ÿ“˜ TypeScript npm install @hivehub/nexus-sdk sdks/typescript/ โœ… shipped
๐Ÿน Go go get github.com/hivellm/nexus-go sdks/go/ โœ… shipped
๐Ÿ’œ C# dotnet add package Nexus.SDK sdks/csharp/ โœ… shipped
๐Ÿ˜ PHP composer require hivellm/nexus-php sdks/php/ โœ… shipped

Every SDK defaults to nexus://host:15475 (binary RPC) and falls back to HTTP/JSON when given an http:// URL. RESP3 is a diagnostic port โ€” SDKs refuse resp3:// with a clear error pointing at the transport spec. Transport precedence across languages: URL scheme > NEXUS_SDK_TRANSPORT env > config field > nexus default.

SDK quick examples

Python:

from nexus_sdk import NexusClient

async with NexusClient("nexus://127.0.0.1:15475") as client:
    result = await client.execute_cypher("MATCH (n:Person) RETURN n.name LIMIT 10")
    print(f"Found {len(result.rows)} people via {client.endpoint_description()}")

TypeScript:

import { NexusClient } from '@hivehub/nexus-sdk';

const client = new NexusClient({ baseUrl: 'nexus://127.0.0.1:15475' });
const result = await client.executeCypher('MATCH (n:Person) RETURN n.name LIMIT 10');
console.log(`Found ${result.rows.length} people`);

Rust:

use nexus_sdk::NexusClient;
let client = NexusClient::new("nexus://127.0.0.1:15475")?;
let result = client.execute_cypher("MATCH (n:Person) RETURN n.name LIMIT 10", None).await?;

๐Ÿ–ฅ๏ธ Desktop GUI

A React 18 + TypeScript desktop client lives under gui/. Cypher editor (Monaco), force-directed graph result view (react-force-graph-2d), live-metrics drawer with sparklines, multi-connection management, dark / light theme. Run it against any nexus-server with:

cd gui
NEXUS_NO_ELECTRON=1 npx vite      # opens http://localhost:15475/

See gui/README.md for the component map and the dev workflow. The mockup source files this rewrite mirrors live at docs/design/gui-mockup-v2/.

โš™๏ธ Configuration

Environment variables (server)

Var Default Purpose
NEXUS_ADDR 127.0.0.1:15474 HTTP bind address.
NEXUS_RPC_ADDR 127.0.0.1:15475 Binary RPC bind address.
NEXUS_RESP3_ENABLED false Enable RESP3 listener on 15476.
NEXUS_DATA_DIR ./data Storage root (catalog + stores + WAL).
NEXUS_AUTH_ENABLED true for 0.0.0.0 Force API-key / RBAC authentication.
NEXUS_REPLICATION_ROLE standalone master, replica, or standalone.
NEXUS_REPLICATION_MODE async async or sync.
NEXUS_SIMD_DISABLE 0 Emergency scalar fallback across kernels.
RUST_LOG info Logging level (error/warn/info/debug/trace).

Environment variables (CLI / SDK)

Var Effect
NEXUS_URL Endpoint URL for the CLI (nexus://, http://, etc.).
NEXUS_TRANSPORT Force CLI transport (nexus / http / auto).
NEXUS_SDK_TRANSPORT Same semantics for SDKs.
NEXUS_API_KEY API-key authentication (CLI).
NEXUS_USERNAME / NEXUS_PASSWORD Username/password authentication (CLI).

Data directory layout

data/
โ”œโ”€โ”€ catalog.mdb          # LMDB catalog (labels, types, keys)
โ”œโ”€โ”€ nodes.store          # 32-byte node records
โ”œโ”€โ”€ rels.store           # 48-byte relationship records
โ”œโ”€โ”€ props.store          # Variable-size property records
โ”œโ”€โ”€ strings.store        # String / blob dictionary
โ”œโ”€โ”€ wal.log              # Write-ahead log (v1 / v2 frames)
โ”œโ”€โ”€ checkpoints/         # Per-epoch snapshots
โ””โ”€โ”€ indexes/
    โ”œโ”€โ”€ label_*.bitmap   # Label bitmap indexes (RoaringBitmap)
    โ””โ”€โ”€ hnsw_*.bin       # HNSW vector indexes

๐Ÿ” Authentication

Auth is disabled by default on 127.0.0.1 (local dev) and required for 0.0.0.0 binding. The first admin is the configured root user; every subsequent user is created via CREATE USER Cypher.

# Create the first user + API key via the CLI
nexus --username root --password root user create alice --password secret
nexus --username alice --password secret key create myapp

# Use the API key on later requests
nexus --api-key nexus_sk_abc123... query "RETURN 1"

Rate limiting: 1k requests/minute and 10k/hour per API key, returning 429 Too Many Requests when exceeded. Full details: docs/security/AUTHENTICATION.md.

RESP3 debug port

NEXUS_RESP3_ENABLED=true ./nexus-server
# in another shell:
redis-cli -p 15476
127.0.0.1:15476> HELLO 3 AUTH root root
127.0.0.1:15476> CYPHER "MATCH (n) RETURN count(n) AS c"
127.0.0.1:15476> STATS

Not Redis emulation โ€” SET key value returns -ERR unknown command 'SET' (Nexus is a graph DB, see HELP). Full vocabulary: docs/specs/resp3-nexus-commands.md.

๐Ÿ”„ Replication

Master-replica replication ships in 1.0.0. Use the master for writes, replicas for reads.

# Master
NEXUS_REPLICATION_ROLE=master \
NEXUS_REPLICATION_BIND_ADDR=0.0.0.0:15475 \
./nexus-server

# Replica
NEXUS_REPLICATION_ROLE=replica \
NEXUS_REPLICATION_MASTER_ADDR=master:15475 \
./nexus-server
Endpoint Method Purpose
/replication/status GET Role + lag + connected replicas.
/replication/promote POST Promote a replica.
/replication/pause POST Pause WAL streaming.
/replication/resume POST Resume WAL streaming.
/replication/lag GET Real-time lag metrics.

Features: full sync via snapshot, incremental WAL streaming (circular buffer, 1M ops), async / sync modes, auto-reconnect with exponential backoff.

๐Ÿ•ธ๏ธ Sharded Cluster (V2)

Nexus V2 adds horizontal scalability through hash-based sharding with per-shard Raft consensus and a distributed query coordinator. Standalone deployments are unaffected โ€” sharding is opt-in via [cluster.sharding].

# config.toml
[cluster.sharding]
mode = "bootstrap"        # "disabled" | "bootstrap" | "join"
node_id = "node-a"
listen_addr = "0.0.0.0:15480"
peers = [
  { node_id = "node-a", addr = "10.0.0.1:15480" },
  { node_id = "node-b", addr = "10.0.0.2:15480" },
  { node_id = "node-c", addr = "10.0.0.3:15480" },
]
num_shards = 3
replica_factor = 3
Endpoint Method Purpose
/cluster/status GET Layout + generation + per-shard health.
/cluster/add_node POST Admin: register a node (leader-only).
/cluster/remove_node POST Admin: remove a node, drain: true opt.
/cluster/rebalance POST Admin: trigger rebalancer.
/cluster/shards/{id} GET Per-shard detail.

Guarantees:

  • Leader election โ‰ค 3ร— election timeout (~900 ms default).
  • Majority quorum replication โ€” 3-replica shard tolerates 1 loss, 5-replica tolerates 2.
  • Atomic scatter/gather โ€” any shard failure fails the whole query (no partial rows).
  • Generation-tagged metadata โ€” stale coordinator caches detected via ERR_STALE_GEN and refreshed once before retry.
  • Leader-hint retry โ€” scatter RPCs retry up to 3ร— against the new leader on ERR_NOT_LEADER.

Full operator guide + failure-mode table: docs/guides/DISTRIBUTED_DEPLOYMENT.md. Multi-host TCP transport between replicas is scheduled in the phase5_v2-tcp-transport-bridge follow-up task; the current in-process transport covers single-host clusters and all integration scenarios.

๐Ÿ“ฆ Use cases

RAG (Retrieval-Augmented Generation)

CALL vector.knn('Document', $query_vector, 10)
YIELD node AS doc, score
MATCH (doc)-[:CITES]->(cited:Document)
RETURN doc.title, doc.content, COLLECT(cited.title) AS citations, score
ORDER BY score DESC

Recommendation engine

MATCH (user:Person {id: $user_id})-[:LIKES]->(item:Product)
MATCH (item)<-[:LIKES]-(similar:Person)
MATCH (similar)-[:LIKES]->(recommendation:Product)
WHERE NOT (user)-[:LIKES]->(recommendation)
RETURN recommendation.name, COUNT(*) AS score
ORDER BY score DESC LIMIT 10

Code analysis + LLM context

CALL graph.generate('call_graph', {scope: {file_patterns: ['*.rs']}})
YIELD graph_id
CALL graph.analyze(graph_id, 'pattern_detection')
YIELD pattern_type, confidence, nodes
WHERE confidence > 0.8
RETURN pattern_type, confidence, SIZE(nodes) AS pattern_size
ORDER BY confidence DESC

๐Ÿ“– Documentation

User-facing

Architecture + specs

  • docs/ARCHITECTURE.md โ€” system design.
  • docs/ROADMAP.md โ€” development phases.
  • docs/specs/ โ€” binary specs (storage format, Cypher subset, page cache, WAL/MVCC, KNN, RPC wire format, RESP3 vocabulary, SDK transport, SIMD dispatch).

Compatibility

Performance

Deployment

Migration

  • docs/migration/FROM_KUZU.md โ€” migrating from KuzuDB (archived 2025-10-10). Schema mapping, Cypher dialect deltas, vector + FTS port, embedded-mode replacement, three end-to-end cookbooks.
  • scripts/migration/ โ€” Kรนzu CSV โ†’ Nexus bulk RPC ingester + Cypher dialect translator.

๐Ÿ—บ๏ธ Roadmap

2.5.0 โ€” current (2026-07-14)

  • โœ… Write-path unification. Every transport (HTTP / RPC / RESP3 / GraphQL / streaming) now executes writes through one tested engine path; the divergent forks were deleted. Closes a class of transport-dependent data-loss bugs โ€” MERGE (a)-[r]->(b) creates the edge, SET r.k persists, $param write values persist, consecutive CREATE clauses all run, aggregation preserves the written RETURN column order. Verified by a 26-case parity harness + a cross-transport parity runner.
  • โœ… Concurrency. Autocommit reads bypass the global engine lock (~2.6x concurrent reads); count(n) @64 workers went 21.8x; a mimalloc global allocator lifts concurrent reads a further 37โ€“84%.
  • โœ… Zero-CVE Docker image โ€” FROM scratch static musl, multi-arch (linux/amd64 + linux/arm64), Docker Scout 0C/0H/0M/0L.
  • โœ… New Cypher functions โ€” randomUUID, ascii/chr, lpad/rpad, normalize, two-arg log, isNaN, shuffle, stable-string elementId.
  • โœ… Canonical vs-Neo4j benchmark (docs/performance/BENCHMARK_2026.md, Nexus leads 84% of comparable serial scenarios) + first-measured KNN recall (SIFT1M / GloVe).

2.4.0 (2026-07-11)

  • โœ… Fixed $param property-value data loss over the HTTP write path (CREATE/MERGE/SET silently stored null); AVX2 popcount over-count fix.

2.3.2 (2026-06-08)

  • โœ… Bug-fix release (field reports vs 2.3.1):
    • UNWIND [...] AS row MERGE/SET ... writes persist every row in a single statement instead of silently dropping (GH #13) โ€” unblocks batched backfill.
    • property indexes survive a restart: definitions are persisted and the typed index is rebuilt at startup, so seeks/MERGE stay O(log N) across restarts (GH #11).
    • fixed a sustained-write 100% CPU busy-loop: CALL { ... } IN TRANSACTIONS infinite re-execution + O(N)-per-write label-index stats (GH #12).

2.3.1 (2026-06-07)

  • โœ… Bug-fix release (field reports vs 2.3.0):
    • POST /cypher accepts an explicit "parameters": null body again (GH #7).
    • read-side MATCH (n:Label {prop: val}) uses a typed property-index seek (NodeIndexSeek) instead of a full label scan; comma-joined endpoint lookups stop being a cartesian product (GH #8).
    • CREATE INDEX via the REST/RPC API now registers + backfills the typed property index that read seeks and index-backed MERGE consult (GH #9).
    • null-keyed legacy data: null property values are never indexed and MERGE rejects null keys; documented clean graph rebuild procedure.
  • โšก O(1) edge-MERGE existence โ€” exact (src, type, dst) index backs MERGE (a)-[:T]->(b); rebuilt from storage on startup.

2.3.0 (2026-06-06)

  • โœ… Bug-fix release (field reports vs 2.2.0):
    • $param binding on the read path + the Neo4j-standard parameters body key (GH #3).
    • prop_ptr startup corruption / property-store reopen made durable (GH #4).
    • GROUP BY by a function/expression key + RETURN <nodeVar> (GH #5).
    • non-ASCII (UTF-8) /cypher bodies no longer panic / drop the connection (GH #6).
  • โœ… Reliability: Windows write socket exhaustion (pooled keep-alive HTTP client); catalog label/type/key id-allocation race on shared LMDB environments.
  • โœ… Performance: index-backed node MERGE existence (O(N) โ†’ O(log N)).

2.2.0 (2026-05-04)

  • โœ… Property graph engine + broad openCypher surface + 19 GDS procedures + ~100 APOC procedures.
  • โœ… 300/300 Neo4j diff suite (2025.09.0).
  • โœ… Native HNSW KNN per label.
  • โœ… Binary RPC default, HTTP/JSON legacy, RESP3 debug.
  • โœ… CLI + six SDKs on the RPC-first 1.x line.
  • โœ… Authentication (API keys, JWT, RBAC, rate limiting, audit log with fail-open policy).
  • โœ… Three-layer back-pressure (per-key rate limit + per-connection RPC semaphore + global admission queue).
  • โœ… Multi-database with SHOW DATABASES / CREATE DATABASE / DROP DATABASE / :USE.
  • โœ… Master-replica replication (async / sync).
  • โœ… SIMD kernels (AVX-512 / AVX2 / NEON) with runtime dispatch.
  • โœ… Full-text search (Tantivy 0.22) with per-index analyzer catalogue, WAL auto-maintenance, optional async writer.
  • โœ… Constraint enforcement for UNIQUE / NODE KEY / NOT NULL / property-type + Cypher 25 FOR (n:L) REQUIRE (...) DDL.
  • โœ… Advanced types: BYTES family, dynamic labels on writes, composite B-tree indexes, LIST<T> typed collections, savepoints, GRAPH[<name>] scoping.
  • โœ… APOC ecosystem โ€” apoc.coll.* / apoc.map.* / apoc.text.* / apoc.date.* / apoc.schema.* / apoc.util.* / apoc.convert.* / apoc.number.* / apoc.agg.*.
  • โœ… System procedures โ€” db.indexes, db.constraints, db.labels, db.schema.*, dbms.*.
  • โœ… openCypher quickwins โ€” type-check predicates, isEmpty polymorphism, list converters, string extractors, dynamic property access, SET +=.
  • โœ… V2 sharding core (2026-04-20) โ€” hash-based shards, per-shard Raft consensus, distributed query coordinator, /cluster/* API. +201 V2 tests.
  • โœ… V2 multi-host TCP transport bridge (2026-04-20) โ€” Raft replicas over TCP, single-host in-process transport retained for tests.
  • โœ… Nexus vs Neo4j benchmark suite โ€” Docker-based harness, 14/14 Lead on the live compare run (2026-04-21).

Queued on 1.x

Every item below is an active rulebook task under .rulebook/tasks/. Pick one up via rulebook_task_show <taskId>.

openCypher coverage (broadening Neo4j 5.x parity):

Infrastructure & ops:

Protocol polish:

  • ๐Ÿงญ RESP3 in non-Rust SDKs โ€” every SDK accepts resp3:// URLs and throws a clear error; parser/writer queued for a subsequent 1.x release.
  • ๐Ÿงญ Streaming Cypher / live queries โ€” RPC push frame is reserved (PUSH_ID = u32::MAX); no SDK consumer yet.

V2 โ€” distributed โœ… core complete (2026-04-20)

  • โœ… Sharding โ€” deterministic xxh3 hash partitioning, generation-tagged metadata, iterative rebalancer (crates/nexus-core/src/sharding/).
  • โœ… Raft consensus โ€” purpose-built per-shard Raft with leader election, log replication, snapshot install, 5-node tolerates 2 failures (crates/nexus-core/src/sharding/raft/).
  • โœ… Distributed queries โ€” scatter/gather coordinator with atomic failure, leader-hint retry, COUNT/SUM/AVG decomposition, top-k merge (crates/nexus-core/src/coordinator/).
  • โœ… Cluster operations โ€” /cluster/* management API, admin-gated, 307 redirect on followers, drain semantics (crates/nexus-server/src/api/cluster.rs).
  • โœ… Multi-host TCP transport โ€” Raft replica bridge over TCP (2026-04-20).
  • ๐Ÿงญ Online re-sharding / cross-shard 2PC / geo-distribution โ€” V2.1 / V3.

Full detail: docs/ROADMAP.md.

โšก Why Nexus?

Property Neo4j Redis / Redis Stack Nexus
Query language Cypher (full) RedisGraph Cypher Cypher 25 + ~100 APOC procedures
Storage model Record stores In-memory / flash Record stores (Neo4j-inspired)
Vector search GDS plugin Redis Search module Native HNSW per label
Default transport Bolt binary RESP3 Binary RPC (MessagePack), HTTP, RESP3
SDKs Official 7 languages Extensive community 6 first-party, same 2.0.0 cadence
Target workload General graph OLTP In-memory KV + graph Read-heavy + RAG + vector hybrid

Sweet spot

  • RAG with citation + semantic hybrid.
  • Recommendation systems over labeled embeddings.
  • Knowledge graphs with vector-seeded expansion.
  • Code-analysis call graphs + pattern detection for LLM context.

Not ideal

  • Write-heavy OLTP โ€” use a traditional RDBMS.
  • Pure key-value โ€” use Redis or Synap.
  • Document-only search โ€” use Elasticsearch or the Vectorizer standalone.

๐Ÿงฎ openCypher Support Matrix

Canonical list of openCypher / Cypher 25 surfaces in Nexus v3.0.0. โœ… shipped ยท ๐ŸŸก partial (grammar-only or limited scope) ยท ๐Ÿงญ queued. Validated against the 300/300 Neo4j diff suite; per-clause detail lives in docs/specs/cypher-subset.md.

Reading clauses

Clause / feature Status Notes
MATCH (nodes, relationships, multiple labels, directed / undirected) โœ… Label intersection via RoaringBitmap.
Variable-length paths *, *n, *m..n, +, ? โœ… Planner routes to optimized BFS for bounded lengths.
OPTIONAL MATCH โœ… Left-outer semantics, null propagation.
Quantified path patterns ()-[]->{m,n}() ๐ŸŸก Grammar + AST shipped (2026-04-21); execution engine in phase6_opencypher-quantified-path-patterns.
WHERE (after MATCH / OPTIONAL MATCH / WITH) โœ… Clause-ordering rule enforced since phase3_unwind-where-neo4j-parity.
WITH (projection, aggregation, chaining) โœ… Supports DISTINCT, ORDER BY, LIMIT, SKIP, WHERE.
UNWIND โœ… Into CREATE, aggregation, filter.
RETURN โ€” projection, DISTINCT, AS alias, n.* โœ… Including complex expressions + CASE in projections.
ORDER BY / SKIP / LIMIT โœ… Top-k merge for distributed queries.
UNION / UNION ALL โœ…
CALL subquery (CALL { โ€ฆ }) โœ… Scalar + row-level.
CALL { โ€ฆ } IN TRANSACTIONS OF N ROWS ๐ŸŸก Grammar + suffix clauses landed 2026-04-22 (phase6_opencypher-subquery-transactions); executor integration pending.
Named paths (p = (a)-[*]-(b)) + nodes(p) / relationships(p) / length(p) โœ…
shortestPath() / allShortestPaths() โœ…
Pattern comprehensions [(n)-[]->(m) | m.name] โœ…
List comprehensions [x IN list WHERE โ€ฆ | โ€ฆ] โœ…
Map projection n {.prop, alias: expr} โœ…
CASE (simple + generic) โœ…
EXISTS { โ€ฆ } subqueries โœ…

Writing clauses

Clause / feature Status Notes
CREATE nodes / relationships (with properties, multi-label) โœ…
MERGE (+ ON CREATE SET / ON MATCH SET) โœ…
SET property / SET n += map / multi-property โœ…
SET n:Label (add label) / REMOVE n:Label โœ…
SET n:$label / REMOVE n:$label / CREATE (n:$label) (write-side dynamic labels) โœ… STRING or LIST<STRING> parameter.
DELETE / DETACH DELETE โœ… RPC parity fixed in v1.0.0 release.
REMOVE property โœ…
FOREACH (x IN list | โ€ฆ) โœ…
LOAD CSV (+ WITH HEADERS) โœ…
SAVEPOINT / ROLLBACK TO SAVEPOINT / RELEASE SAVEPOINT โœ… Nested LIFO unwind.

Schema & constraints

Feature Status Notes
CREATE INDEX [IF NOT EXISTS] / DROP INDEX [IF EXISTS] on single property โœ…
Composite B-tree indexes ON (n.p1, n.p2, โ€ฆ) โœ… Exact / prefix / range seeks + optional uniqueness flag.
Full-text indexes via db.index.fulltext.createNodeIndex / createRelationshipIndex โœ… Tantivy 0.22, per-index analyzer catalogue.
FTS query procedures (queryNodes / queryRelationships) โœ… BM25 ranking, top-k, tie-break on node id.
FTS drop / listAvailableAnalyzers / awaitEventuallyConsistentIndexRefresh โœ…
FTS WAL integration (auto-populate on CREATE / SET / REMOVE / DELETE, crash replay) โœ… v1.11 + v1.12.
FTS per-index async writer with refresh_ms cadence โœ… v1.13; default remains sync (read-your-writes).
Spatial indexes ๐ŸŸก CREATE SPATIAL INDEX grammar parses; R-tree backend in phase6_opencypher-geospatial-predicates.
UNIQUE constraint โœ… Enforced on CREATE / MERGE / SET.
NODE KEY (composite uniqueness + implicit NOT NULL) โœ… Backed by composite B-tree with unique flag.
NOT NULL / EXISTS(n.p) (nodes + relationships) โœ…
Property-type constraint IS :: INTEGER | FLOAT | STRING | BOOLEAN | BYTES | LIST | MAP โœ… Strict semantics (INTEGER โ‰  FLOAT).
Backfill validator for constraints on existing data โœ… First 100 offending rows surfaced; atomic abort.
Cypher 25 FOR (n:L) REQUIRE (โ€ฆ) IS NODE KEY DDL โœ… Parser + planner wired.
Database DDL (SHOW / CREATE / DROP DATABASE [IF EXISTS], USE) โœ… Multi-database isolation.
GRAPH[<name>] preamble โœ… Cross-database routing via DatabaseManager.

Procedures

Namespace Status Notes
db.indexes / db.constraints / db.labels / db.schema.* โœ… System-procedure surface landed v1.x.
dbms.procedures() / dbms.functions() / dbms.* โœ… Every registered proc surfaces here, incl. APOC + GDS.
db.index.fulltext.* โœ… See FTS row above.
vector.knn(label, vector, k) + KNN-seeded traversal โœ… Bytes-native embeddings on RPC.
graph.generate / graph.analyze (correlation & pattern detection) โœ… Code-analysis use case.
GDS โ€” PageRank (standard / weighted / parallel), betweenness, eigenvector, Dijkstra, A*, Yen's k-paths, Louvain, label propagation, triangle count, clustering coefficients โœ… 19 procedures.
apoc.coll.* (30 procs: union, intersection, sort, partition, flatten, โ€ฆ) โœ…
apoc.map.* (20 procs: merge, fromPairs, groupBy, submap, โ€ฆ) โœ…
apoc.text.* (20 procs: levenshtein, jaroWinkler, regex.*, phonetic, base64, โ€ฆ) โœ…
apoc.date.* (25 procs: format, parse, convertFormat, diff, toYears, โ€ฆ) โœ…
apoc.schema.* (10 procs: assert, nodes, relationships, indexExists, โ€ฆ) โœ…
apoc.util.* / apoc.convert.* / apoc.number.* / apoc.agg.* โœ… Delta namespaces landed 2026-04-21.

Expressions & functions

Group Status Notes
Comparison / boolean / unary operators โœ… =, !=, <, <=, >, >=, AND, OR, NOT, unary -.
IN / IS NULL / IS NOT NULL โœ…
String predicates STARTS WITH / ENDS WITH / CONTAINS / regex =~ โœ…
String functions โ€” toLower, toUpper, substring, trim, ltrim, rtrim, replace, split, length, left, right, reverse โœ…
Regex helper functions โ€” regexMatch, regexReplace, regexReplaceAll, regexExtract, regexExtractAll, regexExtractGroups, regexSplit โœ…
Math โ€” abs, ceil, floor, round, sqrt, pow, sign, rand, trig (sin/cos/tan, asin/acos/atan/atan2), exp, log, log10, radians, degrees, pi(), e() โœ…
Type conversion โ€” toInteger, toFloat, toString, toBoolean, toDate โœ…
Type-check predicates โ€” isEmpty, isString, isNumber, isInteger, isFloat, isBoolean, isList, isMap, isNull โœ… Landed in openCypher quickwins.
List functions โ€” size, head, tail, last, range, reverse, keys, nodes, relationships, length โœ…
Aggregation โ€” COUNT(*), COUNT(DISTINCT x), SUM, AVG, MIN, MAX, COLLECT, COLLECT(DISTINCT โ€ฆ) โœ…
Temporal โ€” date(), datetime(), time(), duration(), localdatetime() โœ…
BYTES family โ€” bytes, bytesFromBase64, bytesToBase64, bytesToHex, bytesLength, bytesSlice โœ… Wire format {"_bytes": "<base64>"}; 64 MiB per-property cap.
Typed collections LIST<INTEGER|FLOAT|STRING|BOOLEAN|BYTES|ANY> โœ… Parser + constraint-engine validator.
Spatial / geospatial predicates (distance, point(), polygon containment) ๐Ÿงญ Queued in phase6_opencypher-geospatial-predicates.

Transactions, admin & observability

Feature Status Notes
BEGIN / COMMIT / ROLLBACK โœ…
Transaction savepoints โœ… v1.5.
EXPLAIN / PROFILE โœ…
Query hints โ€” USING INDEX / USING SCAN / USING JOIN โœ…
SHOW QUERIES / TERMINATE QUERY '<id>' โœ…
CREATE USER / DROP USER / RBAC DDL โœ… Via auth subsystem + Cypher admin surface.
Replication DDL (/replication/promote, /pause, /resume) โœ… HTTP only.
Cluster DDL (/cluster/add_node, /remove_node, /rebalance) โœ… Admin-gated.

๐Ÿ› ๏ธ Development

Project layout

nexus/
โ”œโ”€โ”€ crates/                # ๐Ÿฆ€ Rust workspace crates (standard layout)
โ”‚   โ”œโ”€โ”€ nexus-core/        # ๐Ÿง  Graph engine library (catalog, storage, WAL,
โ”‚   โ”‚                      #    index, executor, MVCC, sharding, coordinator)
โ”‚   โ”œโ”€โ”€ nexus-server/      # ๐ŸŒ Axum HTTP + RPC + RESP3 server
โ”‚   โ”œโ”€โ”€ nexus-protocol/    # ๐Ÿ”Œ Shared wire types (rpc, resp3, mcp, rest, umicp)
โ”‚   โ””โ”€โ”€ nexus-cli/         # ๐Ÿ’ป `nexus` binary, RPC-default
โ”œโ”€โ”€ sdks/                  # ๐Ÿ“ฆ Six first-party SDKs (rust, python, typescript, go, csharp, php)
โ”œโ”€โ”€ tests/                 # ๐Ÿงช Workspace integration + Neo4j compatibility
โ”œโ”€โ”€ docs/                  # ๐Ÿ“š User guides, specs, compatibility, performance
โ””โ”€โ”€ scripts/install/       # ๐Ÿ”ง install.sh / install.ps1

Build + test

cargo +nightly build --release --workspace
cargo +nightly test --workspace
cargo +nightly clippy --workspace --all-targets --all-features -- -D warnings
cargo +nightly fmt --all

Coverage: cargo llvm-cov --workspace --ignore-filename-regex 'examples' (95%+ expected for new code).

๐Ÿค Contributing

See CONTRIBUTING.md for the workflow. Short version:

  1. Fork, branch (git checkout -b feature/your-feature).
  2. Make changes + tests (95%+ coverage on new code).
  3. Run cargo fmt, cargo clippy, cargo test.
  4. Conventional commits (feat(scope): โ€ฆ, fix(scope): โ€ฆ, refactor(scope): โ€ฆ).
  5. Submit PR with description, tests, docs.

For major features, this repo uses @hivehub/rulebook for spec-driven development โ€” proposals + tasks live under .rulebook/tasks/.

๐Ÿ“œ License

Apache-2.0. See LICENSE.

๐Ÿ™ Acknowledgments

  • Neo4j โ€” inspiration for the record-store layout and Cypher.
  • HNSW โ€” the approximate-NN algorithm powering KNN.
  • OpenCypher โ€” language specification.
  • Rust โ€” the ecosystem behind every crate here.

๐Ÿ“ž Contact


Built with โค๏ธ in Rust ๐Ÿฆ€

Neo4j-compatible graph + native vector search, binary-RPC first

โญ Star on GitHub โ€ข ๐Ÿ“– Docs โ€ข ๐Ÿš€ Quick Start

About

Nexus is a modern graph database built for read-heavy workloads with first-class KNN (K-Nearest Neighbors) support. Inspired by Neo4j's architecture, it combines the power of graph traversal with vector similarity search for hybrid RAG (Retrieval-Augmented Generation) applications.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages