NEDB Docs / Getting started

NEDB is an embedded, tamper-evident database built on a BLAKE2b hash chain and a content-addressed Merkle DAG. It stores four things about every fact: what it is, when it was written, when it was true in the world, and why it happened — and it can prove all four, offline, to a third party.

What it guarantees

  • Nothing is ever overwritten. Every write is a new immutable version; deletes are tombstones. History is permanent unless an operator explicitly compacts it.
  • Tamper is detectable, not just unlikely. Every object is BLAKE2b-verified on read; verify() walks the chain; a single flipped byte changes the verdict to false.
  • Causality is data. A write can cite the writes that caused it (caused_by), and TRACE walks that graph in both directions as a query.
  • Provenance costs speed, not correctness. Time-travel reads run at ~70% of current-state read speed.
  • One core, three languages, one version. Python, Node and Rust all bind the same Rust engine; PyPI, npm and crates.io publish in lockstep from a single git tag.
  • You query it in SQL. neSQL inherits PostgreSQL's grammar whole and extends it with the clauses a permanent store can answer — you don't learn a new query language, you learn the additions.

Five-minute start

pip install nedb-engine      # pure-Python core + native Rust wheel when available
from nedb import NEDB

db = NEDB("./mydata")                      # durable, hash-chained
db.put("users", "alice", {"name": "Alice", "age": 31})

db.query('SELECT * FROM users WHERE age > 30')   # PostgreSQL SQL — the daemon speaks it
db.query('FROM users WHERE age > 30')            # the extended FROM-form (embedded cores)
db.head                                     # the 64-char BLAKE2b Merkle head
db.verify()                                 # True — the chain is intact

From there: the query language — standard PostgreSQL SQL plus NEDB's temporal and causal clauses — time travel and provenance, and the wire protocols your tools already speak.

Who this is for

Audit-shaped workloads: agent memory where every belief must trace to its evidence, blockchain state (a Bitcoin-fork node runs its chainstate on NEDB), compliance trails, ledgers, RAG pipelines where a fact must be citable to its source. If a fact matters and someone may someday ask you to prove it — that is the lane.

License

BUSL-1.1: free for any organisation under USD $1M annual revenue, including commercial and production use, no permission needed. Converts to Apache 2.0 automatically on 2030-09-11. Versions 3.0.0–3.3.1 remain MIT, irrevocably.