OMGDB is an embedded, single-file, serverless document database with a MongoDB-compatible single-node API. It deploys like SQLite — one path on disk, no server to run — and it is built so an LLM agent can create, understand, debug, and drive it without any external service.
The defining idea: the on-disk source of truth is an append-only, human- and LLM-readable NDJSON
operation log (oplog.ndjson) that you can cat. Every index, vector record, and cache is a
derived, rebuildable artifact that holds zero authoritative bits. Because the truth is plain
text, the database can explain, verify, and repair itself.
omgdb create app.omgdb
omgdb insert app.omgdb users '{"name":"ada","age":36}'
omgdb find app.omgdb users '{"age":{"$gte":30}}'
omgdb describe app.omgdb # a Markdown manual of the live DB
omgdb verify app.omgdb # re-reads the log and proves it reproduces the state
$ cat app.omgdb/oplog.ndjson
{"lsn":0,"ts":{"$date":...},"op":"insert","ns":"users","id":{"$oid":"..."},"doc":{...}} 7556c941
Status — early project (v0.0). The durability and codec layers are hardened (crash recovery, a
repairtool, a bit-exact canonical codec proven by a property test, a crash-truncation matrix, and Linux/Windows/macOS + MSRV CI), but OMGDB is not yet production-ready at scale. See Install & build for the honest list of current limitations.
The three invariants
OMGDB’s thesis is testable, not just a slogan. Three named invariants are enforced and property-tested:
| Invariant | Claim |
|---|---|
| I1 — Text completeness | oplog.ndjson fully determines the logical state; caches and indexes hold zero authoritative bits. |
| I2 — Rebuild equivalence | Delete every derived artifact and rebuild from the log → identical query-visible behavior (same results, same order). Byte-identical binary rebuild is an explicit non-goal. |
| I3 — Export stability | Canonical export is deterministic: dump → load → dump is byte-identical. This is the headline, property-tested claim. |
What’s in the box
OMGDB is a single store that natively combines layers most stacks bolt together:
- Document database — a MongoDB-style value model with a bit-exact canonical codec.
- Query engine —
$eq/$gt/$in/$regex/$elemMatch/…, dotted paths, projection. - Update operators —
$set/$inc/$push/$addToSet/…with overflow-safe semantics. - Aggregation pipeline —
$match/$group/$lookup/$facet/$unwindplus an expression engine. - Indexes — ordered secondary indexes for equality, range, and multikey predicates.
- Schema validation — declarative per-collection rules enforced on insert.
- Transactions & durability — ACID, single-writer snapshot isolation, crash recovery, compaction.
- Vector search — a pluggable embedder, flat cosine kNN, hybrid search, persisted/synced vectors.
- Context packs — token-budgeted, cited retrieval bundles for LLM tasks.
- Native Markdown — import
.mdinto typed frontmatter fields and a section tree. - Introspection —
describe,dump,verify,explain,diagnose. - Agent-safe mutations — dry-run
plan-update,applyby token,rollback. - MCP server — expose the engine to agents as JSON-RPC tools with enforced capability scopes.
How you talk to it
There are two real surfaces today, both fully inspectable:
- The
omgdbCLI — 26 subcommands covering CRUD, query, aggregation, introspection, durability, vectors, and the MCP server. See the CLI reference. - The MCP server (
omgdb mcp) — a stdio JSON-RPC 2.0 server exposing the engine as agent-callable tools withread/read-write/dangerouscapability scopes. See MCP server.
A native TypeScript/Node binding is on the roadmap but not implemented yet — the programmatic surface today is the Rust crates, the CLI, and the MCP server.
Architecture at a glance
OMGDB is a Cargo workspace of eight focused crates. See Architecture for the full map.
| Crate | Responsibility |
|---|---|
omgdb-core | Value model, canonical codec, op-log, replay, transactions, indexes, compaction, verify |
omgdb-query | Filter compilation & matching, value ordering, projection, explain, diagnose |
omgdb-agg | Aggregation pipeline: stage dispatch + expression engine |
omgdb-change | Agent-safe mutations: dry-run plans, apply-by-token, rollback |
omgdb-introspect | Schema inference, describe (live Markdown manual), dump |
omgdb-md | Native Markdown parsing (frontmatter + section tree) |
omgdb-vector | Pluggable embedder, flat cosine kNN, hybrid search, context packs |
omgdb-cli | The omgdb binary + the MCP server |
Next steps
New here? Start with Install & build, then walk the Quickstart from an empty folder to an agent-ready database.