GitHub - project-minigraf/minigraf: Embedded graph memory for AI agents, mobile apps, and the browser.
Pangram verdict · v3.3
We believe that this text is a mix of AI and human-written content.
AI likelihood · overall
MixedArticle text · 975 words · 7 segments analyzed
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. 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.2" 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 changes the file format and ships in v3.0.0. v2.x gets data-integrity and security fixes for 12 months after v3.0.0 ships. See the support policy. Quick Start use minigraf::{Minigraf, OpenOptions}; // Open or create a file-backed database let db = OpenOptions::new().path("myapp.graph").open()?; // Add facts db.execute(r#"(transact [[:alice :person/name "Alice"] [:alice :person/age 30] [:alice :friend :bob] [:bob :person/name "Bob"]])"#)?; // Query with Datalog let results = db.execute(r#" (query [:find ?friend-name :where [:alice :friend ?friend] [?friend :person/name ?friend-name]]) "#)?; // Explicit transaction — all-or-nothing let mut tx = db.begin_write()?; tx.execute(r#"(transact [[:alice :person/age 31]])"#)?; tx.commit()?; // Time travel — query as of past transaction counter db.execute("(query [:find ?age :as-of 1 :where [:alice :person/age ?age]])")?; // Recursive rule — transitive reachability db.execute(r#"(rule [(reachable ?a ?b) [?a :friend ?b]]) (rule [(reachable ?a ?b) [?a :friend ?m] (reachable ?m ?b)])"#)?; // Prepared statement — parse + plan once, execute many times use minigraf::BindValue; let pq = db.prepare("(query [:find ?name :as-of $tx :where [$entity :person/name ?name]])")?; let r1 = pq.execute(&[("tx", BindValue::TxCount(1)), ("entity", BindValue::Entity(alice_id))])?; let r2 = pq.execute(&[("tx", BindValue::TxCount(2)), ("entity", BindValue::Entity(bob_id))])?; cargo run # interactive Datalog REPL cargo test # run 1212 tests cargo run < demos/demo_recursive.txt # recursive rules demo Demo See a working implementation of temporal reasoning with Minigraf at github.com/adityamukho/temporal_reasoning — an AI agent that uses Minigraf's bi-temporal model to store, correct, and audit beliefs. The time travel visualizer runs Minigraf in your browser and draws its history. Step through transactions, move the valid-time cursor, and see each fact version on a bitemporal map. It opens .graph files too. For example, see a salary that was recorded wrong and then corrected.
See the Datalog Reference wiki page for the complete syntax. Why Minigraf? No other database offers this combination: Feature Minigraf XTDB Cozo Neo4j SQLite Query Language Datalog Datalog Datalog Cypher SQL Single File ✅ Yes ❌ No ❌ No ❌ No ✅ Yes Bi-temporal ✅ Yes ✅ Yes ⚠ Time travel ❌ No ❌ No Embedded ✅ Yes ✅ Yes ✅ Yes ❌ No ✅ Yes Graph Native ✅ Yes ✅ Yes ✅ Yes ✅ Yes ❌ No Rust ✅ Yes ❌ Clojure ✅ Yes ❌ Java ❌ C WASM Ready ✅ Yes (browser + WASI) ❌ No ⚠ Limited ❌ No ✅ Yes Platform support Platform Tier Package Install Rust (native) 1 minigraf on crates.io cargo add minigraf Python 1 minigraf on PyPI pip install minigraf Browser WASM 2 (experimental) @minigraf/browser on npm npm install @minigraf/browser WASI 2 (experimental) @minigraf/wasi on npm npm install @minigraf/wasi Node.js 2 (experimental) minigraf on npm npm install minigraf Java/JVM 2 (experimental) io.github.project-minigraf:minigraf-jvm on Maven Central see wiki Android 2 (experimental) io.github.project-minigraf:minigraf-android (.aar) on Maven Central see wiki iOS / macOS 2 (experimental) .xcframework via Swift Package Manager (minigraf-swift) see wiki C / FFI 2 (experimental) header + tarball on minigraf-c releases see wiki Tier 1 bindings are fully tested and released at the same time as every core release.
Tier 2 bindings are built and smoke-tested, released on a best-effort schedule, and experimental. A binding moves to Tier 1 when real users need it. Tier 1 operating systems and filesystems are Linux (ext4, xfs), macOS (APFS) and Windows (NTFS) on local disk; NFSv4 is supported with caveats, and NFSv3 nolock is unsupported for multiple writers.
Details: support tiers. Embedded graph memory for agents, mobile, and the browser — SQLite's simplicity + Datomic's temporal model. Language Bindings Language Package Repo Python minigraf on PyPI minigraf-python Node.js minigraf on npm minigraf-node Browser WASM @minigraf/browser on npm minigraf-wasm WASI @minigraf/wasi on npm minigraf-wasm Java io.github.project-minigraf:minigraf-jvm on Maven Central minigraf-java Android io.github.project-minigraf:minigraf-android on Maven Central minigraf-android iOS/macOS Swift bindings minigraf-swift C C bindings minigraf-c See the Comparison wiki page for detailed analysis including temporal vs. time-series databases.