OMGDB
// THE PROBLEM

Agents should not have to guess your database.

Most databases were designed for apps, admins, and query engines. AI agents need more: schema context, query explanations, safe mutations, semantic retrieval, and structured errors they can repair from.

?"Where is the schema?"
?"Why did this query return nothing?"
?"Which docs explain this feature?"
?"Can I change this safely?"
?"Are these embeddings stale?"
// WHAT OMGDB DOES

One local store. Six native layers.

01

Document Database

Flexible JSON-like documents, Mongo-style filters, aggregation, validation, and transactions.

02

Markdown Knowledge

Import docs, specs, notes, and AGENTS.md-style project context as structured, queryable documents.

03

Full-Text Search

Typed BM25 search with stemming, fuzzy matching, weighted fields, and highlighted snippets — the index definition lives in the op-log like everything else.

04

Vector Search

Generate and search embeddings locally, with provenance and stale-state tracking — and hybrid ranking that fuses text and semantic scores.

05

Agent Debug APIs

describe, inspect, explain, validate, dry-run, rollback, and query debugging built into the database.

06

MCP Native

Expose database tools directly to coding agents through a first-class MCP surface.

// DEMO WORKFLOW

From empty folder to agent-ready database.

~/demo — real session
STEP 1/7 CREATE
$ omgdb create app.omgdb
created store at app.omgdb

One command, one directory. No server to start, nothing to configure.

STEP 2/7 INSERT
$ omgdb insert app.omgdb users {"name":"ada","age":36,"role":"admin"}
{"$oid":"6a54f45689b9f58fd8000000"}

$ omgdb insert app.omgdb users {"name":"lin","age":29,"role":"dev"}
{"$oid":"6a54f456311680eac8000000"}

Mongo-style documents in, ObjectIds back.

STEP 3/7 FIND
$ omgdb find app.omgdb users {"age":{"$gte":30}}
{"_id":{"$oid":"6a54f45689b9f58fd8000000"},"name":"ada","age":36,"role":"admin"}

Familiar filter operators, straight from the CLI.

STEP 4/7 READ THE LOG
$ cat app.omgdb/oplog.ndjson
{"lsn":0,"ts":{"$date":1783952470530},"op":"insert","ns":"users","id":{"$oid":"6a54f45689b9f58fd8000000"},"doc":{"_id":{"$oid":"6a54f45689b9f58fd8000000"},"name":"ada","age":36,"role":"admin"}}	c1c4258b
{"lsn":1,"ts":{"$date":1783952470766},"op":"insert","ns":"users","id":{"$oid":"6a54f456311680eac8000000"},"doc":{"_id":{"$oid":"6a54f456311680eac8000000"},"name":"lin","age":29,"role":"dev"}}	4a8f984f

The single source of truth is an append-only NDJSON op-log, one checksummed record per line. cat is a debugger.

STEP 5/7 UPDATE
$ omgdb update-one app.omgdb users {"name":"lin"} {"$set":{"role":"lead"}}
{"matchedCount":1,"modifiedCount":1}

Immediate Mongo-style updates, atomic and fail-closed. The change appends a replace record inside a transaction frame — the log keeps history, not overwrites.

