Let AI agents write to your Postgres. Each run works on its own branch; your rules decide what lands.
The branch is the easy part; the merge is what has to be trusted.
Chronos sits beside the Postgres you already run () or holds the data itself. Every agent run works in its own copy-on-write (a branch of the whole database). Chronos it row by row and checks the merge against : no deletes without a person, at most 500 rows, every lead list keeps a lead.
What keeps to the rules is written back to your Postgres in one checked transaction; the rest waits for review, with the reasons. It speaks and searches filters, text and vectors inside every world.
Let AI agents write to your Postgres: each run works on its own branch; your rules decide what merges, written back in one checked transaction. Postgres wire protocol, MCP server. Engine source under BUSL-1.1.
-- 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');
-- as the agent (psql postgres://bot:<token>@127.0.0.1:5433/main)
create world run_42 with (task = 'clean up stale leads'); -- private copy of everything, any size
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; -- row by row, plus why it would be held
merge world run_42; -- the delete breaks a rule: held, queued in SHOW REVIEWS
-- as you: look, then approve or throw it away
show reviews;
merge world run_42; -- or: drop world run_42 (main never saw it)
Already on Postgres? Keep it there. Attach the tables an agent works on, and every merge above is written to your Postgres first, in one transaction, after checking each row is still as Chronos last saw it (a row changed there meanwhile is a conflict, and nothing is written):
[!NOTE]
Every row ran on one GCP c2d-standard-32 (32 vCPU, 128 GB, Linux) on 2026-09-28, with every rival on the same machine. Earlier editions ran on an 8 GB M2 laptop and a 4-vCPU VM. They are engineering numbers, not a published benchmark. Methods and results for each are in BENCHMARKS.md.
How it works
gitGraph
commit id: "main: real state"
branch agent-1
checkout main
branch agent-2
checkout agent-1
commit id: "reprice"
checkout agent-2
commit id: "restock"
commit id: "reprice (conflict)"
checkout main
merge agent-1 id: "merge: 1 change"
checkout agent-2
commit id: "resolve by columns"
checkout main
merge agent-2 id: "merge: settled"
Worlds are copy-on-write. A world is a pointer to an immutable, content-addressed tree of pages. Forking copies the pointer, not the data, so it costs the same ~2 µs at 1,000 rows or 1 million. A world then pays only for what it changes (about 450 bytes on disk for one changed row).
Merges are three-way and exact. A merge diffs the world against its fork point, skipping every subtree both sides share, and applies each changed row. If both sides changed the same row, the merge stops and returns the conflicts as data, even when the values happen to match. You then settle them: USING OURS/THEIRS, row by row, or BY COLUMNS when the two sides touched different columns. Partial merges (ONLY TABLES, ONLY KEYS) and merges into another world (INTO) are logged exactly, so replay after a crash gives the same result.
Search indexes are shared. Indexes are built for anchor states and shared by every world forked from them. A world searches the anchor's index minus the keys it changed, plus its changed rows scored directly. That is why a query inside one of 100,000 worlds runs as fast as in main.
Features
🌍 Worlds (branches of everything)
CREATE / FORK / SWITCH / DROP WORLD, with JSON metadata, owners and IDs
Worlds of worlds, to any depth (10,000 deep tested)
DIFF between any two worlds or moments, as rows or as runnable SQL
MERGE: whole, DRY RUN, ONLY TABLES, ONLY KEYS, INTO another world, BY COLUMNS, per-row RESOLVE
Time travel:SELECT ... AS OF '-1 hour', RESTORE WORLD, UNDO MERGE (30-day retention by default)
Undo an agent:UNDO AGENT bot SINCE '-2 hours' SKIP CHANGED
Simulations:SIMULATE 1000 WORLDS ... RUN $$...$$ SCORE $$...$$ KEEP 10 SEED 42, deterministic and replayable
SHOW STORAGE per world, SET TTL, idle-world sweep, pinned worlds
Checked against real Postgres 17 by a differential test suite (tests/pgdiff.rs)
🔎 Search, inside every world
Vectors: pgvector-compatible vector(N), <=><-><#>, USING hnsw. Runs Mem0's pgvector store unchanged
HNSW graph built in the background, tuned per graph, used only when it proves ≥ 99% recall against exact search; otherwise an exact 1-bit scan with full-precision rescoring
Full text: Postgres tsvector / tsquery, ts_rank, websearch_to_tsquery, English Snowball stemmer (identical on 20,000 words), GIN indexes
BM25 + typo tolerance + fusion:search('table', 'words'), and find ... where ... match ...
One folder shared by many processes: the first opener serves the rest
Examples for Claude Code, LLM tool definitions and parallel agents in examples/agents
A five-minute trial on a small CRM, where four mistakes an agent makes are caught before they reach main: examples/trial
💾 Storage and durability
Write-ahead log with fsync (macOS F_FULLFSYNC) on main and merges before they return
Branch writes are fast, and loss is never silent: versions are checked on merge
LZ4-compressed, content-addressed pages; background checkpoints and garbage collection
synchronous_commit = normal | off when you trade safety for speed
Page cache with a hard memory cap; databases many times bigger than RAM
Encryption at rest, backups, and S3 / R2 / MinIO storage with a single-writer lease and scale-to-zero (--features s3)
⚡ Speed
Scans, hash joins and GROUP BY split across every core
Joins stream: each core joins and groups its part without holding either side whole
Sorts on every core; ORDER BY ... LIMIT k keeps only k rows
Spills to disk past CHRONOS_WORK_MEM: GROUP BY, DISTINCT aggregates, ORDER BY, grace hash joins, and the writes of a big INSERT, UPDATE, DELETE or COPY, which stays one atomic statement
Packed binary rows, prepared plans cached per schema version
AVX2 dot products and POPCNT 1-bit vector scans
SHOW METRICS: count and p50 / p95 / p99 latency per operation, plus counters
Quickstart
Install
A prebuilt binary for macOS or Linux (x86_64 and arm64), checked against the release's SHA-256 sums, into ~/.local/bin:
curl -fsSL https://github.com/Abhishekxdg/chronosdb/releases/latest/download/install.sh | sh
chronos --version
CHRONOS_VERIFY=1 also checks the release's signature with cosign.
No telemetry: Chronos never connects anywhere on its own, only to what you give it (a --remote to store in, a Postgres you import from or attach to).
Postgres: psql, drivers, ORMs
chronos serve mydb # HTTP on :7070, Postgres on :5433, loopback only
psql postgres://127.0.0.1:5433/main
export DATABASE_URL="postgres://[email protected]:5433/main" # for your application
Every world is also a database name: psql postgres://127.0.0.1:5433/agent_7. Moving a Postgres database in, and checking it came over: Migrating from Postgres.
The shell
$ chronos mydb
chronos:main> put users 1 {"name": "Ada", "role": "admin"}
chronos:main> fork agent-7 # instant private copy
chronos:agent-7> put users 1 {"name": "Ada L.", "role": "admin"}
chronos:agent-7> diff
1 change on agent-7
~ users/1 name: "Ada" -> "Ada L."
chronos:agent-7> merge
merged 1 change from agent-7 into main; now on main
chronos:main> find users where role = admin match ada
TypeScript and Python (one file each, no dependencies)
import { Chronos } from "./clients/typescript/chronos";
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, or if a crash lost writes
chronos studio mydb # opens the Studio in your browser, on 127.0.0.1 only
Worlds as a tree, each table's rows in a fast grid (filters, sorting, any table as of any moment), a row inspector, a SQL console, and the Changes view where you review a world's changes, preview the merge with conflicts explained, and merge into main (or discard, or undo). Edits on main offer to go into a new world first. Agents, the audit log and status are one menu away; ⌘K does the rest. It's in every install, runs beside a running chronos serve on the same folder, and a per-run key in the link keeps other pages and programs out. See docs/studio.md, which also covers working on the UI (npm run dev in studio/).
Claude Code and other MCP agents
claude mcp add chronos -- chronos mcp /path/to/mydb
The agent can describe, search, query, fork, write, diff and preview merges. A person merges unless you pass --allow-merge or give an agent account that right.
Bring your data
psql postgres://127.0.0.1:5433/main -c "\copy orders from 'orders.csv' csv header"
chronos import mydb orders orders.csv --schema schema.csv # a Postgres table, schema and all
chronos mydb migrate ./migrations # apply numbered .sql files once each
Benchmarks
The full record, with methods, raw tables and every caveat, is in BENCHMARKS.md. Highlights:
Forks and concurrent agents
1,000 agents each fork main (100k seed rows), write 1,000 rows and merge back. Same 32-core machine for every system:
Against Dolt 2.3.5, the only other database with real merges, at the same 64 workers: 22× at 10 agents, 20× at 100 and 16× at 1,000 before #23 and #29, and 25× at 1,000 with them.
Postgres 18 clones (CREATE DATABASE … STRATEGY FILE_COPY with file_copy_method = clone, on XFS or Btrfs, with nothing else connected to the source) and Xata's open-source copy-on-write branches make copies fast too, but neither diffs or merges an agent's changes back or returns conflicts as rows. We haven't measured either; see BENCHMARKS.md §1.
¹ Merges into main queue behind each other. On disk with one thread per agent, 1,000 at once, the merge p50 is 714–718 ms, still a loss to Postgres's 128 ms (it was 1,231 ms before an open world's writes reached the log in batches, #23, and each thread remembered its last world, #29), and fork p50 there rose to 65–73 ms. What's left is the branch map's lock, which forks and merges hold while they log (§1, §8).
Vector search on real embeddings
OpenAI embeddings (1,536-d, DBpedia) + 500 queries, top 10, eleven systems each at its defaults, each alone on the same machine. Chronos DB is queried over SQL exactly as Mem0's pgvector store queries it.
system
76k: p50
recall@10
1M: p50
recall@10
1M, one user (1%): p50
recall@10
Chronos DB (SQL, pgvector syntax)
0.72 ms
99.98%
1.36 ms
98.6%
1.16 ms
100%
Redis 8.10
0.46 ms
75.0%
0.50 ms
74.2%
11.1 ms
100%
pgvector 0.8.6
1.01 ms
82.0%
2.40 ms
92.8%
30.9 ms
94.6%
Milvus 3.0
1.64 ms
89.2%
3.92 ms
97.3%
3.89 ms
99.7%
Weaviate 1.39
1.82 ms
97.0%
2.48 ms
98.2%
8.47 ms
100%
Chroma 1.5 (embedded)
1.94 ms
92.6%
2.25 ms
96.8%
265 ms
99.7%
pgvectorscale 0.9
1.95 ms
97.5%
8.33 ms
96.6%
51.4 ms
69.8%
Elasticsearch 9.5
3.24 ms
90.8%
3.56 ms
94.9%
3.47 ms
61.3%
LanceDB 0.39 (embedded)
3.30 ms
85.0%
3.43 ms
85.0%
28.0 ms
96.7%
Qdrant 1.19
3.73 ms
98.8%
6.67 ms
99.0%
5.83 ms
99.98%
OpenSearch 3.8
5.12 ms
96.6%
10.06 ms
98.5%
4.83 ms
80.6%
At 1M, Chronos is the fastest of every system that finds more than 75% of the true top 10 (only Redis is faster, at 74%), and the fastest of all for one user; only Qdrant finds more (99.0% against 98.6%, at 6.67 ms). At 76k it has the best recall. Raised to Chronos's 98.6% recall, pgvector takes 13.5 ms against Chronos's 1.36 ms; at the 99.3% recall of Chronos's earlier default beam (SET hnsw.ef_search = 1000), Chronos takes 2.30 ms, still ahead of every rival that finds more than 96.8% (§6).
Unfiltered vector search in a fork is 1.55× main (2.1 against 1.34 ms), a miss against the 10% target (§3).
SQL over the Postgres protocol
200,000 rows per table, ms per query. Chronos and DuckDB 1.5 run in process; Postgres 17 runs over local TCP with its default parallel workers:
query
Chronos
Postgres 17
DuckDB 1.5
count(*)
2.8
6.4
0.4
count(*) WHERE amount > 500
4.0
8.7
0.7
GROUP BY with count, max
9.8
19.6
4.4
join, then GROUP BY with sum
25.3
68.6
7.5
join WHERE name LIKE 'user 1%'
18.6
45.2
7.7
Over the Postgres protocol at 20,000 rows per table, join + GROUP BY takes 4.4 ms against Postgres 17's 6.9 ms. DuckDB, a column store built for this kind of query, is 2–7× faster than Chronos on these reports.
OLTP at equal durability (fdatasync on both): 2,395–2,543 commits/s against Postgres 17's 2,286–2,320; lookups by key 46–48 µs against 46 µs; key join 52 µs against 50 µs.
100,000 worlds
worlds
fork p50
point query main / world
disk per world
memory per world
1,000
1.7 µs
21 / 14 µs
551 B
0.3 KB
10,000
1.5 µs
21 / 21 µs
557 B
0.1 KB
100,000
1.4 µs
23 / 21 µs
564 B
1.0 KB
Checkpoint and reopen with 100,000 worlds: 0.87 s and 0.17 s.
The ultimate test: 300,000 simulated futures, one merge
A real supply chain lives in main. 100,000 worlds each simulate their own reorder policy in SQL (WITH RECURSIVE over days of demand), are scored in SQL, and the best 1% fork 100 children each, for three rounds. The winning policy is merged back into main: +32.2% profit over today's policy, in 4 minutes 40 seconds on 32 cores (21 minutes on an 8 GB laptop), and the same winner on every run with the same seed, on either machine (§10).
Also measured: Monte Carlo Tree Search where every tree node is a world (Connect Four, 49,402 worlds, 0.84 ms per iteration, 20–0 against a random player, §11), and a database 25× bigger than its cache, its page cache held to its 32 MB cap (§12).
Where Chronos DB loses (today)
workload
result
why / plan
Analytics vs DuckDB 1.5.5 (200k-row reports, 32 threads)
DuckDB 2.2–7× faster
DuckDB is a columnar OLAP engine; Chronos stores rows. Columnar storage is not planned for v0.1; row counts in the tree and per-page min/max would narrow it
Merges on disk, 1,000 agents on one thread each
merge p50 714–718 ms, Postgres 128 ms (was 1,231 ms); fork p50 65–73 ms (was 4–5 ms); the run takes 1.8 s against 0.76 s in memory (was 5.0 s)
An open world's writes now reach the log in batches; forks and merges still hold the branch map's lock while they log, which parks the writers. At 25 workers: 1.4 s, merge p50 25–26 ms. See BENCHMARKS §8
Vector search inside a fork, 1M rows
1.55× main, unfiltered; 1.12× text (target: 1.1×)
Probably the fork's changed rows searched separately; not profiled yet
Filtered vector search at 10%, 500k × 384
1.3× tuned pgvector (the Phase 1 gate is 5×)
The other filter mixes pass (3.4–47×)
Redis vector search (76k and 1M)
Redis 0.46–0.50 ms against 0.72 and 1.36 ms
At its defaults Redis finds 74–75% of the true top 10; Chronos 98.6–99.98%
Bulk vector load vs LanceDB
Chronos 4.7 s (76k), 64 s (1M) vs LanceDB 1.0 s, 12 s
LanceDB takes an in-process Arrow table; Chronos gets rows over the Postgres protocol
kill -9 the server during concurrent fork/merge bank transfers
300 kills, 108,178 transfers, none lost, every balance matches
Postgres differential
Same queries on Chronos DB and real Postgres 17, results compared
Functions, types, errors and formatting match
sqllogictest
SQLite's query corpus (622 files, 5.68M records) over the Postgres protocol, the same runner on Chronos DB and Postgres 17
Chronos 99.912%, Postgres 17 99.796%; no wrong answer Postgres gets right; 63 fail only on Chronos (division by zero beside a NULL constant). §13
Capability audit
30 end-to-end capability checks, executed
27 pass, 3 partial (being closed)
The Jepsen-style test found two real bugs before this release (money created by a merge that treated equal values as no conflict, and a silent loss after a fast restart), and both are fixed. See BENCHMARKS.md §5.
Status and roadmap
Chronos DB is a public beta (0.4.2), and not yet used in production. The previous release was v0.4.1, on 2026-10-23.
Worlds: fork, diff, three-way merge, partial merges, time travel, undo
Postgres wire protocol and a broad SQL surface, checked against Postgres 17
Schemas, search_path, ::regclass, pg_index / pg_constraint and the information_schema constraint views
PL/pgSQL EXCEPTION blocks, EXECUTE, ALTER TYPE for enums
Hybrid search: B-tree, BM25, full text, pgvector + HNSW (graded against exact search), PostGIS points
Bounded memory for big work: CREATE INDEX / ADD UNIQUE, one big INSERT / UPDATE / DELETE / COPY (atomic), DISTINCT aggregates
Chronos Studio, built in: worlds and the worldline, data grid with in-place editing, import and export, schema diagram, SQL, hybrid and vector search with a map of the vector space, changes and merges, history and checkpoints, simulations, agents, settings
Fixes from four full code reviews: parser and regex recursion limits, caps on user-controlled sizes, lock poisoning after a panic, Origin and Host checks on the loopback HTTP API, hardened spill files
First tagged release, v0.1.0: signed binaries for macOS and Linux
v0.1.1: merge policies, the sqllogictest correctness run and its fixes, and the fourth review's fixes
v0.1.2: chronos import postgres://, merge checks, the stale-read check, what a change affects, merging by columns per table, and faster joins and agent writes on many cores
v0.1.3: vector search at 1M 2.1× faster at the same recall, a run's declared scope, review_columns, effects only on merge (NOTIFY ON MERGE), limits per agent over an hour, and max_age
A plain scan's memory stays flat as tables grow: a count(*) or sum needs +6 to +8 MB at 1M to 10M rows (it was +63 MB at 10M, and RSS 250 MB is now 107 MB). What still grows is the page directory an open database keeps, about 3 MB per million narrow rows
Bulk vector ingest: COPY FROM STDIN (FORMAT binary) with pgvector's binary vectors, COPY streaming into its INSERT, vectors stored 7 bits to a character. Loading 76k embeddings is now bound by the disk, not the protocol (it decodes them all in 0.7 s); LanceDB's 2 s load doesn't wait for the disk (no fsync)
Write less per vector load: integer keys are stored in number order (tables made from now on), so a load in id order goes straight into the tree. A binary COPY of 76k embeddings writes 526 MB (it was 1.82 GB) in 8–15 s
Bulk loads write once: COPY, INSERT ... SELECT or a big INSERT skip the log. Many small transactions write each row twice (the log, then the tree), as Postgres does: 1.27 GB for the same 76k embeddings (see Loading and unloading)
Neon branching benchmark: a Neon branch is ready in 2.3–3.7 s (p50) against Chronos's 0.1–0.2 ms fork in the same harness, and 10 to 100 agents write 0.8k–1.1k rows/s against 270k
Outside review of the storage code, design partners
See CHANGELOG.md for everything that has shipped, and SECURITY.md to report a vulnerability.
src/, tests/: the database engine's source and its tests (Rust), under the Business Source License (see License below). Build it with cargo build --release; the binary is target/release/chronos.
Releases: signed chronos binaries for macOS and Linux, built from that source, and install.sh.
studio/: Chronos Studio's source, the web UI built into every release (React, TypeScript, Vite). See docs/studio.md to work on it.
clients/: the TypeScript and Python clients, one file each, no dependencies.
examples/: SQL walkthroughs and agent tool definitions.
License
The engine (src/, tests/, the Cargo build, examples/*.rs) and the chronos binaries built from it: the Business Source License 1.1. Free to use, change and redistribute, including in production and inside commercial products, except to offer Chronos DB itself to others as a hosted or managed database service. Running it as your own application's database is fine. Each version becomes Apache 2.0 four years after it is published. It is source-available, not open source by the OSI's definition. See TERMS.md.
The Studio, the clients, the docs site and the guides' examples: the MIT License.
C
Chronosdb
Abhishekxdg·2 estrelas·
Let AI agents write to your Postgres: each run works on its own branch; your rules decide what merges, written back in one checked transaction. Postgres wire protocol, MCP server. Engine source under
Let AI agents write to your Postgres: each run works on its own branch; your rules decide what merges, written back in one checked transaction. Postgres wire protocol, MCP server. Engine source under BUSL-1.1.
Ferramentas
Ferramentas
Ainda não há lista de ferramentas. Servidores remotos recebem uma após a primeira verificação de saúde.
Perguntas frequentes
Perguntas
Como instalo Chronosdb?
Copie nesta página a configuração stdio para Cursor, Claude Desktop, Claude Code ou VS Code. Ela usa a instalação do publicador, não um proxy do PlugMCP.
Este registro não lista nenhuma variável de ambiente obrigatória.
Qual transporte Chronosdb usa?
Chronosdb roda localmente via stdio.
Quando Chronosdb foi verificado pela última vez?
Última verificação: 2026-10-26. Let AI agents write to your Postgres: each run works on its own branch; your rules decide what merges, written back in one checked transaction. Postgres wire protocol, MCP server. Engine source under BUSL-1.1.