StackMap
Subscribe
Explore / minigraf
project-minigraf

minigraf

Embedded single-file graph database in Rust with Datalog queries and bi-temporal time travel — 'SQLite for connected data with history' — running native, WASM, mobile and in the browser.

225 14 Rust Apache-2.0updated yesterday
View on GitHubDispute this mapping →
Curator's take

Use it when an agent or app needs local graph memory with full history (what was true, and when we learned it) in one file, no server. Skip it for vector/semantic recall (no embeddings), large multi-user workloads, or if Datalog is a non-starter; on v2.x, note the multi-valued-attribute bug and write each value in its own transact.

Mapped by ShipWithAI editors · links verified

Continue your stack

What teams reach for next — and why each earns a place beside minigraf. Ranked by curator confidence.

alternativealternativealternativelatticedboxigraphmemvidminigraf
pairs wellalternativebuilt withpick a node for the why · open it from the panel
Weekly digest
README.md2 min read

Minigraf

crates.io docs.rs Build Status Lint Status Coverage License: MIT OR Apache-2.0 Rust Edition MSRV

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 :find clauses
  • ✅ Prepared statements - Parse + plan once with $slot bind tokens, execute thousands of times
  • ✅ Embed anywhere - Native, WASM, mobile, IoT - one .graph file
  • ✅ 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:

  1. Recursive by design - Multi-hop traversals are natural, not an afterthought
  2. Simpler to implement - Smaller spec = more reliable, faster to production
  3. Perfect for temporal - Time is just another dimension in relations
  4. Proven at scale - 40+ years of research, production use (Datomic, XTDB)
  5. Graph-native - Facts (Entity-Attribute-Value) are literally edges
  6. 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 single retract) can read back as one value (#371). Write or retract each value of a multi-valued attribute in its own call. The fix