Skip to main content
Latest Version: v7.15.0

Grafio

High-performance graph database with native Cypher support and pluggable storage

Pluggable Storage

Swap storage backends without changing application code. In-memory built-in, MongoDB available separately.

Cypher Queries

OpenCypher-compatible query language with aggregations, variable-length paths, and query plan inspection.

Multi-Hop Traversal

BFS and DFS traversal with type and property filtering. Find paths between any nodes.

Transaction Support

Atomic multi-operation updates with automatic rollback on failure.

Smart Caching

LRU/LFU/FIFO caching with budget enforcement. In-memory or Redis backends.

Graph Analysis

DAG validation, topological sorting, and Mermaid diagram export.

See Grafio in Action

Real-world use cases powered by Cypher queries

import { CypherEngine } from 'grafio';
import { InMemoryGraphFactory } from 'grafio/storage';

const graph = new InMemoryGraphFactory().forGraph('social');
const cypher = new CypherEngine(graph);

// Build graph
await cypher.execute(`
CREATE (alice:Person {name: 'Alice'}),
(bob:Person {name: 'Bob'}),
(charlie:Person {name: 'Charlie'})
`);

await cypher.execute(`
MATCH (a:Person {name: 'Alice'}), (b:Person {name: 'Bob'})
CREATE (a)-[:KNOWS]->(b)
`);

await cypher.execute(`
MATCH (a:Person {name: 'Bob'}), (b:Person {name: 'Charlie'})
CREATE (a)-[:KNOWS]->(b)
`);

// Query
const suggestions = await cypher.execute(`
MATCH (p:Person)-[:KNOWS]->(f)-[:KNOWS]->(s)
WHERE p.name = 'Alice' AND p <> s
RETURN s.name as suggested
`);
// Result: [{ suggested: 'Charlie' }]
TypeScript