Skip to content

Crystal Graph Engine

Crystal is a lightweight, extendable, lightning-fast graph engine written in Go.

It is a property graph database designed for investigation and intelligence mapping (in the spirit of Maltego) and for narrative design (in the spirit of Articy Draft). The core engine has zero external dependencies and ships as a single binary.

Licensed under Apache 2.0 with Commons Clause.

Three ways to run it

Crystal exposes the same storage engine through three interfaces — a REST server, a CLI client, and an embeddable Go library.

Docker

docker compose up -d

The API is then available at http://localhost:7540.

From source

go build -o crystal ./cmd/crystal
./crystal --data-dir ./data --port 7540

CLI

go build -o crystal-cli ./cmd/crystal-cli
export CRYSTAL_URL=http://localhost:7540

crystal-cli vertex create Person name=Alice age:=30
crystal-cli vertex create Server ip=10.0.0.1
crystal-cli edge create $ALICE_ID $SERVER_ID accessed port:=443
crystal-cli bfs $ALICE_ID --depth 3
crystal-cli export graph.json

As a library

import "crystal/pkg/crystal"

db, err := crystal.Open(crystal.Options{
    StorageType: "disk",
    DataDir:     "./mydata",
})
defer db.Close()

person, _ := db.AddVertex("Person", crystal.Properties{"name": "Alice"})
server, _ := db.AddVertex("Server", crystal.Properties{"ip": "10.0.0.1"})
db.AddEdge(person.ID, server.ID, "accessed", crystal.Properties{"port": 443})

Documentation