FrankenGraphDB

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.

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.

Why one engine

Commit a write, then read from every part at once.

Interactive

Five 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

One snapshotPatterns and paths · Nearest embeddings · BM25 keyword search · What changed · Earlier versionscommit 4

Every part reads commit 4.

The lags on the left are illustrative: replication, embedding jobs, index refreshes and nightly copies each run on their own clock. On the right, every part of a FrankenGraphDB read is pinned to one commit sequence.

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.

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.

Snapshots in the plan

Pick a query and two commits. The diff lists only the rows that changed.

Interactive

At SEQ 5

    At SEQ 9

      fgdb diff

        The same twelve commits drive the graph at the top of the page. The command is 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.

        The commit protocol

        Pick a crash point, or step through a commit, and see what recovery finds.

        Interactive

          On disk after the crash

          Capsuleabsent
          Markerabsent

          Recovery

          …

          The seven points are the names the crash tests use, from 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.

          Sealed runs in the plan

          Change how many neighbours a vertex has and how many ids there are. Tap an id to see its bits.

          Interactive

          Low bits, stored as they are (l per id)

          High bits, as gaps in unary (a 1 per id, a 0 per bucket)

          Elias–Fano…bits per neighbour
          Plain 32-bit ids32bits per neighbour
          Plain 64-bit ids64bits per neighbour
          Bound…2 + ⌈log₂(U/n)⌉ bits per neighbour
          The ids are drawn at random from the range, the same way on every visit. A sealed run also stores the offsets into each vertex's list the same way, so finding the k-th neighbour of a vertex is a select on the high bits, not a scan.

          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.

          Scrubbing in the plan

          Tap symbols to corrupt them, then run a scrub.

          Interactive
          • Source symbol
          • Repair symbol
          • Fails its own MAC
          Each symbol carries its own MAC, so corruption is found and located before decoding. RaptorQ (RFC 6330) recovers K source symbols from almost any K that survive; with exactly K the standard allows a failure rate under 1%, and each extra symbol lowers it about a hundredfold. This figure treats any 20 as enough.

          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.

          Execution in the plan

          Step through a three-way intersection, or let it run.

          Interactive

          MATCH (a)-[:KNOWS]->(c), (b)-[:KNOWS]->(c), (d)-[:KNOWS]->(c) WHERE a = $x AND b = $y AND d = $z RETURN c

          Seeks0each one a jump, not a scan
          Shared ids found0
          A pairwise plan…rows it builds before the third list

          Each list is one vertex's sorted neighbours. The engine seeks with a galloping search over the compressed run, using portable SIMD where the target supports it and plain code where it does not.

          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.

          Factorization in the plan

          Raise d and compare two ways to hold the same answer.

          Interactive

          MATCH (p)<-[:KNOWS]-(h:Person {name:'Ada'})-[:WROTE]->(w) RETURN p.name, w.title

          Flat rows

          64 rows

          Factorized: Ada × people × writings

          17 values

          The join engine emits Flat, Product and Union batches, which nest, and each batch carries its row count. Flattening is a separate, explicit step that follows a fixed order. The plan extends the same algebra to run slices read straight from storage and to paths.

          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.

          Standing queries in the plan

          Tap two people to add or remove a KNOWS edge, then commit.

          Interactive

          SUBSCRIBE TO MATCH (a)-[:KNOWS]->(b)-[:KNOWS]->(c) RETURN a.name, b.name, c.name

          What the subscriber receives

            Rows in the view0
            Rows the delta touched0at the last commit
            Recomputed from scratch…after every commit
            For a join of E with itself, the change is ΔE⋈E + E⋈ΔE + ΔE⋈ΔE, where E is the edge set before the commit. With signed weights the same formula handles deletions. The figure recomputes the whole view after each commit and compares.

            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.

            Determinism contracts

            Run the query a few times under each mode, then replay the certificate.

            Interactive

            EXPLAIN (CERTIFICATE) MATCH (p:Person) RETURN p.team, p.name ORDER BY p.team LIMIT 5

            Rows

              Certificate

                Everyone in a team has the same sort key, so the order inside a team is a tie, and LIMIT 5 cuts through the Machines tie. STRICT breaks ties by a fixed rule, the smallest canonical value first. RELAXED lets parallel workers return ties in any order and records that in the certificate. The certificate fields shown are a sketch, and the digests are 64-bit FNV for brevity; the engine uses BLAKE3.

                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.

                Simulation-first testing

                Two clients each sell one item from a stock of 10. Pick a rule and open a schedule.

                Interactive

                  Each client reads the stock, then writes it back minus one. The four steps can interleave in six ways. First committer wins is the engine's rule today: the second commit sees that the stock changed after its read, so it is aborted and its client retries. The plan's merge ladder can instead re-evaluate the decrement against the new value.

                  Today 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.

                  Beacon, the index layer

                  Pick a question and switch the three rankings on and off.

                  Interactive

                  Fused, score = Σ 1 / (60 + rank)

                    BM25 uses k1 = 1.2 and b = 0.75 over the short bios. The vectors are three hand-set coordinates per person, the way the README's example stores them in properties e0, e1 and e2. Fusion adds exact fractions, so equal scores tie exactly and break by a fixed rule.

                    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.

                    Enforcement in the plan

                    Compare a filter applied after expansion with a scope applied before it.

                    Interactive

                    The token here may read :Person and :KNOWS. The two :Project vertices are outside its scope. Caveats come in twelve kinds: graphs, branches, labels, edge types, properties, vertices, a required label, vertex and edge property predicates, a time window, a range of commits, and read limits.

                    BranchesIn 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.

                    The merge ladder

                    Two agents sell from one stock on their own branches. Pick a merge rule.

                    Worked example
                    Stock starts at 10 and must never go below 0. Agent A sells 3. In escrow mode the stock is split into rights before the agents fork, 5 each here, and a sale beyond a branch's rights must ask for a transfer first.

                    Branches 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. --robot switches 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, and fgdb diff
                    • GQL reads and writes: patterns, quantified paths, OPTIONAL MATCH, aggregation, MERGE
                    • Worst-case optimal joins and factorized batches over Elias–Fano runs
                    • SUBSCRIBE TO changefeeds for the life of a session
                    • hybrid.search over 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 OF a wall-clock time, and ranges with BETWEEN
                    • 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.

                    Performance targets

                    Compare a fresh process with a server that is already running.

                    Interactive
                    Point lookups against Kùzu 0.11.3 on the same Linux host, from the November 2026 status report. Fresh-process times are medians of twelve runs; resident times are medians of four. Every one of the 160 release-build answers matched an independent count.

                    Receipts

                    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.

                    Storage and time

                    The commit stream, history, branches and the on-disk formats.

                    ChronicleStrataFormats

                    Queries

                    The algebra, the executor, incremental views and search.

                    LoomRippleBeacon

                    Security and serving

                    Capabilities, the server, its protocols and replication.

                    WardenFabricProtocol

                    Proof

                    Determinism, the test ladder, the invariants and the release gates.

                    DoctrineInvariantsGates