Layered like baklava.
Linked like a graph.
graphlava is an embedded metagraph database in Rust, built for agent memory. Statements carry statements, hyperedges are stored once, and graphs nest inside graphs, all in one file, queried with SPARQL 1.2 and Datalog.
Status: design. The specifications, 30 decision records and the Rust workspace with CI for Linux, macOS, Windows, iOS and Android exist. The engine does not exist yet: nothing on this site can be downloaded and run today. In the specs the project is still called by its working name, meta-core.
One piece, four layers
Read the logo from the outside in. The pastry layers are statements stacked on statements. The diamond is a graph that holds them. The pistachio is a hyperedge: one centre, many roles.
Statements about statements
Every statement has a stable 64-bit ID. Annotate it with a confidence or a source; change its object and the ID, with its annotations, stays.
Hyperedges
A meeting with an agent, a target and a topic is one record with typed roles, indexed per role; its date is a property of the record. Role triples stay virtual until you annotate one.
Nested graphs
Graphs are nodes and nest as a DAG. GRAPH :g sees g and everything under it; GRAPH! :g sees only g.
Meta-model as data
Predicates, hyperedge types, shapes and rules are statements in the system graph, read by the planner and the write path.
A taste
The statement ID is the RDF 1.2 reifier, so annotating a fact and reading the annotation back are plain scans with no join on rdf:reifies.
# a fact with a confidence on it
INSERT DATA { :alice :worksAt :acme {| :confidence 0.9 |} }
# who works at Acme, and how sure are we?
SELECT ?who ?c WHERE {
<< ?who :worksAt :acme ~ ?r >> .
?r :confidence ?c .
FILTER(?c > 0.8)
}
# the same memory from Datalog: rules run on demand in v0; @materialized arrives in v1
@materialized
ancestor(?x, ?y) :- :parent(?x, ?y) .
ancestor(?x, ?z) :- ancestor(?x, ?y), :parent(?y, ?z) .
?- ancestor(:alice, ?who) .
How it stacks
One process, one file. Every query language lowers to one extended-Datalog IR; only the storage layer knows the engine.
A sibling, not a fork
graphlava and tiramemsu share the idea that every fact is a statement with an ID. They split on time.
| graphlava | tiramemsu | |
|---|---|---|
| State | Current state only; values overwrite in place | Never forgets; every change kept with two clocks |
| Change a fact | update(id, o), same ID | supersede, a new statement that replays its layers |
| n-ary relations | Native hyperedge records | A node with role statements, or an annotated edge |
| Storage | redb | SQLite (default) or redb |
| Status | Design | Released, 0.12 |
More in graphlava and tiramemsu.
Read
Mini book: hypergraphs and metagraphs in statement graphs
From binary edges to recursive metagraphs, and how to model each part with statements and in graphlava.
Statement graphs
The one data model under RDF, RDF-star and property graphs, and how graphlava stores it.
graphlava and tiramemsu
Two stores from one idea: mutable current state versus layered, never-forget memory.
graphlava and Neptune OneGraph
What an embedded store takes from Amazon's 1G model, and where it goes its own way.