deniz.in

Markets

Weather

Loading weather

· via Hacker News – Front Page (native)

Minigraf launches single-file bi-temporal graph database in Rust with Datalog queries

A new open-source Rust project on Hacker News embeds a bi-temporal graph database in a single file, with Datalog queries aimed at AI agents, mobile apps and the browser.

Minigraf launches single-file bi-temporal graph database in Rust with Datalog queries

Minigraf, a new open-source database written in Rust, was posted to Hacker News on October 5, 2026. According to the project's GitHub README, it is a self-contained graph database that stores connected data in a single file and keeps a complete, queryable record of its own history — a combination the authors describe as "the SQLite of bi-temporal graph databases."

A single file with two clocks

Minigraf keeps facts in entity-attribute-value form, and those triples are, in effect, the graph's edges. Opening a database amounts to a single constructor call against a .graph file, with no server process or setup step, and the project says the same file format works across native applications, WASM, mobile and IoT targets.

The defining feature is bi-temporality. Every fact carries two independent timestamps: transaction time, recording when the database learned it, and valid time, recording when it was true in the outside world. Queries can specify an :as-of transaction number, so an application can reconstruct precisely what the database believed at the moment of any past decision — and can correct a bad value later without destroying the original record.

Datalog at the core

The query language is Datalog rather than SQL or Cypher. The README lays out the case: recursion is built in, so multi-hop traversals need no special syntax; a small language specification is easier to implement correctly; time can be treated as just another dimension of a relation; and the approach has a long pedigree in Datomic and XTDB. The authors also make an explicitly practical argument — the grammar is small and uniform enough that AI coding assistants can generate correct queries from a few examples, and the entire language fits inside a system prompt.

Beyond plain pattern matching, the engine offers window functions — sum, count, min, max, avg, rank and row-number, with partition-by and order-by clauses inside :find — plus recursive rules for transitive reachability and prepared statements that are parsed and planned once, then executed repeatedly with bound values.

Broad bindings, uneven tiers

The current release is version 2.0.2 on crates.io and requires Rust 1.89 or newer. Rust and Python bindings are designated Tier 1, fully tested and released in lockstep with the core. A longer list of Tier 2 targets — browser WASM, WASI, Node.js, the JVM, Android, iOS/macOS and C — is described as experimental and maintained on a best-effort basis. There is also a browser-based visualizer that runs the database in a web page and lets users scrub both time axes to watch the graph change; it can open .graph files directly.

A known bug and a format break

The README is unusually frank about rough edges. Issue #371 means that when two values of the same attribute for one entity are written or retracted in a single call, they can read back as a single value; the workaround is to issue each write separately. The fix will change the on-disk format and arrive in version 3.0.0, after which version 2.x will receive data-integrity and security fixes for 12 months. The project reports 1,212 tests in its suite and points to a public roadmap for planned work.

Built for agents

The primary target is AI agent memory. The pitch is that an agent can store what it believes, revise those beliefs without losing history, and replay earlier states to audit why it acted as it did. The README suggests pairing Minigraf with a vector store in a GraphRAG arrangement — the vector store handles similarity, while Minigraf answers what the relationships were and what was believed at a given time — and points to a demo repository showing an agent doing temporal reasoning on top of the database.

Why it matters

Agent memory is an unsolved problem, and the bi-temporal model is one of the few credible answers to the audit question: when an autonomous system makes a bad call, you want to know exactly what it knew and when it knew it. Existing tools force trade-offs — SQLite is embedded but neither graph-native nor temporal, Neo4j is a server product without bi-temporal history, and XTDB offers Datalog and bi-temporality but not as a single-file Rust library. Those comparisons come from the project's own marketing table, so they deserve independent verification, and the project is clearly young: it launched via a Show HN post, ships with a known correctness bug, and has a file-format break scheduled. Even so, the combination it targets — embedded, single-file, graph-native, bi-temporal, with a query language sized for language models — is one no mainstream database currently claims, which is reason enough to watch where it goes.

  • #rust
  • #graph-database
  • #datalog
  • #open-source
  • #ai-agents

Related posts