hn.today

Show HN: Minigraf – An embedded, bi-temporal graph database in Rust

github.com27 points23 comments
Screenshot of Show HN: Minigraf – An embedded, bi-temporal graph database in Rust

Minigraf is a compact, single-file embedded graph database written in Rust that combines Datalog querying with a bi-temporal model (transaction time + valid time) to provide full history and time travel for connected data. It supports recursive Datalog rules for natural multi-hop traversals, prepared statements for repeated execution, SQL-style window functions in :find clauses, and explicit transactional semantics. Designed to be zero-config and portable, it runs natively, in WASM for browsers, on mobile, and via language bindings (Python, Node, Java, Swift, C), with a .graph file acting like SQLite for graph data. A browser-based visualizer demonstrates temporal queries by scrubbing transaction and valid time to reveal historical fact versions.

The project argues Datalog is a superior query language for graphs - recursive by design, simpler to implement, well-suited for temporal reasoning, and LLM-friendly - and targets use cases like AI agents (store beliefs, correct records, audit decisions), offline-first mobile apps with retroactive corrections, and embedded/edge systems. It compares feature-by-feature against databases like XTDB and Neo4j, outlines platform support tiers and bindings, and provides examples for opening a DB, transacting facts, time-travel queries, and prepared statements. Known issues are tracked (notably a multi-valued-attribute write bug fixed in v3.0.0) and the project is released under MIT/Apache-2.0 with Rust MSRV 1.89+.

Read on github.com23 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Other

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.