Skip to main content

monlite

The local-first database for TypeScript — documents, vectors, full-text search, cache, queue, and cron in one .db file, with a zero-dependency core.

monlite is SQLite with a Mongo/Prisma-style API and an opt-in family of packages that cover the rest of a local backend. It runs in Node, the browser (WASM), the desktop (Electron), and the edge — anywhere SQLite runs.

import { createDb } from "@monlite/core";

const db = createDb("app.db");
const users = db.collection<{ name: string; age: number }>("users");

await users.create({ data: { name: "Ali", age: 30 } });
const adults = await users.findMany({ where: { age: { gte: 18 } }, orderBy: { age: "asc" } });

The package family

The core is lean and dependency-free. Each additional capability is an opt-in package — install only what you need.

PackageReplacesWhat it gives you
@monlite/coreMongoDB (documents)Document + structured collections, one query API, aggregation, transactions, reactive watch()
@monlite/vectorQdrant / PineconeVector / semantic search (sqlite-vec) — plugin + createVectorStore(db)
@monlite/ftsSearch enginesFull-text search (SQLite FTS5) — plugin + createSearchIndex(db)
@monlite/kvRedis (cache)Synchronous cache, atomic locks, TTLs
@monlite/queueBullMQ / RedisDurable job queue — retries, backoff, delays, priorities, dedupe
@monlite/cronCron serversPersisted scheduled jobs (5-field syntax)
@monlite/syncCloud syncLocal-first replication to MongoDB / PostgreSQL / MySQL
@monlite/wasmRun monlite in the browser on SQLite-WASM
@monlite/electronShare one database across Electron windows over IPC

Why monlite

  • One file. All of it — documents, vectors, cache, queue, cron — in a single SQLite file. Backup = copy the file.
  • Zero-dependency core. @monlite/core uses Node's built-in node:sqlite (Node >= 22.5) with no native build, or better-sqlite3 when you install it.
  • The local backend for AI agents. Documents + vectors + cache + queue + cron is the complete local stack a coding agent or RAG app needs — see the AI-agent backend guide.
  • Production-hardened. Atomic async transactions, cross-process compare-and-swap, crash-tested durability, observability, and cross-platform CI. See the production guide.
  • Scope: monlite targets local / edge / desktop / single-machine workloads. For multi-site, high-write-volume, or strict-HA, keep the managed services and sync to them.

Next: Getting started →