Minigraf
Embedded graph memory for AI agents, mobile apps, and the browser — the SQLite of bi-temporal graph databases
A tiny, self-contained graph database with Datalog queries and bi-temporal time travel. Think SQLite, but for connected data with full history.
Try it in your browser — no install needed →
Watch time travel in the visualizer → Scrub transaction time and valid time, and see the graph change.
Vision
Minigraf is a single-file embedded graph database that lets you:
- ✅ Query relationships with Datalog - Recursive rules, natural graph traversal
- ✅ Time travel through history - Bi-temporal queries (transaction time + valid time)
- ✅ Window functions -
sum/count/min/max/avg/rank/row-number :over (partition-by … :order-by …)in:findclauses - ✅ Prepared statements - Parse + plan once with
$slotbind tokens, execute thousands of times - ✅ Embed anywhere - Native, WASM, mobile, IoT - one
.graphfile - ✅ Zero configuration - Just
Minigraf::open("data.graph")and you're done
Status: See ROADMAP.md for planned work and current direction.
In v2, the ordinary aggregates are count, count-distinct, sum, sum-distinct, min and max. Average is available only as a window function, for example (avg ?score :over (:order-by ?score)) (#777).
Why Datalog?
Datalog is fundamentally better for graphs than SQL-like languages:
- Recursive by design - Multi-hop traversals are natural, not an afterthought
- Simpler to implement - Smaller spec = more reliable, faster to production
- Perfect for temporal - Time is just another dimension in relations
- Proven at scale - 40+ years of research, production use (Datomic, XTDB)
- Graph-native - Facts (Entity-Attribute-Value) are literally edges
- LLM-friendly - The small, uniform grammar (
[?e :attr ?v]patterns, no JOIN variants, no subquery nesting) is easy for AI coding assistants to generate correctly from a few examples; the entire language fits in a system prompt
Installation
[dependencies]
minigraf = "2.0.11"
Or via cargo:
cargo add minigraf
Requires Rust 1.89 or newer (the minimum supported Rust version, set in Cargo.toml).
Known issues
Bugs present in the current release, with affected versions, workarounds and fix versions, are listed in the pinned Known issues in the current release issue. The most important one on v2.x:
- Two values of the same attribute for one entity written in a single
transact(or retracted in a singleretract) can read back as one value (#371). Write or retract each value of a multi-valued attribute in its own call. The fix