Graph database in RustPre-release, built in the open
A graph database that keeps every commit.
FrankenGraphDB is a property-graph database written from scratch in Rust. Every commit stays readable: query the graph as it stood at any earlier commit, diff two commits row by row, or subscribe to changes as they land. Search, graph algorithms and access control run inside the same engine, on the same snapshot.
MATCH (a:Person)-[:KNOWS]->(b:Person) FOR SYSTEM_TIME AS OF SEQ 12 RETURN a.name, b.name
0 rows +0 −0
Result digest …
Drag the slider to read an earlier commit. Rows added by that commit are lit; rows it deleted fade out. The same commit always gives the same rows and the same digest.
- 7crash points testedThe crash tests stop a commit at seven named points. Each point has one correct recovery, and the tests check it.
- 32graph algorithmsPageRank, Louvain, betweenness and more, called from a query on the same snapshot.
- 12kinds of access limitLabels, edge types, properties, vertices, commits and more, checked before a pattern expands.
- 15.7ktest functionsUnit, property, crash-recovery and schedule-exploration tests, in over 1,000 integration test files.
- 2direct outside dependenciesBoth pinned to a commit. Storage, queries and cryptography are written in the repository.
01 · Why
One engine instead of five.
A graph application usually keeps a graph database, a vector store, a text index, a change stream and a copy of its history, and spends real effort keeping them in step. FrankenGraphDB does those jobs in one engine, so a query that touches all of them reads one commit.
One snapshotPartly built
Every part reads the same commit.
When the graph, the embeddings and the text index live in different systems, each catches up with a write on its own schedule, and a query that asks all of them can mix versions. In FrankenGraphDB a read pins one commit, and search, algorithms and access checks all run against it.
Commit a write, then read from every part at once.
InteractiveFive systems, kept in step
- Graph databasePatterns and pathscommit 4
- Vector storeNearest embeddingscommit 4
- Text indexBM25 keyword searchcommit 4
- Change streamWhat changedcommit 4
- History copyEarlier versionscommit 4
Every part has commit 4.
FrankenGraphDB
Every part reads commit 4.
Graph patterns, text search, vector search, the 32 built-in algorithms and the access checks run on one snapshot today, and vector results honour AS OF. A vector search builds its index for the call or reuses one held in memory; an index stored on disk is in the plan.
What it is for
Four jobs it is built for.
Each card says whether the feature behind it runs today, and links to the figure that shows it.
- Runs todayMemory for AI agents
CALL hybrid.searchranks nodes by text, by embedding and by hops from a seed, and fuses the three in one call. Each agent's token can be limited to the part of the graph it may read.Try it on this page - Runs todayAudit and investigationAsk what the graph said at commit 41,999 and get the same rows every time. Attach a certificate to the answer, and anyone with the database can replay it and compare the bytes.Try it on this page
- Runs todayLive features and alerts
SUBSCRIBE TOa pattern and receive a baseline, then one exact change per commit: +1 for each row that appears, −1 for each that goes away.Try it on this page - In designWhat-if analysisFork the graph, change it, and merge it back with a report of every conflict. Branches are specified in the plan and are not built yet.See the worked example
02 · History
Every commit stays readable.
Chronicle, the commit stream under the store, keeps committed versions instead of overwriting them. A read can name the commit it wants with FOR SYSTEM_TIME AS OF SEQ, fgdb diff returns the rows that changed between two commits with their signs, and a crash at any point inside a commit has one correct outcome.
Time travel and diffRuns today
Compare any two commits.
History is part of the database, so there is no separate temporal store to keep in step. Each answer below is a read at one commit. The diff is computed the same way fgdb diff computes it: rows that appear get weight +1, rows that go away get −1, and rows in both cancel.
Pick a query and two commits. The diff lists only the rows that changed.
InteractiveAt SEQ 5
At SEQ 9
fgdb diff
fgdb diff --db social.fgdbdir --before 5 --after 9 "<query>"; it prints each changed row with its weight. Reading as of a wall-clock time, rather than a commit sequence, is in the plan, as are retention policies that let old history expire.Two barriersRuns today
A crash at any point has one right answer.
A commit first writes its changes as a capsule and forces it to disk. Only then does it write a small marker and force that to disk too. The marker is the commit: a capsule without a marker is discarded, and a torn marker is cut off. The crash tests stop the process at each of the seven points between the two barriers and check what recovery decides.
Pick a crash point, or step through a commit, and see what recovery finds.
InteractiveOn disk after the crash
Recovery
…BeforeCapsule to AfterMarkerFileSyncBeforeDirectorySync. At the last two, the client has no acknowledgement, so the server reports the outcome as unknown and the client checks before it retries.If a capsule or marker is damaged after it was written, the stored repair symbols can rebuild it. See self-repair in the next chapter.
03 · Storage
Stored compactly, repaired in place.
Strata, the storage engine, keeps each vertex's neighbours as a sorted run and seals it with Elias–Fano coding, so a scan reads few bytes and a join can skip ahead without decoding everything. Every stored object also carries RaptorQ repair symbols, so fgdb scrub can rebuild damaged pieces from what survives.
Elias–Fano runsRuns today
Sorted neighbours in a few bits each.
Split each neighbour id into high bits and low bits. The low bits are stored as they are. The high bits only ever grow, so they are written as gaps in unary. A list of n ids from a range of U costs at most 2 + ⌈log₂(U/n)⌉ bits per id, and any position can be found without decoding the list.
Change how many neighbours a vertex has and how many ids there are. Tap an id to see its bits.
InteractiveLow bits, stored as they are (l per id)
High bits, as gaps in unary (a 1 per id, a 0 per bucket)
Self-repairRuns today
Lose some bytes, keep the data.
An object is stored as source symbols plus repair symbols. fgdb scrub checks every symbol. If enough survive, it rebuilds the object and rewrites the damaged symbols. If too few survive, it returns no bytes at all and says why, so the next step, a replica or a backup, can be chosen on purpose.
Tap symbols to corrupt them, then run a scrub.
Interactive- Source symbol
- Repair symbol
- Fails its own MAC
04 · Queries
Join the whole pattern at once.
Loom, the query engine, plans a GQL pattern as one multi-way join over sorted neighbour lists, a worst-case optimal join. It also keeps repeated values factorized, so an answer that is a product of two lists can be counted or streamed without writing out every row.
Worst-case optimal joinsRuns today
Find shared neighbours by leaping through lists.
A pairwise plan joins two lists, writes out the result, then joins that with the third. A leapfrog join walks all three sorted lists together. Each step seeks the lowest list to the highest value seen so far, and it stops only on ids that all three share.
Step through a three-way intersection, or let it run.
InteractiveMATCH (a)-[:KNOWS]->(c), (b)-[:KNOWS]->(c), (d)-[:KNOWS]->(c) WHERE a = $x AND b = $y AND d = $z RETURN c
Factorized resultsRuns today
Count a million pairs from two lists.
Ask for everyone a hub knows paired with everything the hub wrote, and the flat answer has d × d rows. Held as a product, it is the hub and two lists of d values, and its row count is known before a single row is written.
Raise d and compare two ways to hold the same answer.
InteractiveMATCH (p)<-[:KNOWS]-(h:Person {name:'Ada'})-[:WROTE]->(w) RETURN p.name, w.title
Flat rows
64 rows
Factorized: Ada × people × writings
17 values
05 · Live
Answers that keep themselves current.
Ripple, the incremental engine, treats every change as a Z-set: a bag of rows with integer weights, +1 for a row that appears and −1 for one that goes away. A standing query compiles to a circuit that turns a change in the input into the exact change in the output. SUBSCRIBE TO sends a baseline, then one delta per commit.
Incremental maintenanceRuns today
Add an edge, get only what changed.
This view lists every two-step path. When a commit adds or removes edges, Ripple computes the change to the view from the change to the edges, without rereading the rest of the graph, and the subscriber receives just those rows with their signs.
Tap two people to add or remove a KNOWS edge, then commit.
InteractiveSUBSCRIBE TO MATCH (a)-[:KNOWS]->(b)-[:KNOWS]->(c) RETURN a.name, b.name, c.name
What the subscriber receives
Subscriptions run over the embedded API and the server's FGP protocol today and last as long as the session. Durable subscriptions that resume after a disconnect, and CREATE MATERIALIZED VIEW, are in the plan.
06 · Proof
Results you can check later.
Under STRICT determinism, the same query on the same commit returns the same bytes in the same order on every run. EXPLAIN (CERTIFICATE) records what a read depended on, and replay reruns it and compares. Concurrency is tested the same way: a schedule explorer runs every distinct interleaving of a test.
CertificatesRuns today
Run it again, get the same bytes.
Ties are the usual way results drift: two rows with the same sort key can come back in either order, and a page boundary can cut between them. A certificate names the commit, the plan, the semantic profile and the tie rule, so the run can be repeated and checked.
Run the query a few times under each mode, then replay the certificate.
InteractiveEXPLAIN (CERTIFICATE) MATCH (p:Person) RETURN p.team, p.name ORDER BY p.team LIMIT 5
Rows
Certificate
Replay covers the engine's native read path today. The plan extends certificates to writes, analytics and the server's protocols.
Schedule explorationRuns today
Every interleaving, checked.
Concurrency bugs hide in rare orderings. fgdb-sim runs the engine on a deterministic lab runtime and explores the distinct interleavings of a test one by one (dynamic partial-order reduction), with a filesystem that can fail on purpose. This figure shows the idea at its smallest.
Two clients each sell one item from a stock of 10. Pick a rule and open a schedule.
InteractiveToday the explorer covers declared scenarios, such as generated transaction schedules and crash points. The server and replication are not yet run under it.
07 · For agents
Built for many agents at once.
Agents need retrieval that mixes words, embeddings and relationships, limits on what each one may read, and a way to try changes without stepping on each other. The first two run today. The third, a branch per agent with a merge that reports its conflicts, is in the plan.
Hybrid searchRuns today
Words, vectors and hops, fused in one call.
CALL hybrid.search ranks nodes three ways: BM25 over a text property, similarity over vector properties, and hop distance from seed nodes. It fuses the rankings with reciprocal rank fusion at k = 60, all at one commit, under the caller's access limits.
Pick a question and switch the three rankings on and off.
InteractiveFused, score = Σ 1 / (60 + rank)
The same search in GQL
CALL hybrid.search(
text => 'programming languages', text_property => 'bio',
vector => $query_embedding, vector_properties => ['e0', 'e1', 'e2'],
seeds => $ada, relation => 'KNOWS', max_hops => 2,
k => 5, fusion => 'RRF'
) YIELD node, score RETURN node.name, score ORDER BY score DESC;Scoped accessRuns today
Limits apply before the pattern expands.
A token can carry caveats that narrow what it may read. FrankenGraphDB applies them while it expands the pattern, so hidden vertices never enter the computation. A filter applied to the finished result can still leak: the row is gone, but a count or a path length shows it was there.
Compare a filter applied after expansion with a scope applied before it.
InteractiveBranchesIn design
A branch per agent, merged with a report.
The plan gives each agent a branch: a fork it can write to freely, created without copying data. A merge replays the branch's intents onto the target. When intents collide, the merge ladder tries the most precise rule that applies, and anything it cannot settle becomes a row in a conflict report you can query.
Two agents sell from one stock on their own branches. Pick a merge rule.
Worked exampleBranches are not built yet. Part of the idea already runs inside one database: a write transaction that conflicts at commit can be rebased when its intents are compatible, and is aborted when they are not.
Ways in
Embed it, script it or serve it.
The same engine sits behind each of these. There are no prebuilt binaries yet; you build from source. The README lists exactly what each surface serves today.
- Embedded in RustRuns today
Open a database directory in your own process. A synchronous facade wraps the async core.
cargo run -p fgdb --example embedded_sync - The fgdb CLIRuns today
Create, write, query, diff, seal and scrub from a shell.
--robotswitches to versioned NDJSON that an agent can validate.fgdb --robot query --db social.fgdbdir ... - The fgdbd serverRuns today
The native FGP protocol, an HTTP/1.1 JSON API, a subset of Bolt that official Neo4j drivers can use, and TLS 1.3.
fgdbd serve --config fgdb.toml - StudioRuns today
A read-only workspace in the browser, served by fgdbd at /studio/, with a small WebAssembly force layout.
http://127.0.0.1:8080/studio/
08 · Status
Where it stands today.
FrankenGraphDB has no release yet. This chapter separates what runs today from what is written but waiting for its tests, and from what is still design. It also reports speed as measured: on a fresh start it is much slower than an established engine.
The ledger
What runs, what waits, what is still a plan.
Drawn from the repository's implementation status and status report. The README marks the same lines in each section.
Runs todayBuilt, tested and in the current source tree.
- Durable commits with two barriers, tested at seven crash points
- Encrypted storage opened with a key file
- Reads at any earlier commit with
AS OF SEQ, andfgdb diff - GQL reads and writes: patterns, quantified paths,
OPTIONAL MATCH, aggregation,MERGE - Worst-case optimal joins and factorized batches over Elias–Fano runs
SUBSCRIBE TOchangefeeds for the life of a sessionhybrid.searchover text, vectors and hops- 32
fnx.*graph algorithms on the query's snapshot (two newer ones still await runtime qualification) - Capability tokens with twelve kinds of caveat
EXPLAIN (CERTIFICATE)and replay for native reads- RaptorQ repair symbols and
fgdb scrub fgdbd: FGP, HTTP/1.1 JSON, a Bolt subset, TLS 1.3 and Studio
Built, tests pendingThe code is written; its tests have not yet run on the exact tree.
- About 110 sections of the status file are marked as waiting to qualify: the code is in the tree, and its tests have not yet passed on that exact revision
- The latest whole-workspace proof, on November 24, was red: 9 of 10 core gates and 18 of 40 registered gates passed
In designSpecified in the plan and not built yet.
- Branches you can fork, write and merge
CREATE MATERIALIZED VIEW- Full serializable isolation across graph patterns (today: first committer wins, with rebase)
- Reading
AS OFa wall-clock time, and ranges withBETWEEN - Durable subscriptions and a vector index stored on disk
- Replication across machines (only the consensus core exists)
- HTTP/2, gRPC, WebSocket and Python bindings
- The rest of franken_networkx's 550-plus algorithms
- Every performance target in the plan
SpeedRuns today
Today it is slower than Kùzu.
Opening a database today authenticates and walks every stored object, so a fresh process spends seconds before its first answer: about 25 times Kùzu's time on the road graph and 70 times on the web graph. A server that is already running answers a point lookup in about 1.6 times Kùzu's time. None of the plan's 13 performance gates is active yet.
Compare a fresh process with a server that is already running.
InteractiveReceipts
Numbers you can check in the repository.
Every figure here comes from a file in the repository, and the project keeps a negative-evidence ledger of the times it broke its own rules.
- 1.88Mlines of RustIn 31 crates and one tool. Over a third of it, about 692,000 lines, is tests.
- 13,976tests passed, none failedThe last fully green workspace run, on November 4, 2026, with 38 tests ignored.
- 3,142of 3,897 openCypher casesmatched the expected rows. 680 matched an expected error, 21 refused a case that should succeed, 4 disagreed and 50 lack fixtures.
- 58negative-evidence entriesEach records a time the project broke one of its own rules, the fix, and the general shape of the mistake, so the next one is recognized.
- 7unsafe sites, in 3 cratesThe workspace forbids unsafe code everywhere else. Each of the seven sites is recorded in a ledger.
- 2direct outside dependenciesasupersync for the runtime and franken_networkx for algorithms, both pinned to a commit. Cargo.lock also lists the crates they use in turn.
Try it
From an empty directory to a query.
Build fgdb and fgdbd from source as the README describes, then run these in a new directory. The write commits at sequence 2, and the query reopens the database and returns Ada and Charles.
Quick start
fgdbd keygen --database social.keys
fgdb create --db social.fgdbdir --key-file social.keys --persist-bindings \
--label Person=1 --relation KNOWS=1 --property name=1
fgdb write --db social.fgdbdir --key-file social.keys \
"CREATE (:Person {name: 'Ada'})-[:KNOWS]->(:Person {name: 'Charles'})"
fgdb query --db social.fgdbdir --key-file social.keys \
"MATCH (a:Person)-[:KNOWS]->(b:Person) RETURN a.name AS source, b.name AS target"Built in the open
Read the plan. Watch it land.
The design plan is public: 28 sections and appendices, about 134,000 words, covering every format, protocol and invariant. The code lands on the public main branch, and the status report records what has passed and what has not. Star the repository to follow along.