Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
G

grafeo

> 后端框架
Open source

Grafeo is a pure-Rust, high-performance graph database that can be embedded as a library or run as a standalone database, with optional in-memory or persistent

721 stars0 likes1 views
WebsiteGitHub

About

Grafeo is a pure-Rust, high-performance graph database that can be embedded as a library or run as a standalone database, with optional in-memory or persistent

Grafeo

Grafeo is a graph database built in Rust from the ground up for speed and low memory use. It runs embedded as a library or as a standalone server, with in-memory or persistent storage and full ACID transactions.

In our graph-bench suite (which includes workloads inspired by the LDBC Social Network Benchmark), Grafeo is the fastest tested graph database in both embedded and server configurations, while using a fraction of the memory of some of the alternatives. Grafeo supports both Labeled Property Graph (LPG) and Resource Description Framework (RDF) data models and all major query languages.

Features

Core Capabilities

  • Dual data model support: LPG and RDF with optimized storage for each
  • Multi-language queries: GQL, Cypher, Gremlin, GraphQL, SPARQL and SQL/PGQ
  • Embeddable with zero external dependencies: no JVM, no Docker, no external processes
  • Multi-language bindings: Python (PyO3), Node.js/TypeScript (napi-rs), Go (CGO), C (FFI), C# (.NET 8 P/Invoke), Dart (dart:ffi), WebAssembly (wasm-bindgen)
  • In-memory and persistent storage modes
  • MVCC transactions with snapshot isolation

Query Languages

  • GQL (ISO/IEC 39075) with Unicode identifiers per spec
  • Cypher (openCypher 9.0)
  • Gremlin (Apache TinkerPop)
  • GraphQL
  • SPARQL (W3C 1.1) with SHACL validation and Ring Index WCOJ planner
  • SQL/PGQ (SQL:2023)
  • EXPLAIN / EXPLAIN ANALYZE across all six languages

Vector Search & AI

  • Vector as a first-class type: Value::Vector(Arc) stored alongside graph data
  • HNSW index: O(log n) approximate nearest neighbor search with tunable recall
  • Distance functions: Cosine, Euclidean, Dot Product, Manhattan (SIMD-accelerated: AVX2, SSE, NEON)
  • Vector quantization: Scalar (f32 → u8), Binary (1-bit) and Product Quantization (8-32x compression)
  • BM25 text search: Full-text inverted index with Unicode tokenizer and stop word removal
  • Hybrid search: Combined text + vector search with Reciprocal Rank Fusion (RRF) or weighted fusion
  • Change data capture: Before/after property snapshots for audit trails and history tracking
  • Hybrid graph+vector queries: Combine graph traversals with vector similarity in GQL and SPARQL
  • Memory-mapped storage: Disk-backed vectors with LRU cache for large datasets
  • Batch operations: Parallel multi-query search via rayon

Performance Features

  • Push-based vectorized execution with adaptive chunk sizing
  • Morsel-driven parallelism with auto-detected thread count
  • Block-STM conflict partitioning for parallel transaction re-execution
  • Columnar storage with dictionary, delta and RLE compression
  • Cost-based optimizer with DPccp join ordering and histograms
  • Zone maps for intelligent data skipping (including vector zone maps)
  • Adaptive query execution with runtime re-optimization
  • Transparent spilling for out-of-core processing
  • Streaming execution for large result sets without buffering
  • Bloom filters for efficient membership tests
  • Writable layered compact store: columnar base with mutable overlay, recompact() to merge

Security

  • Encryption at rest (encryption feature): AES-256-GCM for WAL records and .grafeo sections, password-based (Argon2id) or raw-key setup
  • Role-based access control: Admin, ReadWrite, ReadOnly roles enforced across all six query languages
  • Per-graph access grants: scope an identity's access to specific named graphs
  • SHACL validation (shacl feature): W3C Shapes Constraint Language with all 28 Core constraint types and SHACL-SPARQL
  • Resource limits: query timeouts, property size caps, HNSW max_elements bound

Operations & Observability

  • Incremental backup and point-in-time recovery: backup_full, backup_incremental, restore_to_epoch
  • Prometheus metrics (metrics feature): query, transaction, session, cache, and GC counters with text export
  • Change data capture: before/after property snapshots with epoch-bounded retention
  • Async storage (async-storage feature): non-blocking WAL and snapshot I/O via tokio
  • Tracing (tracing feature): opt-in observability spans and events
  • Bulk export: Arrow IPC, Polars, pandas, GEXF (Gephi), GraphML (Cytoscape, yEd, NetworkX)
  • Bulk import: CSV, JSONL, TSV, Matrix Market (MMIO), Turtle, N-Triples with streaming loaders

Benchmarks

Tested with graph-bench, which includes workloads inspired by the LDBC Social Network Benchmark. These are not official LDBC Benchmark results (see disclaimer).

Embedded (SF0.1, in-process):

