Chronos-DB
Health Uyari
- License — License: NOASSERTION
- Description — Repository has a description
- Active repo — Last push 0 days ago
- Low visibility — Only 6 GitHub stars
Code Basarisiz
- rm -rf — Recursive force deletion command in .github/workflows/linux-gate.yml
- rm -rf — Recursive force deletion command in bench/slt/run.sh
Permissions Gecti
- Permissions — No dangerous permissions requested
Bu listing icin henuz AI raporu yok.
Let AI agents write to the database you already run (Postgres, MySQL, MariaDB, MongoDB): each run works on its own branch, your rules decide what merges, every merge can be undone. Postgres wire protocol, MCP server. Engine source under BUSL-1.1.
Let AI agents write to the database you already run.
Each run works on its own branch. Your rules decide what merges. Every merge can be undone.
Chronos DB is a database for teams that want AI agents to change real data without a person reading every change. Each agent run gets its own world: a private, copy-on-write copy of the whole database, made in about 2 microseconds at any size. When the run is done, Chronos shows exactly which rows it changed, and merges it only if the change keeps to rules you set once; anything else waits for a person.
It speaks the Postgres wire protocol, so psql, drivers and ORMs connect to it. It can hold your data itself, or sit beside the database you already run (Postgres, MySQL, MariaDB or MongoDB) and write each approved merge back to it in one checked transaction. Your application keeps talking to its database as it does today.