STEP 6/7 DELETE THE CACHES
$ rm app.omgdb/*.cache   # delete every derived cache
$ omgdb find app.omgdb users {"role":"admin"}
{"_id":{"$oid":"6a54f45689b9f58fd8000000"},"name":"ada","age":36,"role":"admin"}

Every index and cache is derived and disposable. Delete them all — the database rebuilds from the log and answers anyway.

STEP 7/7 VERIFY
$ omgdb verify app.omgdb
OK: 5 record(s), 2 document(s) in 1 collection(s); log reproduces state
metadata cache: OK (0 collection spec(s), 0 index definition(s), derived)
metadata checkpoint+tail: OK (0 tail record(s), derived)
primary _id cache: OK (2 entry(s), derived)
primary _id checkpoint+tail: OK (0 tail record(s), derived)
secondary index cache: OK (0 index(es), 0 bucket(s), derived)
live document cache: OK (2 document(s), derived)
document checkpoint+tail: OK (0 tail record(s), derived)

verify re-proves the entire database — every record, every derived cache — and attests each one.

captured from a real session, omgdb 0.0.0

// AGENT-NATIVE

Built for tools that think before they write.

Self-Describing

Produces an agent-readable manual of its collections, schemas, indexes, vector state, and constraints.

Why-No-Results

Debug empty queries by showing which predicate failed and what nearby values exist.

Dry-Run Mutations

Preview changes before applying. Show matched documents, before/after samples, and risk notes.

Undoable Changes

Track agent writes with provenance and rollback metadata.

Context Packs

Return token-budgeted context for the model instead of dumping raw documents.

// HOW IT COMPARES

No benchmark theater. Honest trade-offs.

These are different tools with different contracts. Here is where OMGDB actually sits — including what it does not do yet.

VS SQLITE + JSON1

Same deployment model: an embedded library and a local file. No server, no daemon, no port.

A document-native API and an op-log you can read with cat — not JSON strings inside opaque binary pages.

! At raw scan scale, mature engines are still faster today.

VS MONGODB

The familiar query surface — insert, find, update operators, aggregation pipelines — without running a server.

The whole database is one directory you can copy, diff, and back up like any other file.

! No replication, no sharding. This is an embedded store, not a cluster.

VS VECTOR DATABASES

Vectors live next to the documents that produced them, with provenance and staleness tracking. No second service to keep in sync.

Semantic search, filters, and context packs come from the same store that holds the source documents.

! Flat exact kNN today — no ANN index yet.

// DEVELOPER API

One database. CLI, TypeScript, Python.

$ omgdb describe app.omgdb
# collections, inferred schema, indexes, samples →

$ omgdb verify app.omgdb
# re-reads the log, proves it reproduces state →

$ omgdb diagnose app.omgdb users '{"role":"admin","age":{"$gt":90}}'
# why-no-results: predicate age > 90 eliminated all →
// @omgdb/client — real driver protocol, not CLI parsing. In final testing;
// ships with the first public release. ESM + CommonJS, zero runtime deps.
import { OmgdbClient } from "@omgdb/client";

await using db = await OmgdbClient.connect("./data", { scope: "read-write" });
const users = db.collection<{ name: string; age: number }>("users");

await users.insertOne({ name: "Ada", age: 36 });
await users.updateOne({ name: "Ada" }, { $set: { active: true } });
const rows = await users.find({ age: { $gte: 18 } }).toArray();

// one ordered program, one atomic commit — steps read earlier writes
await db.transaction([
  { operation: "insert", arguments: { collection: "users", document: { _id: 1, name: "Lin" } } },
  { operation: "replace", arguments: { collection: "users", id: 1, document: { _id: 1, name: "Lin Wu" } } },
]);
# omgdb for Python — sync and native-asyncio clients over the same versioned
# stdio driver protocol. In final testing; ships with the first public release.
from omgdb import OmgdbClient

with OmgdbClient("./app.omgdb", scope="read-write") as db:
    users = db.collection("users")
    inserted = users.insert_one({"name": "Ada", "age": 37})
    users.update_one({"name": "Ada"}, {"$set": {"active": True}})

    with users.find({"age": {"$gte": 18}}, batch_size=100) as cursor:
        for user in cursor:
            print(user)

# async? AsyncOmgdbClient — same API, native asyncio subprocess.
// TECHNICAL CREDIBILITY

Readable by default. Fast when it matters.

50K DOCS
loaded in about 2 seconds with import-jsonl.
~1 SEC
for verify to re-prove the entire database — every record, every derived cache — at 50,000 documents.
0.22 MS
measured indexed lookup, in-process — well under a millisecond.
FSYNC
durable writes are fsync-bound — the same physical wall every embedded database hits.
canonical NDJSON operation log
rebuildable in-memory indexes
deterministic dumps
crash recovery
local embeddings
Markdown section indexing
vector provenance
MCP tool schemas
ACID transactions
range & multikey indexes
full-text search (BM25)
filter-based updates & bulk writes
hybrid vector search
capability-scoped MCP
single-file pack / unpack
Rust core · 9-crate workspace
// WHO IT'S FOR

Built for the tools you're building now.

Agent memory & context stores

Give a coding agent durable memory over MCP. Plan a change, apply it as one transaction, roll it back if the plan was wrong — with provenance on every write.

Local tools that outgrew JSON files

Keep the human-readable file you can still grep — and gain schema validation, secondary indexes, and transactions on top of it.

RAG prototypes without extra services

Import Markdown with import-md, embed and sync vectors with vsync, and hand the model a token-budgeted context pack. One store, no second service.

▶ INSERT COIN

Build local AI apps without teaching your agent the database from scratch.

GET STARTED INSTALL CLI READ ARCHITECTURE

OMGDB is early, local-first, and built in the open.