Database SNB Interactive Memory Graph Analytics Memory
Grafeo 2,904 ms 136 MB 0.4 ms 43 MB
LadybugDB(Kuzu) 5,333 ms 4,890 MB 225 ms 250 MB
FalkorDB Lite 7,454 ms 156 MB 89 ms 88 MB

Server (SF0.1, over network):

Database SNB Interactive Graph Analytics
Grafeo Server 730 ms 15 ms
Memgraph 4,113 ms 19 ms
Neo4j 6,788 ms 253 ms
ArangoDB 40,043 ms 22,739 ms

Full results: embedded | server

Query Language & Data Model Support

Query Language LPG RDF
GQL ✅ -
Cypher ✅ -
GraphQL ✅ ✅
Gremlin ✅ -
SPARQL - ✅
SQL/PGQ ✅ -

Grafeo uses a modular translator architecture where query languages are parsed into ASTs, then translated to a unified logical plan that executes against the appropriate storage backend (LPG or RDF).

Data Models

  • LPG (Labeled Property Graph): Nodes with labels and properties, edges with types and properties. Ideal for social networks, knowledge graphs and application data.
  • RDF (Resource Description Framework): Triple-based storage (subject-predicate-object) with SPO/POS/OSP indexes. Ideal for semantic web, linked data and ontology-based applications.

Installation

Rust

bash
cargo add grafeo

Grafeo uses persona-based feature profiles that describe use cases. Compose them freely:

…
Profile Contents Use case
lpg GQL, AI, algorithms, parallel Default for libraries and apps
rdf SPARQL, triple-store, ring-index Knowledge graphs, linked data
analytics Algorithms, parallel Graph analytics pipelines
ai Vector, text, hybrid search, CDC RAG, semantic search
edge GQL, compact, regex-lite WASM, resource-constrained
enterprise Metrics, tracing, async I/O Platform operators, observability

Node.js / TypeScript

bash
npm install @grafeo-db/js

Go

bash
go get github.com/GrafeoDB/grafeo/crates/bindings/go

WebAssembly

bash
npm install @grafeo-db/wasm

C# / .NET

bash
dotnet add package Grafeo

Dart

yaml
# pubspec.yaml
dependencies:
  grafeo: ^0.5.42

Python

bash
pip install grafeo
# or with uv
uv add grafeo

With CLI support:

bash
pip install grafeo[cli]
# or with uv
uv add grafeo[cli]

Quick Start

Node.js / TypeScript

…

Python

…

Admin APIs (Python)

…

Rust

rust
use grafeo::GrafeoDB;

fn main() {
    // Create an in-memory database
    let db = GrafeoDB::new_in_memory();

    // Or open a persistent database
    // let db = GrafeoDB::open("./my_database").unwrap();

    // Execute GQL queries
    db.execute("INSERT (:Person {name: 'Alix'})").unwrap();

    let result = db.execute("MATCH (p:Person) RETURN p.name").unwrap();
    for row in result.rows() {
        println!("{:?}", row);
    }
}

Vector Search

…

Command-Line Interface

Optional admin CLI for operators and DevOps:

…

Ecosystem

Project Description
grafeo-server HTTP server & web UI: REST API, transactions, single binary (~40MB Docker image)
grafeo-web Browser-based Grafeo via WebAssembly with IndexedDB persistence
gwp GQL Wire Protocol: gRPC wire protocol for GQL (ISO/IEC 39075) with client bindings in 5 languages
boltr Bolt Wire Protocol: pure Rust Bolt v5.x implementation for Neo4j driver compatibility
grafeo-langchain LangChain integration: graph store, vector store, Graph RAG retrieval
grafeo-llamaindex LlamaIndex integration: PropertyGraphStore, vector search, knowledge graphs
grafeo-mcp Model Context Protocol server: expose Grafeo as tools for LLM agents
grafeo-memory AI memory layer for LLM applications: fact extraction, deduplication, semantic search
anywidget-graph Interactive graph visualization for Python notebooks (Marimo, Jupyter, VS Code, Colab)
anywidget-vector 3D vector/embedding visualization for Python notebooks
playground Interactive browser playground: query in 6 languages, visualize graphs, explore schemas
graph-bench Benchmark suite comparing graph databases across 65 LDBC-inspired and custom benchmarks
ann-benchmarks Fork of ann-benchmarks with a Grafeo HNSW adapter for vector search benchmarking

Documentation

Full documentation is available at grafeo.dev.

Contributing

See CONTRIBUTING.md for development setup and guidelines.

Sponsors

Thank you to the people and organizations supporting Grafeo's development:

  • Thibaut Mélen from Supernovae

Acknowledgments

Grafeo's execution engine draws inspiration from:

  • DuckDB, vectorized push-based execution, morsel-driven parallelism
  • Kuzu, CSR-based adjacency indexing, factorized query processing

License

Apache-2.0

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Rustcyphergqlgrafeografeodb

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category后端框架
PricingOpen source

> Related tools

N
Node.js
基于 V8 的 JavaScript 运行时
D
Django
Python 高级 Web 框架
S
Spring Boot
Java 生态主流微服务框架