Skip to main content

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);

graph.addNode({ id: 'alice', label: 'Person', properties: { name: 'Alice' } });
graph.addNode({ id: 'bob', label: 'Person', properties: { name: 'Bob' } });
graph.addNode({ id: 'charlie', label: 'Person', properties: { name: 'Charlie' } });
graph.addEdge({ from: 'alice', to: 'bob', label: 'KNOWS' });
graph.addEdge({ from: 'bob', to: 'charlie', label: 'KNOWS' });

const suggestions = 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