[!IMPORTANT]
Public beta (0.6.2). Try it on a staging copy first, not production. It is built by a small team, with one engineer on the engine, and has no outside production use yet. Chronos is not Postgres: it runs much of Postgres 16's SQL, not all of it. Read Where it stands before you move data in.
| A branch per run | Every agent run gets a world: the whole database, copy-on-write, in about 2 µs. Nobody else sees its writes. |
| A diff before anything lands | Every changed row, before and after, and what reads it. |
| Rules, not reviews of everything | A merge policy lets small, safe changes land on their own. Deletes, big changes and sensitive tables wait for a person. |
| Written to your database first | Beside Postgres, MySQL, MariaDB or MongoDB, a merge is one transaction there, every row compared with what the agent saw. |
| Undo | Put back one merge by its id for 30 days, or everything an agent did since a time, leaving other changes alone. |
In one example
The whole loop, in SQL, on a leads table you already have:
-- once, as you: the rules an agent's merges must keep
create merge policy agents with (max_deletes = 0, max_rows = 500, review_tables = 'payments');
create agent bot with (can = 'read,fork,write_own,write_main,merge_own', policy = 'agents');
-- the agent's token is in the `token` column, shown only now
-- as the agent: psql "postgres://bot:<token>@127.0.0.1:5433/main"
create world run_42 with (task = 'clean up stale leads'); -- its own copy of everything
switch world run_42;
update leads set status = 'stale' where last_contact < now() - interval '1 year';
delete from leads where email is null;
diff world run_42; -- table, id, change, before, after
merge world run_42 dry run; -- what the merge would do, row by row, and why it would be held
merge world run_42; -- it deletes rows, so the policy holds it: queued in SHOW REVIEWS
-- as you: look, then approve or throw it away
show reviews;
merge world run_42; -- approve
-- or: drop world run_42; -- reject: main never saw it
If a merge keeps to every rule (no deletes, at most 500 rows, nothing in payments), it goes through on its own. If not, it is refused with the reasons and waits for you.
Contents
- What's new in 0.6
- Install
- Quickstart: five minutes
- Chronos Studio
- How it works
- What it is good at
- Where it stands
- Clients and integrations
- Benchmarks
- Documentation
- Feedback and contributing
- What's in this repository
- License
What's new in 0.6
- 0.6.2: strict proposals for payments. A proposal that would send a payment, payout, transfer or refund is approved only by a person, within 15 minutes, and a commit to main since it was proposed supersedes it. Merges into an attached Postgres or MySQL that may lose an acknowledged commit are refused; beside MongoDB merges commit to a majority.
chronos refresh --checkcompares main with the source. - 0.6.1: merges cut short by a crash. Beside Postgres or MySQL, crash recovery now settles exactly the merge the source committed (it could put rows in main the source never got), and
MERGE WORLD ... IN CHUNKS OF nresumes in chunks after a crash. - Merges are logged as what they did, in a hash-chained ledger. Recovery replays the rows a merge wrote instead of judging it again, and
VERIFY LEDGERchecks every merge into main. The first checkpoint or merge writes data format 8, which 0.5 cannot open: upgrade replicas before the primary, and back up first. - Merges check the constraints they bring. A world that adds a UNIQUE, FOREIGN KEY or NOT NULL constraint has the whole table checked when it merges;
VERIFY DATABASElists rows that break one. - Worlds for long-running agents. Expiry held at every use,
max_depthandmax_children,GRANT ... ON WORLD,TRANSFER WORLD, budgets, durable worlds with pinned checkpoints,ROLLBACK WORLD ... TO CHECKPOINTandRESUME WORLD. - Many agents, one result. Delta columns with escrow bounds,
FORECAST CONFLICTS,CONSOLIDATE(all of a coordinator's children as one merge), and arbitration of rows two children both changed. - Certified merges. An agent proposes a merge bound to a hash of every row it would write; a person approves, and
MERGE PROPOSALmerges exactly that or refuses.EXPLAIN MERGE,SHOW DECISION PROVENANCEand evidence attached to a world. - World sets. Fork many worlds from one, compare and rank them, prune and merge the best; read across worlds with
AT WORLD. - Tenant isolation. An agent held to a tenant is kept to its tenant's worlds and rows everywhere, and new agents read only their own worlds and main by default. If you run agents for more than one tenant, upgrade.
What's new in 0.5
- Beside MySQL, MariaDB and MongoDB.
chronos attachworks beside MySQL 8.0+, MariaDB 10.5+ and MongoDB 5.0+ (a replica set) as it does beside Postgres 12 to 18. Guides: MySQL and MariaDB, MongoDB. - Undo a merge by its id. Each write-back keeps the rows it wrote, so a merge can be undone for 30 days, through the database it was written to. A merge undone in part can be finished later.
- Follow MongoDB as it changes.
chronos serve --followreads change streams beside MongoDB, as it reads the log beside Postgres. - Security fixes. Five fixes for what a role or agent with few rights could reach. If you run more than one role or agent, upgrade.
- Faster reports. Filtered counts,
GROUP BYand joins over 200,000-row tables are 20 to 25% faster on one core; CH-benCHmark Q18 is 4.3 times faster and now ahead of Postgres 18 on the same two cores.
Every change, release by release: CHANGELOG.md.
Install
curl -fsSL https://github.com/2090-labs/Chronos-DB/releases/latest/download/install.sh | sh
chronos --version
The script picks the build for your machine, checks it against the release's SHA-256 sums, and puts chronos in ~/.local/bin. It never runs anything as root.
| Platform | Build |
|---|---|
| Linux, x86-64 and arm64 | static (musl), runs on any distribution; x86-64 needs an x86-64-v2 CPU (about 2009 or later) |
| macOS 13 or later, Apple silicon and Intel | native |
| Windows | not supported |
Options, set as environment variables for the script:
| Variable | What it does |
|---|---|
CHRONOS_INSTALL_DIR=<folder> |
installs into another folder you can write (default ~/.local/bin) |
CHRONOS_VERSION=v0.6.2 |
installs a given release tag instead of the latest |
CHRONOS_VERIFY=1 |
requires the signature check (keyless, Sigstore), which runs anyway when cosign is installed; CHRONOS_VERIFY=0 skips it |
If ~/.local/bin isn't on your PATH, the script says so; add it with export PATH="$HOME/.local/bin:$PATH". The examples below use psql: brew install libpq on macOS, sudo apt-get install postgresql-client on Debian or Ubuntu.
No telemetry. Chronos connects only to what you point it at: a database you import from or attach to, a storage bucket you give it, or Chronos Cloud if you run chronos init or chronos cloud.
Quickstart: five minutes
Pick one: work beside a database you already run, or let Chronos hold the data.
A. Beside your database (chronos attach)
Attach means: Chronos copies the tables an agent will work on into a local folder, agents work in worlds of that copy, and each merge into main is written to your database first. Your application keeps using its database as before. The example is Postgres; MySQL, MariaDB and MongoDB work the same way (what each one supports).
export CHRONOS_SOURCE_URL='postgres://agent_writer:...@staging-db:5432/crm?sslmode=verify-full'
chronos attach ./crm --tables public.leads,public.accounts # or: --schema app
chronos serve ./crm # Postgres protocol on 127.0.0.1:5433
The connection URL is read from the environment (or a file only you can read), never from the command line, and is not written into the folder. The role needs to be allowed to write those tables. Attach makes one table in your Postgres, chronos.merges, to record each merge it writes.
In another terminal:
-- psql postgres://127.0.0.1:5433/main
create world fix_leads;
use world fix_leads; -- the agent's whole task happens in its world
update leads set owner = 'ada' where region = 'EU';
delete from leads where email is null;
diff world fix_leads; -- what it changed, row by row
merge world fix_leads rehearse; -- run the write-back in Postgres, then roll it back
merge world fix_leads; -- written to Postgres in one transaction, then here
At merge world, Chronos runs its own checks, then opens one Postgres transaction. It locks each row the world changed and compares it with what Chronos last saw. If any row changed in Postgres meanwhile, nothing is written and the merge returns those rows as conflicts. Otherwise it applies the changes, runs your checks on the result, and commits. Values your Postgres triggers or defaults set come back into Chronos.
Requirements and limits are under Where it stands. The full guide, including refresh, undo and a restore drill: Working beside your Postgres. For a big multi-tenant Postgres, --lazy-tenant org_id copies a tenant's rows the first time a world is forked for it. The other databases have their own guides: MySQL and MariaDB, MongoDB.
B. On its own (chronos serve)
chronos serve mydb # makes the folder mydb if it's new
This listens on 127.0.0.1 only: the Postgres protocol on port 5433 (not 5432, so it doesn't collide with a Postgres you run) and the HTTP API on 7070. On loopback without a token, no password is asked. In another terminal:
-- psql postgres://127.0.0.1:5433/main
create table todos (id bigserial primary key, title text not null, done boolean not null default false);
create world first; -- main's rows change only by merging a world
use world first;
insert into todos (title) values ('try chronos'), ('read the docs');
update todos set done = true where id = 1;
diff world first; -- what it changed
use world main;
merge world first;
select * from todos order by id;
main is protected in a database chronos serve makes: its rows change only by merging a world, whoever asks. Tables and other definitions still go straight in. An application that writes main directly needs this turned off; the quickstart shows how, and how to add tokens and TLS before other machines connect.
Moving an existing Postgres database in: Migrating from Postgres (chronos import postgres://..., then check row counts and checksums).
C. Give an agent access
For Claude Code, or any MCP client:
claude mcp add chronos -- chronos mcp /path/to/mydb # an attached folder works the same
By default the agent can read, fork worlds, change only the worlds it forked, diff and preview merges. A person merges. To let an agent merge within rules, give it an agent account with a merge policy (--agent NAME). See the MCP reference.
To see the whole idea end to end, the five-minute trial runs an agent on a small CRM and shows four of its mistakes caught before they reach main.
Chronos Studio
Read what an agent did, and merge it, in a browser. Every install has it, and it opens on 127.0.0.1 only:
chronos studio mydb
These pictures show a made-up CRM. More: Studio.
How it works

The words
| Term | Meaning |
|---|---|
| World | A branch of the whole database: every table, copy-on-write. Forking one copies a pointer, not the data, so it takes about 2 µs at any size. A world stores only the rows it changes. "Branch" and "world" mean the same thing. |
main |
The world that holds the real state. Every other world is forked from it, directly or from another world. |
| Diff | The rows a world changed since its fork, each with its before and after values. Also available as SQL statements. |
| Merge | Applying a world's changes to its parent. It is three-way: if both sides changed the same row, nothing is merged and the conflicts come back as rows for you to settle. |
| Agent | An account with its own token and a list of what it may do (read, fork, write_own, merge_own, ...), plus quotas and limits. |
| Merge policy | Rules an agent's merges must keep to go through without a person: max_rows, max_deletes, review_tables, review_columns, rows per hour, and more. |
| Merge check | A SQL query a merge's result must return no rows for, such as "every lead list still has a lead". It runs inside every merge. |
| Review | A merge that broke a rule waits in SHOW REVIEWS with its reasons. A person merges it (approve) or drops it (reject). |
| Attach | Running beside an existing Postgres, MySQL, MariaDB or MongoDB: merges into main are written back to it in one checked transaction. |
The life of an agent run

- Fork. The agent creates a world. It sees all of
mainas it was at that moment and nobody else sees its writes. - Work. It reads and writes with ordinary SQL. It can write only the worlds it forked, unless you give it more.
- Diff. You, or the agent, see every changed row.
merge ... dry runshows what a merge would do and why it would be held. - Merge. Inside the merge, while it holds its locks, Chronos checks conflicts, constraints, the merge policy, merge checks, and (if asked) whether rows the agent read changed since. What is checked is exactly what merges.
- Review or land. Within the rules, it lands. Outside them, it waits in
SHOW REVIEWS. Attached, it is written to your database first. - Undo, if needed.
UNDO MERGE OF WORLD worUNDO AGENT bot SINCE '-2 hours'puts the rows back, within the history window (1 hour by default for a new database;history_retentionsets it). In an attached folder a merge can also be undone by its id for 30 days, and the undo is written through the database the merge went to.
More on each step: Concepts, Worlds reference, Merge policies guide, Merge checks guide.
What it is good at
| Agents need to... | Without Chronos | With Chronos |
|---|---|---|
| Write real data without a person reading every change | Read-only agents, or hand-built staging tables and approvals | A merge policy: changes within the rules land, the rest wait in SHOW REVIEWS |
| Show what they changed | Audit tables you build yourself | diff world w: every changed row, before and after |
| Keep the good work and drop the rest | Hand-written migrations | Merge all of a world, some tables (only tables), some rows (only keys), or drop world |
| Undo a bad run | Restore a backup and lose everyone's work | UNDO AGENT bot SINCE '-2 hours', or one merge by its id, row by row, leaving others' changes |
| Try many things at once | Copy the database, or share one and fight over locks | Thousands of isolated worlds; 100,000 tested |
| Not act on stale data | Hope | A world can record what it read; its merge is held if that changed |
| Search while they work | A separate vector store that can't see uncommitted edits | Filters, full text and vectors (pgvector syntax) inside every world |
| Stay inside their lane | Database roles | Per-agent capabilities, quotas, time and memory limits, masked columns, one tenant's rows only |
Other things in the box: time travel (select * from orders as of '-1 hour', restore world), simulations (SIMULATE many worlds and keep the best), a Postgres-compatible SQL surface with PL/pgSQL, JSONB and full text, and a write-ahead log with fsync on main and merges. The full list is in SQL and Search.
Where it stands
Chronos DB is a public beta, at 0.6.2 today. Use it with staging copies first. The figures below, with their sources: headline facts. More detail: What Chronos guarantees today and What it protects, and what it doesn't.
Project. A small team; one engineer writes the engine. The storage engine has not had an outside review. No outside production use yet.
Postgres compatibility (on its own, without attach). Chronos has its own SQL parser and executor; it is not a Postgres fork.
| Measure | Result |
|---|---|
| Postgres 16's own regression suite, output compared line by line | about 89% of the expected lines; 66 of its 219 files match exactly (run of 2026-10-27) |
| Real databases moved in (Chinook, Northwind, Pagila, pgbench at 2M rows, and others) | 7 of 7 with identical row checksums |
Differential tests against a real Postgres 17 (tests/pgdiff.rs) |
495 tests, each giving the same rows or the same error class |
| Speed, one client over the protocol, same machine, both flushing every commit (2026-09-28) | key lookups and updates level with Postgres 17; single-row commits 3–11% faster; slower than Postgres for merges under 1,000 concurrent agents |
Known gaps include: no C extensions or functions in languages other than SQL and PL/pgSQL (common extensions such as vector, pgcrypto, citext, hstore and pg_trgm are built in); SERIALIZABLE is refused rather than weakened; no replication or pg_hba.conf; text sorts by bytes unless a column has an ICU collation. Full list and tested drivers and ORMs: Postgres compatibility.
Beside which databases
| Postgres 12–18 | MySQL 8.0+, MariaDB 10.5+ | MongoDB 5.0+ (replica set) | |
|---|---|---|---|
| Merge written in one checked transaction | yes | yes | yes |
| Dry run against the live database | yes | yes | yes |
Reads checked against the live database (check_reads) |
yes | yes | yes |
| Undo a merge by its id, 30 days | yes | yes | yes |
chronos refresh |
yes | yes | yes |
serve --follow (changes as they commit) |
yes (wal_level = logical) |
not yet | yes (change streams) |
Rehearse a merge and roll it back (REHEARSE) |
yes | not yet | not yet |
--lazy-tenant, merge checks run in the source |
yes | not yet | not yet |
Tested on Postgres 12 to 18, Neon and Supabase; on MongoDB 5.0 and 7.0 run locally, not on Atlas. Not beside MongoDB: sharded clusters, standalone servers. A program can ask what a folder supports: the HTTP API's attached answers kind and capabilities.
Attach limits beside Postgres (Stage 1, for staging copies):
- Postgres 12 or later. Tested on 12 to 18, on Neon (direct and through its pooler) and on Supabase (through its pooler, Supavisor).
- Each attached table needs a primary key, or a unique index on NOT NULL columns to stand for one. A partitioned table is attached whole; inheriting tables aren't. Generated columns are attached, worked out by Postgres. A table with row-level security on is attached only if the role reads every row (Supabase turns it on for every table).
- At most 50,000 changed rows per merge by default (
CHRONOS_ATTACH_MAX_ROWSraises it to 1,000,000), all in one transaction. - Rows no merge touched are as fresh as the last refresh (
chronos refresh, orchronos serve --refresh-every 5m), which reads every attached table whole. Withchronos serve --follow, main takes Postgres's changes about a second after they commit (needswal_level = logical). - A refresh takes columns added, dropped, renamed or retyped in Postgres, and new enum labels. A table whose key, row security or generated columns change needs a new attach.
- A merge that checks its reads against Postgres can't check a read of more than 100,000 rows of one table: it waits for a person. An agent held to one tenant counts only that tenant's rows, and only they can hold its merge.
- Details: Limits in Stage 1.
Operations. One process per database folder (share it through chronos serve). No hot standby or automatic failover. macOS 13+ and Linux only. See Operations.
Benchmarks it loses are listed first in BENCHMARKS.md, and summarized below.
Clients and integrations
| Client | How | Docs |
|---|---|---|
psql, Postgres drivers and ORMs |
Connect to port 5433. Each world is also a database name: postgres://127.0.0.1:5433/run_42 |
Postgres compatibility: clients |
| TypeScript / JavaScript | npm install @chronosdb/client, or copy one file with no dependencies. Talks to the HTTP API on port 7070 |
Clients |
| Python | Copy one file, standard library only (Python 3.9+). Not on PyPI yet | Clients |
| Claude Code and other MCP clients | chronos mcp <folder>: 31 tools (fork, diff, merge preview, checkpoints, simulations, reviews...) |
MCP |
| Chronos Studio (web UI) | chronos studio mydb: worlds, a data grid, SQL, search, and a Changes view to review and merge. Built into every install, opens on 127.0.0.1 only |
Studio |
| HTTP | POST /v1/<op> with JSON |
HTTP API |
| Rust, embedded | The engine is a Rust library (chronos::Db). Not on crates.io; build it from this repository |
Quickstart: Rust |
A short taste of the TypeScript client:
import { Chronos } from "@chronosdb/client";
const db = new Chronos("http://127.0.0.1:7070");
const agent = await db.fork("agent-7");
await agent.put("users", "1", { name: "Ada L.", role: "admin" });
console.log(await agent.diff());
await agent.merge(); // throws ChronosError 409 on conflicts
Tool definitions for any LLM API with tool calling, and a parallel-agents example, are in examples/agents.
Chronos Gateway is a separate product built on this engine: a self-hosted service that lets your own product's agents change the database your app already uses (Postgres, MySQL, MariaDB or MongoDB), one customer's rows at a time, through approved merges, with undo. It has its own releases at chronos-gateway-releases.

Benchmarks
Engineering numbers from one machine, not a published benchmark. Unless noted: one GCP c2d-standard-32 (32 vCPU, 128 GB, Linux), every rival on the same machine, 2026-09-28. Methods, raw tables and every caveat: BENCHMARKS.md.

| Workload | Chronos DB | Rivals | |
|---|---|---|---|
| Fork a world, 10 to 100,000 live worlds | 1.4–2.0 µs; 503–564 B on disk per world with one changed row | — | §9 |
| 1,000 agents each fork, write 1,000 rows and merge (on disk, 64 workers) | 713k–716k rows/s | Dolt 2.3.5: 28.3k (25× fewer) · Postgres 17 template databases: 9.8k | §1 |
| Vector search, 1M real OpenAI embeddings (1,536-d), p50 / recall@10 | 1.34–1.36 ms / 98.6% | pgvector 0.8.6: 2.40 ms / 92.8%, and 13.5 ms at 98.6% recall · Qdrant: 6.67 ms / 99.0% | §6 |
| Same, filtered to one user (1% of rows) | 1.16–1.19 ms / 100% | Milvus: 3.89 ms / 99.7% · pgvector: 30.9 ms / 94.6% | §6 |
| BranchBench: six agent workflows (2026-10-24, 16 vCPU) | fastest in 4 of 6 | Doltgres 1.4.0 faster in S4, and in S6, where half its checks failed · Postgres 18 clones slower than Chronos in all six | §16 |
| SQLite's sqllogictest, 5.68M records over the Postgres protocol | 99.912% pass; no wrong answer that Postgres gets right | Postgres 17: 99.796% | §13 |
| Crash safety | 10,000 of 10,000 cut-log recoveries exact; 300 kill -9s during 108,178 transfers, none lost |
— | §5 |
Where it loses (the full table is at the top of BENCHMARKS.md):
- Analytics: DuckDB 1.5.5 is 2.2–7× faster on reports over 200,000-row tables (2026-09-28). Chronos stores rows, not columns.
- Reports against Postgres 18 (0.5.4, a laptop, both on two cores, 2026-11-16): Postgres is 1.1–1.4× faster on three of five reports over 200,000-row tables, and on CH-benCHmark Q3 (64 ms against 88 ms). Q18, 2.6× slower in 0.5.2, is now 1.6× faster than Postgres.
- Merges under extreme contention: with 1,000 agents on one thread each, on disk, merge p50 is 714–718 ms against Postgres's 128 ms. At 25 workers it is 25–26 ms.
- Redis answers vector searches faster (0.46–0.50 ms), at 74–75% recall against Chronos's 98.6–99.98%.
- LanceDB loads vectors faster (1.0 s against 4.7 s for 76k).
Documentation
The same pages, with search, are on the docs site. The guides' SQL scripts are in examples/guides.
Feedback and contributing
- Questions or ideas: Discussions.
- A bug, or something unclear: open an issue. The templates ask for the few lines that reproduce it.
- Security issues: report them privately, as SECURITY.md describes.
- Contributing: see CONTRIBUTING.md.
What changed in each release: CHANGELOG.md. The newest build is always at releases/latest; as this page was written that was v0.6.2, 2026-11-19.
What's in this repository
| Path | What |
|---|---|
src/, tests/ |
The database engine and its tests (Rust 1.90+). cargo build --release builds target/release/chronos |
studio/ |
Chronos Studio's source, the web UI built into every release (React, TypeScript, Vite). Working on it |
clients/ |
The TypeScript and Python clients, one file each |
docs/, site/ |
The documentation and the docs site that publishes it |
examples/ |
The five-minute trial, the guides' SQL, agent tool definitions, and the Rust benchmark harnesses |
bench/slt |
The sqllogictest runner's scripts and results |
install.sh |
The installer; signed binaries are on the releases page |
License
- The engine (
src/,tests/, the Cargo build,examples/*.rs) and thechronosbinaries: Functional Source License 1.1, ALv2 Future License (FSL-1.1-ALv2). You may use, change, build on and redistribute it free of charge, including in production, inside your company and in free or open projects. The one limit: you may not make it available to others in a commercial product or service that substitutes for Chronos DB, such as a hosted or managed database service. Running it as your own application's database is fine. Each version becomes Apache 2.0 two years after it is published; versions up to 0.7.0 stay under the Business Source License 1.1 they were published under. It is source-available, not open source by the OSI's definition. Plain-language summary: TERMS.md. - The Studio, the clients, the docs site and the guides' examples: MIT License.
Yorumlar (0)
Yorum birakmak icin giris yap.
Yorum birakSonuc bulunamadi




