{"id":51032742,"url":"https://github.com/offbit-ai/kyugraph","last_synced_at":"2026-06-22T02:02:15.561Z","repository":{"id":340026522,"uuid":"1164168091","full_name":"offbit-ai/kyugraph","owner":"offbit-ai","description":"KyuGraph is a high-performance embedded property graph database written in pure Rust","archived":false,"fork":false,"pushed_at":"2026-02-26T07:37:58.000Z","size":1026,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-27T20:24:31.849Z","etag":null,"topics":["cypher-query-language","database","graphdb","graphql"],"latest_commit_sha":null,"homepage":"https://offbit-ai.github.io/kyugraph/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/offbit-ai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-22T18:33:58.000Z","updated_at":"2026-05-02T13:40:07.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/offbit-ai/kyugraph","commit_stats":null,"previous_names":["offbit-ai/kyugraph"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/offbit-ai/kyugraph","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/offbit-ai%2Fkyugraph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/offbit-ai%2Fkyugraph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/offbit-ai%2Fkyugraph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/offbit-ai%2Fkyugraph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/offbit-ai","download_url":"https://codeload.github.com/offbit-ai/kyugraph/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/offbit-ai%2Fkyugraph/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34630770,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-22T02:00:06.391Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cypher-query-language","database","graphdb","graphql"],"created_at":"2026-06-22T02:02:14.775Z","updated_at":"2026-06-22T02:02:15.546Z","avatar_url":"https://github.com/offbit-ai.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# KyuGraph\n\n[![CI](https://github.com/offbit-ai/kyugraph/actions/workflows/ci.yml/badge.svg)](https://github.com/offbit-ai/kyugraph/actions/workflows/ci.yml)\n[![Benchmarks](https://github.com/offbit-ai/kyugraph/actions/workflows/benchmarks.yml/badge.svg)](https://github.com/offbit-ai/kyugraph/actions/workflows/benchmarks.yml)\n[![Rust](https://img.shields.io/badge/rust-stable-blue.svg)](https://www.rust-lang.org/)\n[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)\n\nKyuGraph is a high-performance embedded property graph database written in pure Rust. It is a port of [RyuGraph](https://github.com/ryu-graph/ryugraph) — itself a C++ fork of [Kùzu](https://github.com/kuzudb/kuzu) — redesigned from the ground up to leverage Rust's ownership model, zero-cost abstractions, and modern concurrency primitives.\n\nKyuGraph implements the openCypher query language and targets analytical graph workloads where low-latency traversals and columnar scans coexist.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\".github/ScreenRecording2026-02-24at19.33.22-ezgif.com-video-to-gif-converter.gif\" alt=\"KyuGraph Visualizer\" width=\"720\"\u003e\n\u003c/p\u003e\n\n## Key Features\n\n- **Cypher Query Language** — Hand-written lexer with combinator-based parser, full expression binding, and query planning\n- **Columnar Storage Engine** — Cache-friendly columnar layout with node groups, CSR-compressed adjacency lists, and a split read/write buffer pool\n- **MVCC Transactions** — Serializable isolation via multi-version concurrency control with write-ahead logging and automatic checkpointing\n- **Vectorized Execution** — Morsel-driven pipeline execution operating on typed value vectors with selection vector filtering\n- **Cranelift JIT Compilation** — Filter predicates and arithmetic projections are compiled to native machine code at query time, delivering up to 22x speedup over tree-walking evaluation\n- **Cost-Based Optimizer** — Statistics-driven cardinality estimation with selectivity heuristics for join reordering\n- **Multi-Format Ingestion** — `COPY FROM` supports CSV, Parquet, Arrow IPC, and Kafka streaming sources\n- **Arrow Flight Protocol** — gRPC-based network interface for remote clients and BI tool integration\n- **Cloud-Native Storage** — S3-backed page store with NVMe write-through disk cache and cross-AZ WAL replication\n- **Extension System** — Pluggable algorithm, full-text search, vector similarity, and JSON extensions\n- **Language Bindings** — Python (PyO3) and Node.js (NAPI-rs) client libraries\n\n## Performance\n\nAll benchmarks run on Apple M-series silicon using Criterion 0.5 with `opt-level = 3`, LTO, and single codegen unit. Datasets follow the LDBC Social Network Benchmark schema.\n\n### Query Execution\n\n| Operation | 1K rows | 10K rows | 100K rows |\n|---|---:|---:|---:|\n| Sequential scan (fixed-size) | 0.37 ms | 1.18 ms | 5.06 ms |\n| Sequential scan (variable-size) | 0.38 ms | 1.48 ms | 2.74 ms |\n| Scan + filter | 0.41 ms | 0.52 ms | 2.46 ms |\n| Aggregation (GROUP BY + COUNT) | 0.34 ms | 1.02 ms | 8.11 ms |\n| Order by + LIMIT | 0.32 ms | 1.32 ms | 12.19 ms |\n| Multi-operator pipeline | 0.31 ms | 0.79 ms | 6.51 ms |\n| Expression evaluation | 0.35 ms | 1.34 ms | 8.76 ms |\n\n### JIT vs Batch vs Scalar Evaluation (100K rows)\n\n| Expression | Scalar | Batch | JIT | Speedup (JIT vs Scalar) |\n|---|---:|---:|---:|---:|\n| Filter `col \u003e N/2` | 2.33 ms | 0.15 ms | 0.10 ms | **22.3x** |\n| Compound predicate | 12.24 ms | 0.66 ms | 0.40 ms | **30.8x** |\n| Arithmetic projection | 3.75 ms | 2.22 ms | 0.18 ms | **21.0x** |\n\n### Graph Algorithms\n\n| Algorithm | 100 nodes | 1K nodes | 10K nodes |\n|---|---:|---:|---:|\n| PageRank | 0.03 ms | 0.33 ms | 3.58 ms |\n| Weakly Connected Components | 0.04 ms | 0.40 ms | 4.43 ms |\n| Betweenness Centrality | 0.81 ms | 67.94 ms | — |\n\n### Data Ingestion\n\n| Operation | Latency / Throughput |\n|---|---:|\n| Single row insert | 0.34 ms |\n| Bulk load 1K rows | 0.77 ms |\n| Bulk load 10K rows | 6.85 ms |\n| Bulk load 100K rows | 65.04 ms (1.54M rows/sec) |\n\n### Storage Micro-Benchmarks\n\n| Operation | 10K elements | 100K elements |\n|---|---:|---:|\n| FlatVector random access | 39.0 µs | 380.1 µs |\n| DataChunk iteration (5 cols) | 58.6 µs | 284.2 µs |\n| SelectionVector filter (10%) | 4.8 µs | 53.8 µs |\n| SelectionVector filter (50%) | 26.5 µs | 239.7 µs |\n\n### Recursive Joins (Variable-Length Paths)\n\n| Hops | 100 nodes | 1K nodes | 10K nodes |\n|---|---:|---:|---:|\n| 1–2 hops | 0.50 ms | 2.31 ms | 24.71 ms |\n| 1–3 hops | 0.55 ms | 3.18 ms | 33.40 ms |\n\n## Optimization Approach\n\nKyuGraph employs a layered optimization strategy:\n\n**Storage layer.** Data is organized in fixed-size node groups with columnar layout for cache-efficient scans. A split buffer pool separates read and write workloads, and a clock-based eviction policy keeps hot pages resident. The CSR-compressed adjacency structure enables O(1) neighbor lookups.\n\n**Execution layer.** The vectorized engine processes data in batches of 2048 values through a morsel-driven pipeline. Selection vectors avoid materializing intermediate results during filtering. A three-tier expression evaluator routes predicates through tree-walking interpretation, pattern-matched batch evaluation, or Cranelift-compiled native code depending on query complexity and expected cardinality.\n\n**Planning layer.** The cost-based optimizer derives table statistics from catalog metadata and applies selectivity heuristics (equality: 1/NDV, range: 1/3, conjunction: product, disjunction: inclusion-exclusion) to estimate cardinalities. Join reordering swaps build and probe sides of hash joins to minimize the size of hash tables built in memory.\n\n**Cloud layer.** For distributed deployments, the storage layer abstracts over local and remote page stores. An S3-backed page store provides elastic capacity, a write-through NVMe disk cache reduces read latency, and a cloud WAL replicates committed segments to a remote sink for cross-AZ durability.\n\n## Quick Start\n\n### Rust\n\n```rust\nuse kyu_api::Database;\n\nfn main() {\n    let db = Database::in_memory();\n    let conn = db.connect();\n\n    // Create schema\n    conn.query(\"CREATE NODE TABLE Person (id INT64, name STRING, age INT64, PRIMARY KEY (id))\")\n        .unwrap();\n    conn.query(\"CREATE NODE TABLE City (id INT64, name STRING, PRIMARY KEY (id))\")\n        .unwrap();\n    conn.query(\"CREATE REL TABLE LIVES_IN (FROM Person TO City)\")\n        .unwrap();\n\n    // Insert data\n    conn.query(\"CREATE (p:Person {id: 1, name: 'Alice', age: 30})\").unwrap();\n    conn.query(\"CREATE (p:Person {id: 2, name: 'Bob', age: 25})\").unwrap();\n    conn.query(\"CREATE (c:City {id: 1, name: 'Tokyo'})\").unwrap();\n\n    // Query\n    let result = conn.query(\"MATCH (p:Person) WHERE p.age \u003e 20 RETURN p.name, p.age\").unwrap();\n    for row in result.iter_rows() {\n        println!(\"{:?}\", row);\n    }\n\n    // Persistent database (survives restart)\n    let db = Database::open(std::path::Path::new(\"./my_graph\")).unwrap();\n    let conn = db.connect();\n    conn.query(\"CREATE NODE TABLE Log (id INT64, msg STRING, PRIMARY KEY (id))\").unwrap();\n    // Data is checkpointed to disk on drop\n}\n```\n\n### Python\n\n```bash\npip install kyugraph\n```\n\n```python\nimport kyugraph\n\n# In-memory database\ndb = kyugraph.Database()\nconn = db.connect()\n\n# Create schema\nconn.execute(\"CREATE NODE TABLE Person (id INT64, name STRING, age INT64, PRIMARY KEY (id))\")\nconn.execute(\"CREATE NODE TABLE City (id INT64, name STRING, PRIMARY KEY (id))\")\nconn.execute(\"CREATE REL TABLE LIVES_IN (FROM Person TO City)\")\n\n# Insert data\nconn.execute(\"CREATE (p:Person {id: 1, name: 'Alice', age: 30})\")\nconn.execute(\"CREATE (p:Person {id: 2, name: 'Bob', age: 25})\")\nconn.execute(\"CREATE (c:City {id: 1, name: 'Tokyo'})\")\n\n# Query\nresult = conn.query(\"MATCH (p:Person) WHERE p.age \u003e 20 RETURN p.name, p.age\")\nprint(result.column_names())  # ['p.name', 'p.age']\nfor row in result:\n    print(row)  # ['Alice', 30], ['Bob', 25]\n\n# Bulk load from CSV / Parquet\nconn.execute(\"COPY Person FROM 'people.csv'\")\n\n# Persistent database\ndb = kyugraph.Database(\"/path/to/my_graph\")\n```\n\n### Node.js\n\n```bash\nnpm install kyugraph\n```\n\n```javascript\nconst { Database } = require('kyugraph');\n\n// In-memory database\nconst db = new Database();\nconst conn = db.connect();\n\n// Create schema\nconn.execute(\"CREATE NODE TABLE Person (id INT64, name STRING, age INT64, PRIMARY KEY (id))\");\nconn.execute(\"CREATE NODE TABLE City (id INT64, name STRING, PRIMARY KEY (id))\");\nconn.execute(\"CREATE REL TABLE LIVES_IN (FROM Person TO City)\");\n\n// Insert data\nconn.execute(\"CREATE (p:Person {id: 1, name: 'Alice', age: 30})\");\nconn.execute(\"CREATE (p:Person {id: 2, name: 'Bob', age: 25})\");\nconn.execute(\"CREATE (c:City {id: 1, name: 'Tokyo'})\");\n\n// Query\nconst result = conn.query(\"MATCH (p:Person) WHERE p.age \u003e 20 RETURN p.name, p.age\");\nconsole.log(result.columnNames());  // ['p.name', 'p.age']\nfor (const row of result.toArray()) {\n    console.log(row);  // ['Alice', 30], ['Bob', 25]\n}\n\n// Persistent database\nconst pdb = new Database(\"/path/to/my_graph\");\n```\n\n## Examples\n\nThe [`crates/kyu-api/examples/`](crates/kyu-api/examples/) directory contains end-to-end examples showcasing KyuGraph's capabilities:\n\n| Example | Description | Run |\n|---|---|---|\n| [knowledge_graph](crates/kyu-api/examples/knowledge_graph.rs) | Builds a research paper knowledge graph with CSV bulk ingestion, full-text search, vector similarity, and PageRank | `cargo run -p kyu-api --example knowledge_graph` |\n| [filesystem_graph](crates/kyu-api/examples/filesystem_graph.rs) | Ingests a real codebase directory tree, extracts cross-crate Rust import dependencies, and runs content-aware analysis | `cargo run -p kyu-api --example filesystem_graph` |\n| [agent_explorer](crates/kyu-api/examples/agent_explorer.rs) | Simulates an autonomous AI agent that incrementally discovers knowledge — follows imports, then uses FTS and vector similarity to find emergent connections not in any import chain | `cargo run -p kyu-api --example agent_explorer` |\n\n## Building\n\n```bash\ncargo build --workspace\ncargo test --workspace\ncargo bench\n```\n\n## License\n\nKyuGraph is licensed under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foffbit-ai%2Fkyugraph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foffbit-ai%2Fkyugraph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foffbit-ai%2Fkyugraph/lists"}