Dicklesworthstone/frankengraphdb
Sobre
Rust property-graph database with MVCC, time travel, branch-pinned reads, GQL and openCypher queries, incrementally maintained standing queries, and a RaptorQ-coded commit log.
Dados e análiseCrescimento medido de estrelas
- em 24 h
- 0
- em 7 dias
- +1
- em 15 dias
- +1
- em 1 mês
- Coletando histórico
Variações líquidas em períodos sobrepostos, não totais diários. Medições ausentes ficam em branco. Estrelas indicam interesse, não qualidade.
README.md
Originalfrankengraphdb
A blank-slate, memory-safe, ultra-high-performance property-graph database in Rust, built on the Franken/asupersync ecosystem. It unifies MVCC, time-travel history, git-style branches, replication, and change subscriptions into a single fountain-coded commit stream, runs transactional writes and static-CSR analytics on one temperature-tiered store, and makes every query result deterministic, auditable, and replayable.
# Run the embedded example from a source checkout
git clone https://github.com/Dicklesworthstone/frankengraphdb
cd frankengraphdb
cargo run -p fgdb --example open_a_database
The CLI and server can write a graph, query the new state, and recover it after restart. On a 176 MB test database, fgdb query --buffered streamed 6,144 rows under a 60 MiB memory limit. An ordinary local query exhausted that limit while opening the same database, even with LIMIT 0. The reality check and bridge plan records the tested revisions, commands, and open qualification work.
A note on tense (read this first). This README is written in the present tense, as if the entire design in
COMPREHENSIVE_PLAN_FOR_THE_DESIGN_OF_FRANKENGRAPHDB.mdis fully realized: the 1.0 target state where every performance gate is green and every subsystem is live. This is a deliberate choice. It lets the document describe the finished system so it gets trued-up in place as milestones land (§19's gates G1→G4) rather than rewritten from scratch later. Where the plan itself stages something as genuinely future work (horizontal sharding, covered under Limitations), the README says so plainly. Everything else below is the spec of the system this repository builds.
TL;DR
The problem. Every graph database on the market is a compromise fossilized around one old decision. Neo4j chose pointer-chasing on the JVM (great ergonomics, painful memory, a runtime that took 15 years to vectorize). TigerGraph chose MPP with a proprietary language and a platform-sized footprint. Kùzu got the query story right (columnar CSR + vectorization + factorization + worst-case-optimal joins), and then it left the commons: Apple acquired Kùzu Inc. (agreed October 2025, disclosed February 2026 via Apple's EU DMA filing) and the upstream repository was archived read-only — community forks carry the architecture forward while inheriting its gaps, and no engine in the space has the durability, temporal, multi-writer, or verification story. Memgraph/FalkorDB are fast in-memory engines with thin durability. JanusGraph/NebulaGraph pay a permanent impedance tax on a generic KV underlay. The academic frontier has solved essentially every hard subproblem in isolation, yet no shipping system has ever composed them.
The solution. frankengraphdb composes them in an embedded library (fgdb), a server (fgdbd) and a CLI (fgdb). They share a GQL engine with an openCypher compatibility surface. The project targets larger-than-memory operation in all three. Today, local query --buffered can stream supported scans from disk under a memory limit. Ordinary database open still materializes the snapshot. Structured concurrency, capability contexts, fountain coding and a deterministic lab runtime come from asupersync.
Why frankengraphdb:
frankengraphdb |
|
|---|---|
| Durability | Content-addressed, RaptorQ-erasure-coded commit stream. No double-write journaling anywhere; bit-rot is a maintenance event, not an outage. |
| Time | Unbounded, queryable history (FOR SYSTEM_TIME AS OF/BETWEEN) as a corollary of how MVCC works, not a bolt-on temporal engine. |
| Branches | git-style database branches: O(1), zero-copy, 10k+ concurrent. Fork, mutate, run analytics, merge or discard. |
| Storage | Three temperature tiers per vertex: inline micro-adjacency → sorted delta blocks → sealed compressed CSR runs. Hot minority pays delta cost; cold majority sits below raw CSR. |
| Execution | One Free-Join operator family: binary hash joins, worst-case-optimal multiway joins, and factorized intermediates in one continuum, over runs that are already tries. |
| Incremental | One DBSP-style Z-set engine drives recursion, materialized views, subscriptions, and incremental analytics; the commit stream is the delta stream. |
| Determinism | Same state + same query + same policy ⇒ byte-identical results, including order. Every result ships an auditable, replayable plan certificate. |
| Verification | The whole database runs under a deterministic lab runtime: virtual time, DPOR schedule exploration, chaos injection, seed-replayable failures. FoundationDB-class, largely by inheritance. |
| Governance | Capability tokens (macaroons) with graph caveats compile to planner-enforced row/subgraph security, applied before expansion, never as a post-filter. |
| Retrieval | hybrid.search(text, vector, seeds, expand) fuses ANN + BM25 + graph expansion inside one planner: GraphRAG's retrieval step as one optimized operator, transactional and time-travelable. |
| Safety | unsafe_code = "forbid" workspace-wide, with a ledgered boundary for the few SIMD/arena/VFS islands, each carrying a bit-identical scalar fallback. |
| Dependencies | Closed universe. std + the pinned nightly + three owned foundations. No serde, no tokio, no rocksdb, no arrow, no tantivy, no hnswlib in first-party code or on any new dependency path. Ever. (The foundations' own transitive dependencies, which do include serde, are enumerated and pinned in deny.toml.) |
Quick example
-- Create a graph and write some data
CREATE GRAPH social;
INSERT (:Person {name: 'Ada', born: 1815})
-[:KNOWS {since: 1833}]->
(:Person {name: 'Charles', born: 1791});
-- Pattern match with a quantified path and a shortest-path selector
MATCH p = SHORTEST (a:Person {name: 'Ada'})-[:KNOWS]->{1,4}(b:Person)
RETURN b.name, path_length(p);
-- Time travel: the graph as it was at a past commit; no separate temporal engine
MATCH (p:Person) FOR SYSTEM_TIME AS OF SEQ 41999 RETURN p.name;
-- Branch like git: fork, experiment, keep or throw away; O(1), zero-copy
CREATE BRANCH what_if FROM social@trunk;
MATCH (p:Person {name: 'Ada'}) AT BRANCH what_if SET p.born = 1816;
MERGE BRANCH what_if INTO trunk; -- semantic intent-log merge; conflicts are a queryable report
-- In-database analytics over the live snapshot, zero-copy, under full isolation
CALL fnx.pagerank(GRAPH social) YIELD node, score
RETURN node.name, score ORDER BY score DESC LIMIT 10;
-- Standing query: a live changefeed maintained incrementally by Ripple
SUBSCRIBE TO MATCH (a:Person)-[:KNOWS]->(b:Person) WHERE b.born < 1800;
-- GraphRAG retrieval in one fused operator (ANN + BM25 + graph expansion, exact RRF)
CALL hybrid.search(
text => 'computing pioneers', text_property => 'bio',
vector => $query_embedding, vector_properties => ['e0', 'e1', 'e2'],
seeds => $ada, relation => 'KNOWS', max_hops => 2,
k => 20, fusion => 'RRF'
) YIELD node, score RETURN node.name, score ORDER BY score DESC;
-- Every result is auditable: get its plan certificate
EXPLAIN (CERTIFICATE) MATCH (a:Person)-[:KNOWS]->(b) RETURN count(*);
Available today. On November 24, 2026, six of the eleven examples ran against a fresh database. The insert committed, the shortest path returned Charles at one hop, and the historical query returned both names at retained sequence 2. The hybrid query ranked Ada with supplied parameters and searchable properties.
EXPLAIN (CERTIFICATE)returned the plan and digest. The server delivered the subscription baseline throughfgdb remote subscribe. Embedded callers can useDatabase::subscribe_native.Graph creation by name, the three branch mutations, and a named
GRAPH socialargument to PageRank remain design examples. UseCALL fnx.pagerank() YIELD node, scoreon the current graph. Embedded hosts can resolve a read-onlyAT BRANCHselector to a pinned snapshot throughDatabase::query_with_branch_resolver.Isolation today. Reads pin one generation. A writer validates its recorded reads and writes against changes committed since its basis. Conflicting transactions can abort at commit. The plan tracks graph SSI and its rw-antidependency checks under FG-INV-05. See the runnable quick start.
Shortest paths with per-hop property filters
A quantified relationship can test each candidate edge before shortest-path selection. This query finds the fewest flights from a given airport when every flight costs at most the supplied fare:
MATCH p = ALL SHORTEST WALK
(a:Airport {code: $origin})-[f:FLIGHT WHERE f.fare <= $maxFare]->{1,4}(b)
RETURN b.code, p
The guard compares a property of the named relationship with a literal, a parameter or a closed expression. It accepts =, <>, !=, <, <=, > and >=, with AND between comparisons. Missing or NULL properties fail ordinary comparisons. The same guard works inside [f:FLIGHT*1..4 WHERE ...] and with ordinary quantified walks. An ineligible direct edge leaves a longer qualifying route available. ALL SHORTEST retains tied qualifying routes, including parallel edges.
Correlated filters in OPTIONAL MATCH
An OPTIONAL MATCH after WITH, UNWIND or a returning CALL can filter its candidate matches with correlated EXISTS/NOT EXISTS, COUNT { ... }, and pattern-comprehension or list predicates. For example:
MATCH (person:Person)
WITH person
OPTIONAL MATCH (person)-[:KNOWS]->(friend)
WHERE COUNT { MATCH (friend)-[:KNOWS]->(other) } >= 2
RETURN person, friend
Each person keeps qualifying friends, including parallel-edge occurrences, or one row with a NULL friend when none qualify. The predicate runs inside the optional match before null extension. Subquery-local names remain private; later clauses retain the original outer bindings. Multi-clause subquery bodies use the same native expression and correlated Apply operators as ordinary reads, with their existing work, scratch, cancellation and authorization controls. Runtime-qualified on 2026-11-11 via native_optional_subqueries.rs; full workspace gate status is tracked in implementation status.
Optional subqueries and procedures — qualification pending
The text front end now lowers returning read-only OPTIONAL CALL bodies through the existing native optional Apply operator:
MATCH (person:Person)
OPTIONAL CALL (person) {
MATCH (person)-[:KNOWS]->(friend)
RETURN friend
}
RETURN person, friend
Each incoming person occurrence retains all qualifying body results, or one row with a NULL friend when the body returns none. Explicit import lists, wildcard CALL (*) / OPTIONAL CALL (*), and legacy importing WITH use the existing native scope rules. A wildcard imports every visible caller variable, including graph identities, lists, maps and NULL values; it does not expose internal columns. The same imports reach every UNION arm and nested subqueries use their own enclosing scope.
For example, the query above can use OPTIONAL CALL (*) in place of OPTIONAL CALL (person). This also works for read-only subqueries inside atomic write chains. Body WITH clauses retain the existing native projection behavior: carry an imported variable through each inner WITH if a later clause needs it. Full Cypher scope-clause lifetime semantics remain separate work.
Named procedures also accept OPTIONAL CALL fnx.bridges(direction => 'undirected') YIELD node, neighbor RETURN node, neighbor. A WHERE attached to YIELD filters inside the optional invocation before null extension. A subsequent explicit WITH ... WHERE filters its completed output. Procedure errors, cancellation and authorization or budget refusals still propagate.
Source added 2026-11-14; focused regressions are committed, but compilation was interrupted during dependency preparation and the runtime tests did not execute. See implementation status for the precise qualification boundary.
Writing optional subqueries — qualification pending
Write-bearing OPTIONAL CALL now uses the same native write-chain owner as
ordinary writing subqueries:
UNWIND [1, 2] AS value
OPTIONAL CALL (value) {
CREATE (:Sample {value: value})
WITH value WHERE value = 2
RETURN value AS matched
}
RETURN value, matched
The statement creates both nodes. The incoming occurrence with value = 1
survives with matched = NULL; the occurrence with value = 2 exports 2.
Filtering away a body's returned rows does not undo its writes. For a body with
UNION, null extension happens only after every arm finishes, once per empty
invocation. Duplicate outer rows remain separate occurrences. Unit subqueries
without RETURN also accept OPTIONAL and keep their existing row-preserving
semantics.
The body and surrounding clauses share the existing transaction, cancellation,
capability and resource controls. Errors still refuse the statement; they never
become NULL results. The public Database::query_write regression sources cover
these paths, with additional cases for rollback, authority and output limits.
Compilation and runtime qualification remain pending; see
implementation status.
Maintained directed reachability — qualification pending
Native standing queries and subscriptions can maintain distinct endpoint pairs for an unbounded directed path of one or more edges:
SUBSCRIBE TO
MATCH (source)-[:KNOWS*]->(target)
RETURN DISTINCT source, target
The compiler connects the existing maintained one-hop relation to the deletion-safe reachability operator and an endpoint projection. Each reachable pair appears once, even when several paths or parallel edges support it. Removing one parallel edge preserves remaining support; breaking the last path retracts the pair. A nonempty directed cycle can make a vertex reach itself. Relation unions, wildcard relations, reverse direction, output aliases and reversed endpoint columns use the same path. Capability masking applies to the one-hop source before recursion, so a hidden intermediary cannot create a visible connection.
This profile requires DISTINCT and both endpoint columns. Path bags or
captures, undirected trails, zero-hop or bounded intervals, endpoint predicates
and ordering/pagination inside this pattern remain unsupported. Registrations
retain the existing session-local resident-state and resource limits; this
does not introduce durable subscriptions or a general recursive language.
Maintained correlated graph queries
Standing queries and native subscriptions can maintain eligible returning CALL subqueries and OPTIONAL MATCH continuations through the existing incremental joins and projections:
SUBSCRIBE TO
MATCH (person:Person)
CALL (person) {
MATCH (person)-[:KNOWS]->(friend)
RETURN friend
}
RETURN person, friend
The maintained circuit preserves duplicate occurrences and updates its result from committed changes. Optional continuations retain one NULL-extended row per outer occurrence when the last matching witness disappears. The initial profile requires a complete graph source whose independent evaluation cannot introduce a data error; graph identity outputs and safe constant/column projections qualify. General per-invocation aggregation, pagination, nested correlation and fallible independent property/catalog outputs remain outside this profile. DISTINCT and count bodies have the additional profiles below. Registrations retain the existing session-local, resident-state contract. Runtime-qualified on 2026-11-11 via native_standing_sets.rs; see implementation status.
Per-invocation DISTINCT can remove parallel witnesses inside an eligible returning subquery while preserving each occurrence of its outer row:
SUBSCRIBE TO
MATCH (person:Person)
CALL (person) {
MATCH (person)-[:KNOWS]->(friend)
RETURN DISTINCT friend
}
RETURN person, friend
The circuit maintains one body result for each distinct imported argument tuple and rejoins it to the original outer bag. Each DISTINCT barrier retains its invocation identity, so results from different arguments cannot collapse together. NULL arguments remain distinct from ordinary false/zero values; repeated or reordered imports retain their exact meaning. Later filters and projections stay in order, and optional bodies extend missing results only after the complete body finishes. Parallel-edge deletions change a distinct friend result only when its last witness disappears. Private witness allowances survive rebuilds independently of final-result quotas. The source-effect, finite-width and no-local-page restrictions still apply.
Eligible EXISTS, NOT EXISTS and existence-valued return expressions also have a maintained path, including after WITH and UNWIND:
SUBSCRIBE TO
MATCH (person:Person)
WITH person
WHERE NOT EXISTS { MATCH (person)-[:KNOWS]->(friend) }
RETURN person
Matching and nonmatching branches share the same complete sources and use the existing semi-join and anti-join derivatives. Additional witnesses do not duplicate an outer result; only a first or last matching witness changes its Boolean presence. The compiler recognizes its literal-TRUE, LIMIT-one existence wrapper specifically. General per-invocation pages, aggregates and fallible discarded expressions still refuse.
Eligible correlated COUNT { ... } expressions and returning CALL bodies with count(*), count(value) or count(DISTINCT value) also use maintained native grouping:
SUBSCRIBE TO
MATCH (person:Person)
WITH person
RETURN person,
COUNT { MATCH (person)-[:KNOWS]->(friend) } AS degree
Counts return zero for an absent match and remain independent of duplicate outer occurrences. count(*) includes parallel witnesses; count(friend) excludes NULL values; count(DISTINCT friend) counts unique neighbors and changes only when a neighbor's first or last witness changes. For example:
SUBSCRIBE TO
MATCH (person:Person)
WITH person
CALL (person) {
MATCH (person)-[:KNOWS]->(friend)
RETURN count(DISTINCT friend) AS neighbors
}
RETURN person, neighbors
The right-hand source is first restricted to keys needed by current outer rows, then grouped once per key before its count is joined back to the original outer bag. This also prevents unused groups from causing conditional count-overflow errors. Witness rows use the existing private aggregate-input budget; counts retain native checked Int64 conversion. Value counts require a safely projected column of the independent graph source, including copied or reordered aliases. Typed equality correlation and keyless counts qualify; computed/property arguments, outer-only arguments, additional correlated predicates, HAVING, local pages and relational DISTINCT remain unsupported.
Explicit capability-scoped native transactions
Trusted embedding hosts can use Database::begin_authorized_write to stage
several statements under one Warden capability and publish them with one
explicit commit. The returned AuthorizedWriteTransaction exposes
stage_chain, read, cumulative statistics, commit and rollback.
Dropping it rolls back the unpublished prefix.
Compile a single CREATE, mutation or MERGE with
PreparedGraphWriteChainText::prepare_statement, then bind its parameters.
The same entrypoint accepts existing multi-clause write chains. For example,
one owner can stage a CREATE, update that node in a later statement, and read
the updated value before committing. Its database borrow is released between
calls; its private workspace and cumulative authorization allowance remain.
Every stage keeps the existing field/endpoint masking and checked graph-output admission. A statement error, cancellation, output refusal or unwind aborts all preceding staged effects. Read operations and RETURN require read authority. Further statements refuse a different database handle or an advanced write basis; COMMIT preserves the native conflict and ambiguous outcome semantics.
This local API was runtime-qualified on 2026-11-11 via the native regression scenarios. The FGP and Bolt explicit write adapters and atomic HTTP transaction scripts are implemented, with runtime qualification pending. Durable transaction reattachment remains open; see implementation status.
Explicit read-only transactions — qualification pending
Database::begin_authorized_read and EmbeddedReadView::begin_authorized_read
return an AuthorizedReadTransaction under Read authority. Its sequential
query calls retain one immutable snapshot and one cumulative signed allowance
for input, native execution and delivered rows. Concurrent writes cannot change
its answers. query_with_output also admits trusted host conversion before
delivery. query_with_graph_output supplies a checked metadata reader for graph
serialization: labels, properties and relationship endpoints come from the same
snapshot and spend the original permit, with field and endpoint masking applied
before copying. Metadata lookups share bounded work and scratch accounting during
conversion. A different historical cut, a statement or output failure,
cancellation, expiry or issuer retirement closes the owner and releases its pin.
FGP clients use begin_read_transaction, then the existing
execute_transaction and commit_transaction methods. Successful close returns
ReadClosed with the original basis and statement count, including zero for an
unused owner. It publishes no marker and allocates no commit sequence. The client
refuses a Write mode locally; a peer bypassing that check is refused by the
server and loses its read owner. The connection's recovery fence also covers
these results and data-dependent errors.
For finite scripts, the Rust client's execute_read_transaction_batch and
execute_read_transaction_batch_streaming methods manage that same owner.
The CLI exposes it as fgdb remote ... transaction --read-only --statements-file reads.json: the file is a JSON array of 1–32 entries with "mode":"read",
statement and optional typed parameters. The complete script is admitted
before BEGIN; the CLI rejects write entries and savepoint controls before
credential access. Its columns and rows remain provisional until the final
outcome:"read_closed" result confirms the original basis. The existing methods
and command without --read-only retain their write-owner behavior.
HTTP clients use POST /v1/databases/<name>/read-transaction with the same
{"statements":[...]} envelope as /transaction and only read-mode entries.
Read authority is checked before body diagnostics. Every statement retains one
native snapshot and one cumulative signed allowance; successful close reports
the original basis and seq with committed:false, without creating a graph
commit. A late failure returns one error with no successful-prefix results.
The original /transaction route still requires write authority. See
the HTTP request example and limits.
Managed SDK, CLI and HTTP regression sources are present; runtime qualification
remains pending.
Bolt BEGIN with read mode or a Read-only capability now retains the same native
owner. Every RUN, graph metadata lookup and checked result conversion spends
its original allowance. Separate qid cursors retain the BEGIN snapshot, even
while another connection commits. COMMIT performs the native final authority
and cancellation check and returns that original snapshot's bookmark. Any failed
statement discards the owner and its outstanding cursors. Protected results and
data-dependent failures retain their recovery-generation fence through socket
writes and flushes.
See the wire contract and client example. The default protocol suites pass 58 tests. Native, transport-client and server runtime qualification remains pending because the pinned foundation dependency compiler was killed before first-party compilation; no durable lease or full-SSI guarantee is implied.
Exact counts inside write transactions
Eligible transaction counts read exact metadata pinned to the transaction's own snapshot, plus its canonical staged changes. They do not scan the full vertex or edge population:
MATCH (person:Person) RETURN count(*) AS people
MATCH (a)-[edge:KNOWS]->(b) RETURN count(edge) AS relationships
This includes all-vertex, single-label, all-directed-edge and single-relation populations, and identity counts whose nonnull or distinct semantics the existing binder proves. Staged creations, label changes, edge deletions and vertex cascades participate immediately; savepoint rollback restores the corresponding answer. An advancing database head cannot change a transaction's pinned count. Accepted snapshot refresh and native rebase preparations advance the metadata with the basis.
Counts retain population conflict witnesses, so a relevant concurrent deletion, insertion or label change cannot be missed just because no rows were enumerated. Unrelated property or relation changes can remain independent. Conditional staged ENSURE proposals retain identity observations too, preventing replay from changing a previously observed local count. Unknown metadata, property filters and unproved endpoint-label intersections keep their ordinary source execution. This uses the existing bounded transaction and aggregate owners; it does not establish full SSI or a new durable statistics format. Runtime-qualified on 2026-11-11 via write_txn_count_metadata.rs; see implementation status.
Nested MAP parameters in transaction reads
WriteTxn::query and the CLI's transaction --query accept nested MAP fields in node and relationship property patterns, using the same argument handling as ordinary reads:
MATCH (person:Person {id: $request.person.id})
RETURN person
Each CLI read step keeps its own parameters. Ordinary transaction reads include staged changes; an explicit FOR SYSTEM_TIME AS OF SEQ selects retained committed history at or before the transaction's original basis. MAP fields remain available in other expressions, and generated bindings avoid collisions with caller parameters. Runtime-qualified on 2026-11-11 via native_transaction_map_fields.rs; see implementation status.
Relationship reuse in MATCH
A positive MATCH uses each relationship ID at most once across the entire
clause, including quantified paths and comma-separated patterns. Repeated
vertices and parallel relationships with different IDs remain valid. Each
later MATCH, OPTIONAL MATCH, or existential pattern starts a new domain.
// One relationship cannot provide both r and s in this clause.
MATCH (a)-[r:KNOWS]->(b)<-[s:KNOWS]-(c) RETURN a, b, c
// Explicitly allow relationship reuse when a walk needs it.
MATCH REPEATABLE ELEMENTS (a)-[:KNOWS*1..4]-(b) RETURN a, b
DIFFERENT EDGES and DIFFERENT RELATIONSHIPS explicitly name the default.
Path modes such as TRAIL and ACYCLIC apply their own restrictions inside
that match mode. Open-ended routes require a supported termination rule;
the cold-query profile below lists the admitted combinations.
Analytics over multiple labels and relationship types
Native CALL fnx.* accepts an initial literal graph map such as
{labels:['Person','Company'], relations:['KNOWS','WORKS_WITH']}.
This selects vertices carrying either label and edges of either relationship
type whose two endpoints are selected. Isolated selected vertices remain in
the graph. Each list admits up to 16 distinct names; duplicates and list order
do not change the selection, and an empty list keeps all identities already
allowed by the session.
These selections apply to ordinary, authorized, transactional and decoded
buffered analytics. A sealed view still holds one relationship partition, so
it supports label unions with exactly one matching relationship type.
Native standing queries and server subscriptions carry these unions through
connected components, weakly/strongly connected components, core numbers,
triangle counts and clustering coefficients. They preserve isolated vertices,
overlapping label membership and counted parallel-edge support as commits
change the graph. Analytic CALL fnx.* server subscriptions retain their
requirement for unrestricted label, relationship and property scope, while
native GQL subscriptions project over the capability's pre-expansion scope.
Runtime-qualified on 2026-11-11 via gql_fnx_projection.rs and
native_standing_sets.rs; see
IMPLEMENTATION_STATUS.md.
Restarting maintained core-number analytics
Trusted embedded callers can save a direct single-relation undirected core-number registration and restore it after reopening the same database:
let core = db.register_standing_core_numbers(&query, relation, policy)?;
db.save_standing_core_numbers_checkpoint(&commit, &query, &core, "core-analysis")
.await?;
// The same named restore is available after reopening with the existing keys.
let (restored, outcome) = db
.load_or_rebuild_standing_core_numbers_checkpoint(
&commit, &query, "core-analysis", relation, policy,
)
.await?;
let number = db.standing_core_number(&query, &restored, vertex)?;
The checkpoint preserves isolates, full-width identities and parallel-edge
support. Restore reconstructs and verifies the core values from saved topology,
then applies authenticated commits through the current head before returning
a handle. A valid checkpoint avoids a base graph scan; reconstruction still
processes the saved topology. Missing or incompatible optional state rebuilds
under the supplied policy, while cancellation, exhausted quotas and damaged
authoritative history return errors. outcome distinguishes restoration from
rebuilding. This API preserves typed core-number state; server subscription
identity and acknowledged output are not persisted. Runtime qualification
remains pending in implementation status.
The six bets
No single trick makes this a leapfrog. The composition of six bets does, each at or beyond the current frontier, each feasible only because the foundation libraries already exist.
| Bet | One-line statement |
|---|---|
| B1 · One Version Universe | MVCC versions, time-travel history, replication stream, change subscriptions, and git-style branches are the same mechanism: an append-only, content-addressed, RaptorQ-coded commit stream (Chronicle). |
| B2 · Graph-Structured LSM ("Strata") | Adjacency lives in three temperature tiers (versioned delta blocks → sealed compressed CSR runs → archived anchors), so one store targets high transactional ingest and static-CSR-class scans; the actual rates are CI-enforced benchmark gates, not assumptions. |
| B3 · Unified Factorized/WCO Execution ("Loom") | One Free-Join operator family subsumes binary hash joins, worst-case-optimal multiway joins, and factorized intermediates, running vectorized and morsel-parallel over Strata runs that are already tries. |
| B4 · Incremental Everything ("Ripple") | A DBSP-style Z-set delta algebra is the single engine for recursive queries, materialized views, standing queries, and incremental analytics, fed by the commit stream, which is already a Z-set stream. |
| B5 · Determinism as a Product Feature | CGSE tie-break policies, complexity witnesses, and plan certificates make every eligible STRICT result byte-reproducible and auditable; every adaptive decision emits a replayable decision card; the whole database runs under the lab runtime for DPOR-explored, seed-replayable testing. |
| B6 · Agent-Native by Construction | Branch-per-agent isolation with semantic merge, capability-scoped subgraph authorization, provenance as first-class edges, hybrid vector+text+graph retrieval in one planner, and deterministic replay of any agent's reads. |
Design philosophy
These are the constitutional, non-negotiable constraints the whole system is built under. They read like restrictions; they are the moat.
- The dependency universe is closed. Allowed:
core/alloc/std, the pinned Rust nightly, and three foundations:asupersync(runtime, RaptorQ, networking, lab runtime, macaroons), thefnx-*crates offranken_networkx(550+ graph algorithms, the CGSE determinism doctrine), and design-level reuse offrankensqlite. Every codec, sketch, index, parser, and wire format is built in-house. The entire dependency surface is auditable, deterministic under lab, and owned. - Memory safety is structural.
unsafe_code = "forbid"at the workspace level, with an unsafe boundary ledger for the handful of crates that need raw pointers (buffer arenas, SIMD kernels, mmap in the VFS). Everyunsafeblock gets a ledger row and a bit-identical scalar fallback. Cxeverywhere. Every function that does I/O, takes a lock, allocates from a shared arena, or can block accepts&Cx, asupersync's capability context. Swap theCxand the entire database runs under the lab runtime. It also makes read-only connections structurally unable to express writes, and cancellation-correct query timeouts structural rather than conventional.- Deterministic by default. Same state + same query + same policy ⇒ byte-identical results, always, including result order. Nondeterminism is opt-in and declared in the certificate.
- The commit stream is the source of truth. There is no mutable primary file. The only mutable object in a database directory is
manifest.root. Everything else is immutable, content-addressed, and erasure-coded. Derived structures (indexes, views, statistics) are never more authoritative than the commit stream; recovery discards and rebuilds them. - Prohibited shortcuts are constitutional. No global-lock "interim" transaction model; no
HashMap<VId, Vec<EId>>presented as storage; no snapshot isolation quietly labeled "ACID"; no parser-interprets-AST engine; no non-durable benchmark mode reported as a result; no serde-derived enum as a durable format; no detached background thread.
How it works
frankengraphdb is nine named subsystems over one commit stream. Each maps to a crate family (§18 of the plan) and a supervised region in the process tree.
┌──────────────────────────────────────────────────────────────────────────┐
│ FABRIC + WARDEN sessions · macaroon caveats · admission control │
│ GQL · openCypher · Datalog over FGP · HTTP/2 · gRPC · WS · Bolt │
└──────────────────────────────────────────────────────────────────────────┘
▼
┌──────────────────────────────────────────────────────────────────────────┐
│ LOOM parse → GLA algebra → cost-based optimizer → │
│ vectorized, morsel-parallel FreeJoin / factorized / path ops │
└──────────────────────────────────────────────────────────────────────────┘
▼ ▼
┌──────────────────────────────────┐ ┌──────────────────────────────────┐
│ PRISM fnx algorithms over │ │ RIPPLE DBSP Z-set circuits │
│ SnapshotGraphView (zero-copy) │ │ views · subscriptions · stats │
└──────────────────────────────────┘ └──────────────────────────────────┘
▼
┌──────────────────────────────────────────────────────────────────────────┐
│ STRATA Tier I inline · Tier D delta blocks (block-MVCC) · │
│ Tier R sealed Elias-Fano/varint CSR runs · Tier A anchors │
│ BEACON B-tree/hash · adjacency views · FTS/BM25 · HNSW · path idx │
└──────────────────────────────────────────────────────────────────────────┘
▼
┌──────────────────────────────────────────────────────────────────────────┐
│ CHRONICLE (B1) content-addressed ECS objects · RaptorQ symbols · │
│ CommitCapsule + two-fsync CommitMarker chain · WriteCoordinator · │
│ retention tiers = temporal DB · branches · scrub / self-heal · │
│ the only mutable file: manifest.root │
└──────────────────────────────────────────────────────────────────────────┘
▼
┌──────────────────────────────────────────────────────────────────────────┐
│ AEGIS Raft-sequenced markers · RaptorQ bulk plane · │
│ bit-identical replicas · bonded multi-donor seeding · PITR │
└──────────────────────────────────────────────────────────────────────────┘
All of it runs under FGDB-SIM (asupersync lab runtime): virtual time,
DPOR, chaos, seed-replayable failures. Same code, a different Cx.
- Chronicle (B1): the ECS-native durability substrate. Every durable thing is an immutable, content-addressed object (
ObjectId = Trunc128(BLAKE3(...))) stored as RaptorQ symbols. A commit is the two-fsync protocol: build a deterministicCommitCapsule(snapshot basis + graph intent log + block deltas + SSI witnesses) off the critical path, then a single-actorWriteCoordinatorvalidates, allocates a gap-freeCommitSeq, fsyncs the capsule, appends a ~100-byteCommitMarker, and fsyncs again. Retired versions don't die; they cool through retention tiers, which are the temporal database (AeonG's anchor+delta, where the deltas are commit capsules we already stored). Branches are just aBranchManifestover shared content-addressed state. - Strata (B2): the storage engine that refuses to pick a point on the write/scan/space trilemma. Adjacency for each
(vertex, direction, edge_type)triple migrates by temperature: inline in the vertex directory row (the long tail of power-law graphs lives here, below raw CSR), then sorted 256-edge delta blocks with per-block MVCC, then sealed Elias-Fano + delta-varint CSR runs (2.5–5 bits/edge typical), then cold anchors. Most vertices read as pure CSR with zero delta presence. - Loom (B3): one Graph-Logical Algebra, one cost model, no "graph engine bolted to SQL engine" seam. The
FreeJoinoperator is a continuum from binary hash joins to worst-case-optimal Generic Join; for graph atoms, sealed runs already are the tries, so intersections run as SIMD galloping over compressed neighbor lists. Factorization is a type in the algebra, not an executor trick: a 3-hop friends-of-friends result that would be 10⁸ flat rows stays ~10⁴ run slices, even over the wire. - Ripple (B4): a from-scratch DBSP-style Z-set circuit engine. Recursion is incremental fixpoint (semi-naïve for free).
CREATE MATERIALIZED VIEW … REFRESH INCREMENTALinstalls a circuit whose output is snapshot-consistent at a published watermark.SUBSCRIBE TO MATCH …is the same circuit fanned out over broadcast channels. Incremental analytics maintainers keep PageRank, connected components, and statistics warm under updates, each with a declared staleness contract. - Beacon: the index fabric. It holds property B-trees/hash, A+-style adjacency views, segment-based FTS/BM25, and a transactional HNSW vector index (the Strata pattern applied to the index itself, so vector search respects your snapshot, honors
AS OF, is branch-scoped, and is fresh in commit-latency, not reindex-hours). All indexes share one lifecycle and one optimizer registration surface. - Prism: the entire
franken_networkxcatalog (CALL fnx.pagerank,fnx.louvain_communities, …) exposed inside queries via an authorizedSnapshotGraphView: algorithms traverse borrowed neighbor cursors without whole-graph materialization (an honest, explicit copy boundary where a trait contract requires one), under full snapshot isolation, with CGSE witnesses folded into the query certificate. - Warden: capability tokens (macaroons) with graph caveats (
labels⊆{…},subgraph=MATCH-predicate,asof≤seq,ops⊆{…}) that compile to mandatory planner predicates. Row/subgraph security with index-aware pushdown, encrypt-then-code at rest, TLS 1.3 in flight, per-branch DEK derivation for cryptographic branch hand-off. - Fabric: the surface. Embedded API, the native FGP wire protocol (with optional factorized frames and RaptorQ FEC for lossy links), HTTP/2 + gRPC + WebSocket, a Bolt-compat subset for Neo4j drivers/tools, Python bindings, and format import/export for the whole legacy graph ecosystem plus a Parquet-lite reader/writer.
- Aegis: replication as Chronicle over the network. Raft sequences the ~100-byte marker stream while capsule bytes ride the fountain-coded plane; deterministic apply makes replicas bit-identical (divergence is detectable by
ObjectIdcomparison). New replicas seed via bonded multi-donor ATP pulls. Sharding is designed-in but sequenced last (see Limitations).
The full census lives in COMPREHENSIVE_PLAN_FOR_THE_DESIGN_OF_FRANKENGRAPHDB.md: every asset reused from each foundation, every SOTA system's adopt/adapt/reject verdict, and the normative on-disk formats.
How it compares
Honest framing. frankengraphdb is the only one of these that composes durability, unbounded time-travel, git-style branches, unified WCO/factorized execution, incremental everything, and deterministic verification in a single engine.
frankengraphdb |
Neo4j | Kùzu | Memgraph | TigerGraph | |
|---|---|---|---|---|---|
| Language / runtime | Pure Rust, no JVM/GC | JVM | C++ (embedded) | C++ | C++ (MPP) |
| Native language | GQL + openCypher | Cypher | Cypher | Cypher | GSQL (proprietary) |
| Storage model | Temperature-tiered CSR LSM | Pointer-chasing | Columnar CSR (static-leaning) | In-memory | MPP |
| Execution | FreeJoin + factorized + WCOJ | Vectorized (late-arriving) | Vectorized + factorized + WCOJ | Vectorized | MPP |
| Durability | RaptorQ commit stream, no double-write | WAL + store files | Single-writer WAL | Thin durability | Distributed |
| Time travel | Unbounded, queryable (AS OF/BETWEEN) |
✗ (external) | ✗ | ✗ | ✗ |
| Git-style branches | ✓ O(1), 10k+ concurrent | ✗ | ✗ | ✗ | ✗ |
| Incremental views / subscriptions | ✓ one Z-set engine | Partial (CDC) | ✗ | Triggers/streams | Partial |
| Transactional vector search | ✓ (snapshot + AS OF + branch) |
Plugin (eventual) | ✗ | Plugin | ✗ |
| In-DB analytics catalog | 550+ (fnx, cursor-borrowed) | GDS library | Limited | MAGE | Built-in |
| Deterministic, replayable results | ✓ plan certificates | ✗ | ✗ | ✗ | ✗ |
| Deterministic simulation testing | ✓ lab runtime + DPOR | ✗ | ✗ | ✗ | ✗ |
| Status of the project | Active, self-owned ecosystem asset | Commercial | Archived 2025 (acquired by Apple) | Commercial | Commercial |
Target state. The
frankengraphdbcolumn is the design target. Where today differs (re-checked 2026-11-11): branches exist only as read selectors:AT BRANCH namereads a pinned snapshot that the host maps the name to (Database::query_with_branch_resolver,crates/fgdb/src/query_branch.rs). There is no branch catalog, fork, merge or branch write (BranchManifestis deliberately absent fromfgdb-chronicle). In-DB analytics exposes 32 registeredfnx.*procedures (plusCALL hybrid.searchand threeCALL db.*catalog procedures) over decoded and sealed cursors today; the two DAG additions are source-reviewed on 2026-11-20 with runtime qualification pending. Bridging the broader 550+franken_networkxcatalog remains open. Vector search is snapshot-consistent and honoursAS OF. Searches can build an index for one call, read an explicitly refreshed resident index, or use an opened-database registration maintained after every successful commit (crates/fgdb/src/query_beacon/resident/maintained.rs, re-checked 2026-10-12). Registered searches require the current generation and refuse after failed maintenance; registrations are not a durable index catalog and have no branch scope. Replayable results cover the native read subset (Database::replayover native result certificates), not every statement. Deterministic simulation runs the lab runtime and DPOR over bounded, declared scenarios (crates/fgdb-sim: generated transaction schedules, crash-point differentials), not yet the whole database including server and replication.
The fgdb CLI
The CLI mirrors the embedded surface. Robot mode emits line-oriented, versioned NDJSON so an agent can pipe and validate the stream against a frozen contract (
fgdb robot schema); human output is the default.
Runs today — one binary (crates/fgdb-cli), invoked below as fgdb. Prefix any invocation with --robot for the NDJSON contract. Stable exit codes: 0 success, 2 usage/schema, 3 query refusal, 4 open/key, 5 I/O/corruption. A key file is three nonempty lines of 64 hex characters (object-id key, security namespace, encryption key), owner-only (chmod 600) on Unix:
# Create a database directory under an explicit key file
fgdbd keygen --database fgdb.keys
fgdb create --db mydb.fgdbdir --key-file fgdb.keys
# Run a GQL query (human output; --robot for versioned NDJSON)
fgdb query --db mydb.fgdbdir --key-file fgdb.keys "<gql>"
# Stream native rows one at a time, or save a portable result certificate
# (--certify-to refuses an existing file unless --overwrite is also given)
fgdb query --db mydb.fgdbdir --key-file fgdb.keys --stream "<gql>"
fgdb query --db mydb.fgdbdir --key-file fgdb.keys --certify-to result.cert "<gql>"
# Read checkpoint objects through a bounded graph cache and flush each result row
fgdb query --db mydb.fgdbdir --key-file fgdb.keys --property score=1 \
--buffered --buffer-memory-bytes 67108864 \
"MATCH (n) RETURN n AS node, n.score AS score LIMIT 100"
# Select an already-published durable relation run with explicit native limits
# This small profile also admits the relation's post-seal history under its caps.
fgdb query --db mydb.fgdbdir --key-file fgdb.keys \
--relation KNOWS=1 --property score=1 --buffered --max-work-units 1000000 \
--native-run-max-rows 64 --native-run-max-incidences 128 \
--native-run-image-bytes 65536 --native-run-property-bytes 4096 \
"MATCH (a)-[r:KNOWS]->(b) RETURN r, a, b, r.score AS score LIMIT 100"
# External ORDER BY/DISTINCT with private query scratch in an existing directory
fgdb query --db mydb.fgdbdir --key-file fgdb.keys --property score=1 \
--spill-dir /tmp --spill-memory-bytes 67108864 --spill-disk-bytes 1073741824 \
"MATCH (n) RETURN n AS node ORDER BY n.score DESC LIMIT 100"
# Numeric grouping with bounded resident groups and exact aggregate values
fgdb query --db mydb.fgdbdir --key-file fgdb.keys --property score=1 \
--spill-dir /tmp \
"MATCH (n) RETURN n.score AS score, count(*) AS count, avg(n.score) AS mean"
# Combine the bounded graph cache with external ordering or grouping
fgdb query --db mydb.fgdbdir --key-file fgdb.keys --property score=1 \
--buffered --buffer-memory-bytes 67108864 \
--spill-dir /tmp --spill-memory-bytes 67108864 \
"MATCH (n) RETURN n.score AS score ORDER BY score DESC LIMIT 100"
fgdb query --db mydb.fgdbdir --key-file fgdb.keys --property score=1 \
--buffered --spill-dir /tmp \
"MATCH (n) RETURN n.score AS score, count(*) AS count, sum(n.score) AS total
GROUP BY n.score ORDER BY total DESC"
# Aggregate an intermediate page through the same bounded source and scratch
fgdb query --db mydb.fgdbdir --key-file fgdb.keys --property score=1 \
--buffered --spill-dir /tmp \
"MATCH (n) WITH n.score AS score ORDER BY score DESC LIMIT 100
RETURN count(*) AS selected, sum(score) AS total"
# Expand graph-backed lists into external stages and numeric grouping
fgdb query --db mydb.fgdbdir --key-file fgdb.keys --property score=1 \
--buffered --spill-dir /tmp \
"MATCH (n) UNWIND [n.score, n.score + 1] AS score
RETURN score, count(*) AS occurrences ORDER BY score"
# Summarize supplied documents without scanning graph records
fgdb query --db mydb.fgdbdir --key-file fgdb.keys \
--buffered --spill-dir /tmp \
"UNWIND [{category:'a',amount:5},{category:'b',amount:7},{category:'a',amount:3}] AS row
RETURN row.category AS category, sum(row.amount) AS total ORDER BY total DESC"
# Subtract occurrences across complete inputs with bounded external set execution
fgdb query --db mydb.fgdbdir --key-file fgdb.keys \
--buffered --spill-dir /tmp \
"UNWIND [1,2,2,3] AS value RETURN value
EXCEPT ALL RETURN 2 AS value ORDER BY value"
# Commit a write, then compare two committed revisions of one query
fgdb write --db mydb.fgdbdir --key-file fgdb.keys "<gql>"
fgdb diff --db mydb.fgdbdir --key-file fgdb.keys --before <seq> --after <seq> "<gql>"
# Ordered multi-statement transaction (one commit; --rollback discards everything)
fgdb transaction --db mydb.fgdbdir --key-file fgdb.keys --write "<gql>" --query "<gql>"
# Return each write's staged values, then commit the whole transaction once
fgdb transaction --db mydb.fgdbdir --key-file fgdb.keys \
--label Person=1 --property name=1 --property visits=2 \
--write "MERGE (n:Person {name:'Ada'}) ON CREATE SET n.visits=0 RETURN n.visits" \
--write "MATCH (n:Person) WHERE n.name='Ada' SET n.visits=n.visits+1 RETURN n.visits"
# Search staged documents before the transaction commits
fgdb transaction --db mydb.fgdbdir --key-file fgdb.keys --label Doc=1 --property title=1 \
--write "CREATE (:Doc {title: 'graph memory'})" \
--query "CALL hybrid.search(text => 'graph memory', text_property => 'title',
label => 'Doc', k => 5) YIELD node, score
RETURN node.title, score ORDER BY score DESC"
# Bind a large JSON list as one parameter, without copying it onto argv
# rows.json contains [{"id": 1, "name": "Ada"}, ...]
fgdb write --db mydb.fgdbdir --key-file fgdb.keys \
--label Person=1 --property id=1 --property name=2 --param-file rows=rows.json \
'UNWIND $rows AS row CREATE (:Person {id: row.id, name: row.name})'
# Bulk CSV import, NDJSON delta load with checkpoints, compaction
fgdb import-csv --db mydb.fgdbdir --key-file fgdb.keys --input edges.csv "<gql>"
# Fixed typed arguments are shared by every row; CSV supplies the other names.
# people.csv has id,name; people.types declares int64<TAB>id and text<TAB>name.
# Fixed names cannot appear in the CSV header or the types file.
fgdb import-csv --db mydb.fgdbdir --key-file fgdb.keys \
--label Person=1 --property id=1 --property name=2 --property tenant=3 \
--input people.csv --types-file people.types --param tenant=text:research \
'MERGE (:Person {id:$id, name:$name, tenant:$tenant})'
# --param-file name=path also accepts a fixed JSON list or map, without argv copies.
fgdb load --db mydb.fgdbdir --key-file fgdb.keys --input batch.ndjson
# (--input also takes a JSON array of the same row objects; a leading '[' selects it)
# Vertex and edge props also accept typed JSON Lists, including nested Lists:
# {"kind":"vertex","key":"doc-1","labels":["Doc"],"props":{"embedding":"json:[0.1,0.2]"}}
# Keep the outer property value a typed string. Maps at any depth and unsigned
# integers remain refused; NULL inside a List is retained. Endpoint property
# lookups still require scalar values. Full input validation precedes any write.
fgdb load --db mydb.fgdbdir --key-file fgdb.keys --input embeddings.ndjson \
--label Doc=1 --property embedding=1 --checkpoint embeddings.checkpoint
# Resume with the same raw input and bindings; the saved chunk size is retained.
# Search these stored embeddings with --vector-encoding list-rounded.
fgdb compact --db mydb.fgdbdir --key-file fgdb.keys
# Publish a durable compressed run for relation 1, retaining its full history
fgdb seal --db mydb.fgdbdir --key-file fgdb.keys --seal-relation 1 --retain-from 0
# Later --sealed reads discover the authenticated attachment after restart.
# Inputs past the default 1,000,000 rows or 64 MiB of keys name their own bounds
fgdb load --db mydb.fgdbdir --key-file fgdb.keys --input big.ndjson \
--max-source-rows 80000000 --max-total-key-bytes 2000000000
# Write the name bindings once instead of repeating --label/--relation/--property
printf 'label Person=1\nrelation KNOWS=1\nproperty name=1\n' > social.bindings
fgdb query --db mydb.fgdbdir --key-file fgdb.keys --bindings-file social.bindings \
"MATCH (p:Person) RETURN p.name"
# Verify the marker chain and its logical delta capsules through commit 42.
# This read-only check also works beside a live writer. Keep the reported
# chain hash independently to check the same cut in a later copy.
fgdb verify-history --db mydb.fgdbdir --key-file fgdb.keys --through 42
fgdb verify-history --db backup.fgdbdir --key-file fgdb.keys --through 42 \
--expect-chain "$SAVED_CHAIN_HASH"
# Publish only if commit 42 is still the recorded head of the embedded branch.
fgdb write --db mydb.fgdbdir --key-file fgdb.keys --if-head "42@$SAVED_CHAIN_HASH" \
"CREATE (:Person {name: 'Ada'})"
# --if-head empty admits the first write to a database with no commits.
# Verify every capsule and block; repair damaged redundancy in place
fgdb scrub --db mydb.fgdbdir --key-file fgdb.keys
# Reconstruct damaged derived graph data from intact committed history, then verify
fgdb scrub --db mydb.fgdbdir --key-file fgdb.keys --rebuild-derived
# Root metadata and every retained capsule must authenticate; no commit is appended.
# In-database analytics over an explicit projection (registered Prism procedures)
fgdb query --db mydb.fgdbdir --key-file fgdb.keys --relation KNOWS=1 \
--graph-relation KNOWS --direction undirected "CALL fnx.connected_components() YIELD vertex, component"
# Weighted analytics over vertices with either label and either relationship type
fgdb query --db mydb.fgdbdir --key-file fgdb.keys \
--label Person=1 --label Company=2 --relation KNOWS=1 --relation WORKS_WITH=2 \
--property name=1 --property weight=2 \
"CALL fnx.pagerank({labels:['Person','Company'],
relations:['KNOWS','WORKS_WITH'], weight:'weight',
missing:'reject', direction:'directed', parallel:'sum', self_loops:'drop'},
0.85, 100, 1e-9, true) YIELD node, score
RETURN node.name, score ORDER BY score DESC LIMIT 10"
# Beacon retrieval: BM25 text, exact/ANN vector, or exact-RRF hybrid over one sequence
fgdb search --db mydb.fgdbdir --key-file fgdb.keys --property title=1 --property x=2 \
--text "graph memory" --text-property title --vector 0.5 --vector-property x --k 5
# Reuse a durable text/vector index across processes and catch up committed changes
fgdb search --db mydb.fgdbdir --key-file fgdb.keys --property title=1 --property x=2 \
--text "graph memory" --text-property title --vector 0.5 --vector-property x \
--index-checkpoint documents --k 5
# Explicitly takes the writer lease, but does not append a graph commit.
# Missing, corrupt or incompatible caches rebuild; current healthy caches are
# reused without rewriting. Add --expand-from <vid> --max-hops <n> to fuse
# current graph neighbors with these cached lanes at the same commit sequence.
# Restrict result endpoints before candidate limits (use IDs from your database)
fgdb search --db mydb.fgdbdir --key-file fgdb.keys --property title=1 --property x=2 \
--text "graph memory" --text-property title --vector 0.5 --vector-property x \
--eligible 101,205 --candidates 5 --k 2
# ...or the same retrieval inside GQL, composed with the rest of the statement
fgdb query --db mydb.fgdbdir --key-file fgdb.keys --property title=1 --property x=2 \
"CALL hybrid.search(text => 'graph memory', text_property => 'title', vector => [0.5],
vector_properties => ['x'], k => 5) YIELD node, score
RETURN node.title, score ORDER BY score DESC"
# Real embeddings live in ONE property as packed little-endian f32 bytes
# (`--param e=vector:0.1,0.2,...`, or {"$vector": [...]} over HTTP)
fgdb write --db mydb.fgdbdir --key-file fgdb.keys --label Doc=1 --property title=1 --property emb=3 \
--param 'e=vector:0.12,0.80,0.05' "CREATE (:Doc {title: 'Ada', emb: \$e})"
fgdb query --db mydb.fgdbdir --key-file fgdb.keys --property title=1 --property emb=3 \
--param 'q=json:[0.1,0.8,0.1]' \
"CALL hybrid.search(vector => \$q, vector_property => 'emb', metric => 'cosine', k => 5)
YIELD node, score RETURN node.title, score ORDER BY score DESC"
# ...or the same packed property through the search command
fgdb search --db mydb.fgdbdir --key-file fgdb.keys --property emb=3 \
--vector 0.1,0.8,0.1 --vector-encoding packed --vector-property emb --metric cosine --k 5
# (per-coordinate properties: stored integer, float and decimal coordinates round once
# to the nearest f32 by default (coordinates-rounded); --vector-encoding coordinates,
# or vector_encoding => 'coordinates' in hybrid.search, opts into exact mode, which
# refuses any decimal and any value f32 cannot hold exactly)
# Graph-only neighborhood: seeds and an explicit hop bound are a complete request
# (docs/cli_graph_only_search.md); immutable graph-only hybrid.search calls
# default to demand access: only probed histories, with no directory/index build.
# Explicit graph_access => 'indexed' retains complete-directory admission.
fgdb search --db mydb.fgdbdir --key-file fgdb.keys --expand-from 101,205 --max-hops 2 --k 20
# (hybrid.search preserves deterministic fused-score rank, with vertex-ID ties;
# an explicit ORDER BY overrides that order)
# Replay a saved certificate against the current database state
fgdb replay --db mydb.fgdbdir --key-file fgdb.keys --certificate result.cert
# Agent-first surface: the self-describing, frozen event contract
fgdb robot schema
# Serve over the network (FGP over TCP) and query remotely with a capability token
fgdbd keygen --issuer issuer.key
fgdbd serve --listen 127.0.0.1:7687 --database social=mydb.fgdbdir --key-file fgdb.keys \
--issuer-key-file issuer.key --label Person=1 --relation KNOWS=1 --property name=1
# per-database query limits default to the CLI's (100,000 records): raise them for
# larger graphs with --max-snapshot-records/--max-result-rows/--max-work-units/
# --max-scratch-entries; --bindings-file adds to the --label/... flags (no name or
# ID may repeat)
fgdbd token --key-file fgdb.keys --issuer-key-file issuer.key --rights read-write > token && chmod 600 token
fgdb remote --addr 127.0.0.1:7687 --token-file token --database social query "MATCH (p:Person) RETURN p.name"
# One prepared read, many argument sets: a JSON array of typed objects, or CSV with --csv-types
fgdb remote --addr 127.0.0.1:7687 --token-file token --database social \
--rows-file names.json query 'MATCH (p:Person {name: $name}) RETURN p.name'
# Write a CSV batch in one commit. names.csv has a name header and one name per row.
fgdb remote --addr 127.0.0.1:7687 --token-file token --database social \
--rows-file names.csv --csv-types name=text write 'CREATE (:Person {name: $name})'
# Different reads in one pinned session, each with its own parameters and columns
fgdb --robot remote --addr 127.0.0.1:7687 --token-file token --database social \
--statements-file reads.json query-batch
# Live changefeed: a baseline, then one exact delta per commit
fgdb remote --addr 127.0.0.1:7687 --token-file token --database social \
subscribe "MATCH (a:Person)-[:KNOWS]->(b:Person) RETURN a.name, b.name"
# ...or over HTTP/JSON (add --http-listen 127.0.0.1:7474 to serve)
curl -H "Authorization: Bearer $(cat token)" -d '{"statement":"MATCH (p:Person) RETURN p.name"}' \
http://127.0.0.1:7474/v1/databases/social/query
# ...or from an official Neo4j driver: reads and bounded autocommit writes with RETURN
# (add --bolt-listen 127.0.0.1:7688)
python3 -c 'from neo4j import GraphDatabase, bearer_auth
d = GraphDatabase.driver("bolt://127.0.0.1:7688", auth=bearer_auth(open("token").read().strip()))
print(d.execute_query("MATCH (p:Person) RETURN p LIMIT 3").records)'
Consistent multi-query reads. remote query-batch --statements-file reads.json accepts a JSON array of 1–32 objects. Each has a nonempty statement string and an optional parameters object using the same typed strings as --param:
[
{"statement":"MATCH (p:Person) RETURN count(*) AS people"},
{"statement":"MATCH (p:Person {name:$name}) RETURN p.name","parameters":{"name":"text:Ada"}}
]
Ordinary reads share one pinned native session and one cumulative signed allowance. Explicit historical selectors retain their own cuts. Every statement executes and passes wire admission before the server sends successful output; write text refuses. The CLI flushes each result's columns and rows with a one-based statement index and puts the exact selected sequence on each columns record. Only the single terminal result with kind=read_batch completes the batch. A later delivery failure leaves the entire prefix provisional and cancels and drains the active request. There is no retry as separate queries on older servers or after a refusal.
The complete regular UTF-8 file is decoded before credentials or connection. Raw input is limited to 1 MiB, each JSON string to 64 KiB, and the encoded request to the client frame limit. Nested parameters retain the existing depth and value limits. This command accepts the ordinary address, database, token and TLS options; it takes no positional statement, --param, argument-file, read-mode or --consistent-batch options. Execution is buffered on the server, with incremental delivery to the CLI.
Durable names without hand-assigned IDs. The local owner can now register labels,
relationship types and property keys with name-only declarations, then use those
names in later processes. This is the automatic-allocation slice of
fgdb-7r8sy; executable qualification is pending as recorded in
IMPLEMENTATION_STATUS.md.
# Use the owner-only fgdb.keys file described above.
fgdb create --db mydb.fgdbdir --key-file fgdb.keys --persist-bindings \
--label Person --relation KNOWS --property name
fgdb write --db mydb.fgdbdir --key-file fgdb.keys \
"CREATE (:Person {name: 'Ada'})"
# Inspect the durable catalog without loading graph payloads.
fgdb schema --db mydb.fgdbdir --key-file fgdb.keys
# Extend the existing catalog atomically at the expected revision.
# Name-only declarations and explicit IDs can share one registration.
fgdb schema --db mydb.fgdbdir --key-file fgdb.keys --if-current 2 \
--property score --label Team=100
# Fence registration against the exact branch marker obtained from verify-history.
fgdb schema --db mydb.fgdbdir --key-file fgdb.keys --if-head "3@$SAVED_CHAIN_HASH" \
--property rank
# Inspect exactly the names visible at an earlier committed revision.
fgdb schema --db mydb.fgdbdir --key-file fgdb.keys --as-of 1
schema returns kind, name and id columns in canonical namespace/name
order. Robot output reuses the existing columns/row/result contract; its terminal
seq names the selected or committed revision. IDs are decimal strings with
type int through i64::MAX and wideint above that range, preserving all
64 bits. With no declarations, the command reads metadata only. Historical
inspection cannot combine with registration flags or --if-current.
Every registration combines all explicit and automatic declarations into one
existing schema transaction. Exact redeclarations retain their IDs and do not
append a commit. A conflicting name/ID, exhausted namespace, or stale frontier
refuses the entire request. --bindings-file can supply additional explicit
bindings. Name-only creation requires --persist-bindings; numeric declarations
on ordinary query/write commands remain local to that invocation.
New automatic IDs are allocated above every numeric symbol used in authenticated
retained history, including symbols removed from the current graph and numeric
writes made after an earlier registration. New allocation therefore traverses
retained history and refuses if origin history is unavailable or retired.
Existing-name no-ops do not need that traversal. The embedded equivalent is
Database::register_symbol_names(cx, explicit_bindings, names); read
Database::symbol_catalog() after success to obtain the committed IDs.
This is a privileged local/embedded administration surface. General schema DDL,
constraints, automatic interning inside arbitrary graph writes, and remote
schema mutation remain separate work.
Composable catalog discovery. CALL db.labels(), CALL db.relationshipTypes() and CALL db.propertyKeys() enumerate the host's declared symbol bindings in name order, including declarations not yet used by graph data. Their default columns are label, relationshipType and propertyKey. Bare calls, YIELD *, aliases, filters, joins, aggregation and parameterized prepared reads use the native query pipeline in the embedded API, CLI, FGP, HTTP and Bolt:
CALL db.labels() YIELD label
WITH label WHERE label STARTS WITH 'P'
RETURN collect(label) AS labels
CALL db.propertyKeys() YIELD propertyKey AS key
RETURN key ORDER BY key LIMIT 10
Embedded hosts must supply a complete GraphSymbolResolver::reverse_catalog(); a forward-only resolver is refused rather than guessed to be an empty catalog. CLI bindings and the server symbol catalog provide this enumeration. Preparation freezes the names and typed identities into the plan, and authorized execution filters them through the current capability before exposing rows or charging visible work. Catalog enumeration consumes no graph snapshot-record budget; ordinary work, scratch, result and cancellation limits still apply. Bare Bolt schema calls retain their existing no-bookmark response.
Filtered hybrid retrieval. Native CALL hybrid.search(..., eligible => [101,205]) accepts vertex identities or nonnegative integer IDs, including a list supplied through a query parameter. The standalone search --eligible <vid,...> option accepts full-width unsigned vertex IDs, with at most 100,000 input occurrences before duplicate removal. Eligibility applies before each text, vector and graph candidate limit and before fusion. It preserves the selected corpus, BM25 statistics, ANN routing and graph transit: a path may reach an eligible result through excluded vertices. Omission is unrestricted; native NULL is also unrestricted, while native [] and CLI --eligible '' select no results. Empty eligibility still validates the request and observes its source and work limits.
The same native argument works inside transaction --query, where staged properties and topology are visible and search observations remain conflict dependencies across savepoint rollback. Immutable and --as-of searches retain their pinned sequence. Standalone graph search uses indexed expansion from the supplied seeds, so adding an endpoint restriction does not require scanning disconnected edges. These are candidate-limited exact-RRF results; filtering does not turn ANN or candidate fusion into exhaustive search.
Boolean hybrid retrieval (qualification pending). Native CALL hybrid.search accepts text_required, text_optional, text_excluded and text_minimum_optional with text_property. Every distinct required term must match, the optional minimum must be met, and excluded terms remove text-lane support. Without required terms, at least one optional term must match; empty and purely negative clauses produce no text candidates. Clauses use the existing bounded exact-token analyzer and share its byte, term and work limits. They are alternatives to text, text_match and fuzzy expansion.
CALL hybrid.search(
text_required => 'graph', text_optional => 'storage database',
text_excluded => 'deprecated', text_minimum_optional => 1,
text_property => 'body', candidates => 20, k => 10
) YIELD node, score, text_rank
MATCH (node:Doc)
RETURN node, node.title, score, text_rank
ORDER BY score DESC, node
Boolean text can participate in the same vector and graph fusion as ordinary text, using the existing vector, seeds and expansion arguments. Exclusion applies to the text lane: a vertex may still receive vector or graph support. eligible restricts every result lane before candidate truncation. The standalone search command accepts the equivalent --text-required, --text-optional, --text-excluded and --text-minimum-optional flags alongside vector or graph flags. Single-lane CLI text keeps its BM25 score; native calls and fused CLI searches keep exact-RRF Decimal scores and separate per-lane evidence. Native parameters, staged transaction reads and capability masking use the ordinary shared procedure path.
Commit-maintained embedded search. Database::register_beacon_index freezes a current text/vector definition; register_beacon_graph_index also retains its native graph source. Both take an initial build policy through ReadOptions and a separate ReadPolicy for each committed maintenance tick. Successful ordinary writes and transaction completion advance the registration from the canonical committed delta without an application refresh call. Changed identities are projected at the new sequence; edge-only and no-effect commits advance the graph/source pin without rebuilding unchanged search segments. search_beacon_index and search_beacon_graph_index require a healthy current registration. beacon_index_snapshot returns an explicit immutable historical pin, which remains unchanged by later commits, compaction, rebuild, removal or database drop.
A maintenance projection error, resource refusal or interrupted context fences that registration and preserves its first failure in beacon_index_status; the durable graph commit still succeeds and other registrations maintain independently. rebuild_beacon_index explicitly replaces the frozen definition's generation at the current sequence and can change its build/maintenance budgets. unregister_beacon_index releases its resident state and invalidates every copy of the handle. An opened database holds at most 64 live registrations, reusing removed slots without aliasing old handles; each index keeps its own document, text, vector and segment limits. This privileged embedded API provides no disk spill or durable registration catalog. Reopening starts with no registrations, and handles cannot transfer between opened databases.
Native CALL hybrid.search can reuse the text and exact-vector lanes of a compatible healthy registration on the same opened database. Capability-scoped calls require the current sequence and complete corpus visibility; graph-enabled calls still admit their selected vertices and incidence work. Masked, older historical, approximate and transaction requests retain their existing source path.
Server-configured search checkpoints. fgdbd serve --beacon-index declares indexes for one served database; Rust hosts supply the equivalent DatabaseConfig::beacon_indexes. The server recreates those configured registrations at startup and authoritative recovery, authenticates each saved checkpoint against Chronicle, and replays its retained delta suffix before admitting readers. Missing, corrupt or incompatible checkpoints and unavailable delta history trigger an authoritative rebuild, which must still satisfy the configured build limits. Startup and recovery save rebuilt, advanced or repaired checkpoints; an intact current checkpoint is reused without rewriting. Definitions remain process configuration: supply them again on restart. Opening the embedded database alone does not restore registrations automatically.
For an existing database and key files, this configures a text index and periodic saves:
fgdbd serve --listen 127.0.0.1:7687 --database social=mydb.fgdbdir \
--key-file fgdb.keys --issuer-key-file issuer.key \
--label Person=1 --property name=1 \
--beacon-index people_names --beacon-text name --beacon-label Person \
--beacon-checkpoint-interval-seconds 300
Periodic checkpointing is disabled by default. --beacon-checkpoint-interval-seconds takes a positive interval per database; the first save waits that interval, and each later interval begins when the preceding attempt completes, including a failed attempt. Graceful shutdown also attempts to save healthy configured indexes after active operations drain. Both paths skip a healthy index already checkpointed at its current sequence when its last save has no error. Checkpointing creates no graph commit and runs outside ordinary graph writes; those writes continue maintaining the resident indexes.
Trusted Rust hosts can explicitly save with Server::checkpoint_beacon_indexes, for example server.checkpoint_beacon_indexes(cx, "social").await; this forces a fresh save even at an already checkpointed sequence, and each configured index returns its own success or error. A failed save leaves the graph and healthy resident indexes available, and other indexes still receive their save attempt. server.database_beacon_status(cx, "social").await reports the restore/rebuild outcome, last checkpoint sequence and last save error; a later successful save clears that error. These diagnostics remain available after a healthy graceful shutdown. The server logs periodic save outcomes; this host API is not a client administration endpoint.
Query-local Prism projections. A composed CALL fnx.* can take a literal projection map as its first positional argument, followed by the ordinary algorithm arguments. labels and relations each accept [] (all admitted elements) or one literal schema name. Both endpoints of an edge must belong to the selected vertex set; selected isolated vertices remain in the graph. weight names an edge property; missing is reject, unit, or zero and requires weight. direction is directed, reversed, or undirected; parallel is reject, collapse, min, max, or sum; self_loops is keep, drop, or reject. collapse uses unit weights without inspecting weight values, and dropped loops or excluded edges do not require valid weights. Weighted algorithms retain their ordinary weighted/unweighted argument, as the final true in the PageRank example shows.
The map's schema names resolve when the statement is prepared; algorithm parameters can be rebound for each execution. Omitted options retain the procedure's direction, unit weights, rejected parallel edges and retained self-loops. The same projection applies to ordinary reads, capability-scoped reads, pinned historical reads and effective transaction overlays. It narrows the graph available to the query and grants no additional authority. Composed calls use ordinary query parameters and can participate in certified read/replay; transaction results remain uncommitted data. Projection flags still belong to standalone CLI analytics. Named graph catalogs (GRAPH social), dynamic projection maps and multi-name selector lists remain outside this slice.
CALL fnx.label_propagation_communities() YIELD node, component finds communities with the pinned foundation's deterministic semi-synchronous label propagation. It requires an undirected, simple, loop-free projection; explicitly drop self-loops or reduce parallel edges in the projection when needed. Vertices are greedily colored in canonical identity order, and each color class updates in order. A vertex keeps its current label when that label ties for the largest vote; other ties choose the smallest label. The result assigns each vertex the minimum full-width vertex identity in its final community. The algorithm stops on convergence or returns the last partition after 100 rounds. It has no random seed or tunable resolution.
The same procedure runs on decoded adjacency and authenticated compressed cursors, including cooperative execution. Its five vertex-sized integer vectors, result rows and traversal work are admitted under the existing Prism limits. Compressed execution does not reconstruct a decoded adjacency copy. Source storage, compressed images, kernel vectors and result storage retain their separate bounds; this is not an overall RSS guarantee. In composed GQL, the procedure supports capability masking, transaction-local edges, retained historical reads and certified replay through the ordinary hosts.
Louvain communities. CALL fnx.louvain_communities() YIELD node, component performs full multilevel modularity optimization, including weighted graph coarsening. It is procedure ordinal 29 in registry epoch 32. Its four positional or named arguments are resolution (positive, default 1.0), threshold (nonnegative, default 1e-7), max_levels (positive or NULL, default NULL) and weighted (default true). The named-only max_iter sets a positive total optimization-sweep allowance, defaulting to 100. A query can select an edge-weight property through the ordinary projection:
CALL fnx.louvain_communities(
weight => 'weight', resolution => 1.0, threshold => 1e-7,
max_levels => NULL, weighted => true, max_iter => 100
) YIELD node, component
RETURN node, component ORDER BY node
The projection is undirected and simple after any requested parallel-edge reduction. Weighted execution requires finite nonnegative weights; without a selected weight property, edges have unit weight. Retained self-loops contribute twice to degree. Canonical vertex and stable edge encounter order make the result deterministic without RNG; each component is named by its minimum full-width vertex identity, with isolated vertices retained. max_levels deliberately returns the partition after that many completed levels. Exhausting max_iter returns a refusal rather than an unfinished partition. The host independently admits the requested sweep allowance against its iteration and work limits.
Decoded, compressed and cooperative execution share one cancellable kernel. Compressed input is consumed once into an explicitly admitted O(V+E) working graph for coarsening; this procedure has no external-memory analytics claim. Native calls retain capability masking, transaction overlays, historical reads and certified replay. Standing-query maintenance is not included. Runtime-qualified on 2026-11-11 via authorized_prism.rs and buffered_sealed_prism.rs; full workspace gate status is tracked in implementation status.
Directed dependency analysis. Two more registered procedures expose DAG validation and dependency ordering through the same projection and query hosts:
CALL fnx.topological_sort() YIELD node, rank
RETURN node, rank
CALL fnx.is_directed_acyclic_graph() YIELD acyclic
RETURN acyclic
Topological rows retain deterministic dependency order through ordinary ALL
projections, pagination and collection, with exact zero-based ranks. The order
matches the pinned FNX depth-first reverse-postorder convention. ORDER BY,
DISTINCT and set operators retain their own ordering contracts. A directed
cycle refuses the whole sort, including beneath LIMIT 0. The predicate returns one Boolean row,
including true for an empty graph. Both accept directed or reversed
projections and reject undirected ones; retained self-loops are cycles.
Capability-hidden edges do not participate. Decoded, compressed and cooperative
execution share an iterative traversal with admitted vertex state and no copied
adjacency. Standing-query maintenance is not included. Compiler/runtime and
full exact-tree qualification are tracked in implementation status.
Computed ordering of write results. A terminal write RETURN accepts expressions over returned aliases, projected source spellings such as n.p, and returned graph identities. For example, MATCH (n:Person) SET n.score=n.score+1 RETURN n.score AS score ORDER BY -score LIMIT 10 ranks the post-write scores while updating every matched vertex. CREATE, matched mutations, vertex MERGE and relationship MERGE share this result path, including grouped outputs. Private sort keys are removed from the result schema; DISTINCT still identifies only the returned values, and only the final selected rows consume the result-row allowance. A sort-expression failure, cancellation or resource refusal rolls back the statement even beneath LIMIT 0. Unreturned bindings remain unavailable to these write sort expressions. Write WITH heads also accept computed ordering through the native row pipeline, after establishing their complete projected or grouped rows and carried identities' frozen post-write fields. Their selected page feeds the following clause, including another write, while every earlier effect remains applied. Without its own ORDER BY, the final RETURN emits rows in canonical order.
Relationship maps after MERGE. Relationship MERGE results support r{.*}, selective maps such as r{.score}, and explicit overrides such as r{.*,score:r.score+1}. Plain relationship merges also project endpoint maps and graph identities carried through WITH. Complete maps use the selected relationship's final transaction state after ON CREATE, ON MATCH and trailing SET; repeated input occurrences remain repeated results, including in grouped output. Projection overrides affect the returned map. They do not write properties. NULL optional bindings yield NULL maps, and catalog or expression failures roll back the statement even under LIMIT 0. Authorized execution masks fields before naming or inspecting their payloads. Runtime-qualified on 2026-11-11 via computed_edge_merge_text.rs; see implementation status.
Complete-map reads now retain their typed identity through relationship MERGE
tails, including WITH, grouped results and computed ordering. A literal
property named * remains a distinct property lookup; it cannot replace or
alias the complete map. Added regressions cover both read orders, hidden fields,
missing-property NULLs and rollback after a late result error. Qualification of
this correction is recorded separately in implementation status.
SealedReadView::execute_prepared accepts all seven native read classes at the owner's selected sequence. Pattern and property reads retain the resident snapshot; composed FnX calls use its authenticated compressed relation. Temporal selectors must match that sequence, even for an empty result. For composed fgdb query --sealed calls, a bound FOR SYSTEM_TIME AS OF SEQ also selects the source before storage opens; a conflicting --as-of is refused. This owner API does not provide an external-memory query engine or capability-scoped session.
Durable compressed relation runs. Database::seal_relation materializes a selected relation as a registered, content-addressed AdjRunSegment (FGRN v1). The run preserves parallel edges, historical content versions and aligned edge properties. Its immutable OriginBirthOrder comes from each edge's original authenticated creation effect; a later property update cannot replace that origin with its content-version start. Publication attaches the run to a V7 partition root and advances the existing atomic root slot without creating a graph commit or changing the semantic sequence.
open_sealed_read and open_prism_sealed_projection discover these attachments after a process restart, verify their keyed identities, exact source lineage, dictionaries, stable-ID digest and column bounds, and reopen the compressed source without reconstructing it. Native composed queries and authorized sessions retain the same historical and capability filtering. Successor roots may carry run attachments with their original verified horizon; consumers cannot use the base alone beyond that horizon. A cut below the run's retained floor uses the retained Tier-D history; corruption of a selected attached run is an error.
The CLI exposes this maintenance operation as fgdb seal --seal-relation <u64> [--retain-from <u64>] with the usual database and key-file arguments. The floor defaults to zero. Its four --sealed-* image limits and six --seal-source-* source limits can each be set explicitly, including zero. A successful robot response reports kind=sealed, the unchanged sequence, relation, retained floor and run identity after root-slot publication. scrub retains the authenticated run inventory before checking storage, so a damaged parent root cannot hide an attached run's damaged bytes.
While fgdbd holds the writer lease, an administrator can publish the same durable relation run with POST /v1/databases/<name>/seal. Send an unrestricted Admin bearer credential and a JSON body such as {"relation":1,"retain_from":0}. Both fields are unsigned 64-bit integers. Omitting retain_from starts the run at sequence zero. The server uses the engine's default size limits and returns the run identity, retained floor and current graph sequence. Readers can keep their pinned snapshots throughout the operation.
This first durable profile covers one forward relation in one admitted lineage. It retains the complete Tier-D source and still authenticates its history for native pattern/property reads and Prism's vertex directory. Standalone Prism admission discards decoded adjacency as it goes. Source bytes, source records, compressed bytes and properties have separate explicit limits; this is not a page-mapped or overall-RSS bound. Cross-branch attachment, automatic migration, page-level Merkle reads and retention-authorized physical reclamation remain open.
Native queries over durable runs. Local query --buffered can opt into the durable-run source by supplying all four of --native-run-max-rows, --native-run-max-incidences, --native-run-image-bytes and --native-run-property-bytes. There are no implicit native-run limits; each is a decimal platform-size integer, including zero, accepted once. Partial profiles and profiles without --buffered refuse before opening storage. The profile also reaches supported native sources beneath --spill-dir; it does not expand either executor's supported query shapes. Analytics CALL fnx and --sealed keep their separate profiles and reject these flags.
Typed edge roots, join children and correlated probes may select an attached
floor-zero run in plain or ECS-coded storage. The source combines the unchanged run
with its authenticated post-seal statements, preserving historical identities,
exact properties, retirements and canonical EId order.
--native-run-max-incidences also caps base versions plus raw suffix statements
before suffix payload reads. Decoder, suffix and locator allocations remain
inside the existing --buffer-memory-bytes pool and share the query's work
allowance; the CLI never increases either allowance to fit the profile.
Loading is lazy, so a direct streaming LIMIT 0 does not decode a run. External
spilling retains its complete-input semantics, including before a final empty
page. Once selected, a damaged run or required suffix fails the query. Missing
or pruned runs and unsupported source shapes keep ordinary buffered reads.
Complete initial Tier-D admission, whole-run decoding and retained suffix
memory remain; this is not a page-selective or overall-RSS bound. The Rust API
exposes the same choice through BufferedReadView::set_native_run_limits, with
allocation-free configuration validation available as
BufferedReadLimits::validate_native_run_limits before opening a view.
ECS reads reserve frame scratch and, when repair is needed, decoder workspace from that same pool before allocating it. Repair bounds use the authenticated extent's coding geometry, including padding, rather than the current writer's configuration. Loose objects stream frame by frame and verify the complete Merkle commitment; packed members read the required authenticated frame ranges. An insufficient repair allowance returns a typed memory refusal. Bounded readers try their indexed packs and loose repair copies; discovering a newly published repair pack requires reopening the view. Initial source admission still has its existing costs, and the synchronous erasure decoder does not promise bounded CPU cancellation latency. Runtime and exact-tree qualification are recorded in implementation status.
Commit-pack publication also reuses members already stored in other packs after fresh identity/plaintext checks, inode sync and durable readback. It groups those proofs by physical pack and waits for the namespace barriers before issuing receipts. Regrouped rebuild batches therefore need to write only their new members. Existing canonical-file damage still refuses ordinary publication; explicit derived-data repair retains its separate authority.
Historical native reads can continue directly from FOR SYSTEM_TIME AS OF SEQ into UNWIND: MATCH path=(a:Person)-[:KNOWS]->(b:Person) FOR SYSTEM_TIME AS OF SEQ $at UNWIND nodes(path) AS person RETURN person.name AS name ORDER BY name. Expanded vertices, relationships and their properties, including reads inside subsequent correlated CALL bodies, use the same selected sequence. List parameters can be rebound between executions; duplicates remain duplicates, while empty and null lists produce no rows. An empty expansion or LIMIT 0 still validates the requested snapshot. Authorized execution applies current credentials and result limits to the historical graph.
--param-file name=path reads one UTF-8 JSON array or object as a list or map parameter, equivalent to --param name=json:<contents>. This supports large UNWIND $rows batches without the operating system's argument-size limit. Local query, write, diff, replay, transaction query/write steps, and remote single-statement query/write/subscribe/diff operations accept it. Files must be regular files; all parameter files together are limited to 4 MiB of raw input per invocation, including actual bytes read if a file grows. The existing JSON nesting, token, value-count and canonical parameter limits still apply. A transaction also retains its 1 MiB input limit over the loaded contents. Each transaction step has its own parameter names, while inline and file parameters cannot duplicate a name within one step. Files are read before database access, and remote files are decoded before credentials or connection. Remote --rows-file and --prepared-jsonl supply complete argument sets and cannot be combined with --param-file.
query --stream pins the selected generation and pulls eligible property-index candidates in canonical identity order. Equality traversal retains at most two AVL cursor spines and charges their complete tree heights against --max-scratch-entries before admitting a candidate. Projections can require additional scratch. LIMIT 0 leaves those posting cursors unopened.
query --buffered streams vertex and edge scans, fixed-hop joins and correlated EXISTS/NOT EXISTS directly from the authenticated checkpoint. For example, MATCH (a) WHERE NOT EXISTS { MATCH (a)-[:KNOWS]->(b) } RETURN a streams vertices with no outgoing KNOWS edge. Direct streams require a supported identity-leading projection and canonical order. They support local predicates, SKIP/LIMIT, parameters and historical cuts. The CLI checks the physical plan before streaming and retains each row’s graph-memory reservation through its output flush. Only the terminal result confirms complete delivery. Use --spill-dir for supported aggregation and alternate ordering.
Local buffered reads also stream computed vertex, single-edge and fixed-hop
join projections when the native input and final output have proved ascending identity order.
For example, MATCH (n) RETURN n AS id,n.age+1 AS next_age ORDER BY id and
MATCH (n) RETURN {node:n,next_age:n.age+1} AS doc ORDER BY n need no spill
directory. A directed edge can use
MATCH (a)-[r:KNOWS]->(b) RETURN r AS id,a.age+1 AS start_age,r.age+1 AS weight ORDER BY id;
an undirected edge also needs its source vertex in the identity prefix.
Fixed-hop joins require every traversed edge identity in order, for example
MATCH (a)-[r:KNOWS]->(b)-[s:KNOWS]->(c) RETURN r AS first,s AS second,r.age+s.age AS cost ORDER BY first,second.
Every property read must target the current vertex, a bound edge or its
endpoints. The complete property demand is checked before graph open, and the VM's memory reservation
stays with each row through output flush. Historical selectors, parameters and
final pages retain their ordinary meanings; every matching expression is
evaluated before successful completion, including the suffix after LIMIT
and a LIMIT 0 query. Embedded callers use
BufferedReadView::stream_graph_projection_governed[_at]. Both undirected
orientations share the admitted record and retain their computed payload
charges through delivery. Joined outputs retain independent reservations
after the cursor backtracks or closes. Other computed
source shapes and unproved ordering retain their existing refusals.
With implicit ordering, put the traversed edge identities first for a directed fixed-hop join, in traversal order. For example, MATCH (a)-[r:KNOWS]->(b)-[s:KNOWS]->(c) RETURN r,s,a.team,b.team,c.team streams each two-hop occurrence. For an undirected root, put its source vertex immediately after the first edge identity and before the remaining edge identities.
query --buffered --spill-dir <existing-directory> connects the bounded graph reader to external query execution. It accepts direct local field, identity and path projections without a leading identity, property and hidden-key ordering, output DISTINCT, and pagination. Native computed RETURN and WITH projections also support arithmetic, scalar functions, lists, maps, comprehensions and reductions, with computed filters between stages. UNWIND expands graph-backed or supplied lists one row at a time into the same external stages, preserving the child sequence and each list's element order; null and empty lists produce no rows. Literal-only and parameter-only queries begin with the native singleton input and open no graph cursor. They report Values source metadata and zero snapshot records, while retaining the selected checkpoint's sequence. Each stage preserves its own canonical ordering, DISTINCT, ORDER BY, and SKIP/LIMIT: selecting an inner page precedes the next projection, and a later LIMIT 0 cannot hide an earlier expression failure.
Cold path input accepts ANY SHORTEST without an upper hop bound, including MATCH path=shortestPath((a)-[:KNOWS*]->(b)) RETURN path. The breadth-first executor settles endpoints to finish on a finite graph, without imposing a synthetic hop cap; actual edge identities and canonical tie-breaking remain intact. ALL SHORTEST and allShortestPaths also return every tied shortest route, with or without an upper hop bound: MATCH path=allShortestPaths((a)-[:KNOWS*0..]->(b)) RETURN path. Parallel edges remain distinct paths. The executor shares reachable layers and lazily enumerates their routes before the ordinary external ordering, DISTINCT and pagination; it does not retain a separate frontier entry for every tied path. Graph-memory, work, scratch and complete-input row limits still apply, including beneath LIMIT 0. Unbounded repeatable WALK and shortest profiles whose positive-minimum edge-uniqueness constraint the native compiler cannot prove redundant remain outside this profile.
Open-ended TRAIL, ACYCLIC, SIMPLE, and ordinary matches under DIFFERENT EDGES also run through the cold path source: MATCH path=(a)-[:KNOWS*]->(b) RETURN path. Their repetition rules terminate on a finite graph, preserving parallel-edge identities and every eligible route. The active route grows under graph-memory admission without a synthetic hop cap. A SIMPLE return to its start is terminal; a trail may continue through unused edges after closing a cycle. Complete input still precedes external ordering, DISTINCT and pagination.
Numeric grouping uses the same external partitioner and native reducer described below. Graph-backed grouping supports computed inputs, COUNT/SUM/AVG(DISTINCT ...), scalar/list/map outputs, HAVING, exact aggregate values, and post-aggregate RETURN DISTINCT, over vertex, single-edge or fixed-hop join sources at the current or a historical cut. Source-free text queries support returned grouping keys and numeric summaries, distinct aggregate arguments, HAVING, RETURN DISTINCT, and ordering by returned aliases. Both kinds of input accept complete unary WITH and UNWIND pipelines: their projections, filters, expansions, distinctness and pages finish in scratch before the resulting rows enter reduction.
Grouping can also appear between relational stages: UNWIND [1,2,2,3] AS x WITH x,count(*) AS n WHERE n > 1 RETURN x,n. An intermediate WITH group can feed projections, filters, UNWIND, another grouping, or either operand of a set operation. Its entire child finishes before partitioning; every group then finishes in canonical key order and converts to ordinary row values before any downstream clause runs. Counts and integer sums must fit Int64, and nonnull exact rational averages retain the native conversion refusal, even with a later LIMIT 0; floating averages, extrema and nulls retain their native values. Terminal aggregate results continue to expose exact wide integer and rational domains. Intermediate groups spend the private input-row allowance, while only final selected rows spend the public result-row allowance. COLLECT remains unsupported by external grouping.
Leading UNWIND can feed an admitted MATCH, including native correlation: UNWIND [1,3,3] AS wanted MATCH (n:Person {p:wanted}) RETURN wanted,n.p. The supplied-value relation and graph relation each complete once at the same snapshot. The executor reads their completed scratch rows in left-major order, preserves duplicates and typed identities, and uses the shared native pair-copy operation before the ordinary correlation filter and later query stages. Grouping, pagination and set operations can surround these inputs. An empty left input or downstream LIMIT 0 still cannot conceal a failed right input. These Cartesian relations report Set provenance, while graph-record accounting counts each graph child once, independently of scratch rereads. The combined child count and the complete private product must each fit --max-spill-rows; filters and pages do not bypass that admission. Pair decoding, payload copies and encoding reserve memory before allocation and retain it across writes, and repeated scratch reads continue the same physical-work allowance. This admits the native Cartesian operator; keyed/theta and optional relational joins still refuse.
UNION, INTERSECT, and EXCEPT support both ALL and DISTINCT over any admitted graph or supplied-value operands, including nested set operations. Each operand completes its expressions, ordering and page before the set merge; an empty left input or final LIMIT 0 cannot skip an invalid right input. The engine externally sorts both completed inputs by native whole-row order and merges through the same decision kernel as resident execution. ALL preserves occurrence arithmetic; DISTINCT first makes each input unique, so EXCEPT DISTINCT removes an entire matching value even when its left input contains more duplicates. Equality retains native value types, null equality and nested list/map values. Results report Set provenance, the selected snapshot, and the sum of graph records consumed by all operands. Native work, scratch-entry and physical sort limits are cumulative across the complete tree. Each binary node also admits the combined row count of its two completed operands against --max-spill-rows before merging or applying the parent page.
Set operands combine an open Any column, such as an UNWIND result, with a concrete column by retaining Any in the result schema. This makes literal and property returns usable alongside supplied values, including through nested set expressions and UNION column-name alignment. Different concrete column domains still refuse, and values retain their original types without coercion. Declared nullable list and map parameters also retain their column domains when bound to NULL, so rebinding a prepared query does not turn a nullable list into a scalar or invalidate its UNWIND stage.
The bound physical definition is compiled once before storage opens; even LIMIT 0 cannot hide an unsupported probe, other join, leading UNWIND followed by MATCH, intermediate aggregation or COLLECT. There is no resident source fallback. Source rows remain charged through encoding and asynchronous scratch writes, and complete evaluation of every stage, grouping and sorting precedes columns or rows. The graph pool and scratch pool retain separate limits: their combined allowance is --buffer-memory-bytes + --spill-memory-bytes, in addition to the documented preparation, recovery and transport memory outside those pools. Source, intermediate-row, final-row and external-work limits retain their distinct scopes. Expanded occurrences spend --max-spill-rows before any downstream page; one input row and its evaluated list must fit the scratch pool, while emitted rows release their temporary copies after each append. A source-free query also admits its one initial private occurrence through this limit, even when UNWIND [] or a final LIMIT 0 produces no rows. Accordingly, RETURN count(*) counts one initial occurrence, while UNWIND [] AS value RETURN count(*) counts zero.
WITH retains the name of a passed-through variable, including a parenthesized variable. Other expressions require an explicit AS name: use WITH n.score AS score or WITH count(*) AS count. This applies to leading, repeated, multipart and aggregate stages. RETURN retains its existing inferred output names.
Ordinary resident reads also support a whole WHERE relationship-existence predicate over vertices carried through WITH, COLLECT, or UNWIND. For example, MATCH (n:Person) WITH collect(n) AS people UNWIND people AS person WITH person WHERE EXISTS { MATCH (person)-[:KNOWS]->() } RETURN person.name AS name filters the unwound people. Direct predicates use bracketed relationships, such as (person)-[:KNOWS]->(); explicit EXISTS(...) and EXISTS { MATCH ... } also accept unbracketed relationships. Outer NOT uses the same native correlation. Each qualifying incoming occurrence is retained once, regardless of witness count, and the filter preserves incoming order for subsequent pagination. Each correlated pattern finishes under the native work and scratch limits before its existence result is chosen. Capability masking applies inside the graph predicate. This profile does not add external-spill support for correlated Apply, graph predicates inside list-comprehension locals, or arbitrary compound row-scope graph expressions.
--buffer-memory-bytes defaults to 64 MiB and covers graph admission, cache contents, native source evaluation and retained source rows. The cumulative encoded root ceiling is one sixty-fourth of the pool through 64 MiB and half the pool above that. The decoder reserves its actual frames and columns when the conservative estimate of sixteen times the encoded ceiling exceeds the pool. Cache bookkeeping and compact history metadata are charged separately. --buffer-source-bytes defaults to 1 GiB and bounds initial admission reads, including exact birth-patch refaults. --max-work-units independently bounds initial admission and the cumulative source and native expression evaluation; relational stages continue that allowance. In combined mode, buffered input encoding checks the frame size and reserves its overlapping row, cell and scalar encoding workspaces from the scratch pool before allocation. Relational stage decoding, expression workspaces and output encoding also reserve scratch memory before allocation. Every stage's decoding, encoding, sorting, copying and pagination shares one cumulative --max-sort-work allowance, and every intermediate append spends disk quota. Only the final selected rows spend --max-result-rows. Chronicle recovery, query preparation and parameters, and the CLI row transport workspace remain outside the graph-memory cap; final sorted-result decoding remains outside both pools. A missing or lagging checkpoint requires ordinary recovery; this mode does not fall back to a resident graph. Admission can still refuse when the metadata for distinct historical versions exceeds the pool.
query --spill-dir <existing-directory> uses the native external sorter for vertex and fixed-edge scans, including property-only projections, local predicates, DISTINCT, terminal SKIP/LIMIT, and historical cuts. ORDER BY may use unreturned vertex or edge properties and supported path functions: these private cells determine ordering and pagination, then are removed before result rows and column names are published. Multiple sort keys, direction and null placement use the ordinary query semantics. Under DISTINCT, sort keys must be projected. Unsupported native instructions refuse without an eager retry. It cannot be combined with --stream, --certify-to, or a standalone CALL fnx. Adding --buffered selects the bounded cold source and also admits the sequential OPTIONAL profile below.
Buffered OPTIONAL matches. The asynchronous external-order and numeric aggregate-input paths accept an edge-rooted fixed-hop pattern followed by sequential correlated OPTIONAL MATCH scopes. A checked correlated fixed-hop MATCH can also follow or separate those scopes. For example:
MATCH (a)-[r:KNOWS]->(b)
OPTIONAL MATCH (b)-[s:KNOWS]->(c)
WHERE s.score >= 10
OPTIONAL MATCH (c)-[t:KNOWS]->(d)
RETURN r, b, s, c, t, d ORDER BY r, s, t
The cursor retains one active witness per scope through the existing indexed traversal and predicate engine. Each optional scope makes its own NULL-extension decision after successful exhaustion without a witness. A required continuation can remove a row, but cannot manufacture a NULL row for an earlier optional scope that matched. Later scopes can still use an earlier non-null binding when another optional found nothing. Parallel occurrences, clause-local filters, original and optional properties and fixed-path captures retain their native semantics at one historical cut. The shared external owner applies final DISTINCT, ordering, grouping and paging. Active records are bounded by the fixed query definition; each output row owns its memory reservation. Source errors, resource refusals and cancellation remain errors, including beneath LIMIT 0. Independent scans, nested optional bodies, variable-length scope paths, nested probes/collections and unproved intervening instructions remain outside this profile. Ordinary source streams retain their existing admission. Regression sources and pinned formatter checks are present; runtime qualification remains open in implementation status.
The same flag supports numeric grouping over vertex and fixed-edge inputs: count, sum, avg, min, and max, including global summaries and historical cuts. Computed grouping keys and aggregate arguments, such as sum(n.quantity * n.price) or avg(n.p + $weights.delta), run through the native expression evaluator before partitioning. COUNT, SUM, and AVG also accept DISTINCT arguments, including computed values and hidden HAVING/ordering arguments. Membership uses exact native value types: integer 1 and floating 1.0 are distinct members; nulls are ignored. Each distinct argument column is externally sorted within a completed group partition, so membership needs no resident seen-set. Ordinary aggregates in the same query still count all occurrences. Every declared input expression runs, including hidden columns and when LIMIT 0 requests no output. Input occurrences are written into deterministic partitions, and a partition that exceeds the resident group allowance is split again before reduction. Every group finishes before HAVING, computed output expressions, output DISTINCT, exact typed ORDER BY, and SKIP/LIMIT; even LIMIT 0 cannot hide a later invalid qualified group. Computed outputs such as sum(n.p) * 2, conditional scalar expressions, lists and maps use the native evaluator once per qualified group and remain in scratch beside the complete hidden ranking cells. RETURN DISTINCT externally sorts the final visible tuples by native equality, retains the first complete group under the original ordering for each tuple, and then ranks those representatives before pagination. Equal numeric summaries use their exact native comparison domain; the selected representative keeps its original count, wide integer, scalar or rational value type. Ordering can use hidden aggregate columns, and visible grouping keys may be omitted or repeated. Full canonical grouping keys determine expression evaluation order, break ordering ties, and select representatives when no explicit order is supplied; hidden cells are removed before delivery. Counts remain unsigned counts, integer sums retain their full wide range, and exact averages retain their numerator and denominator. COLLECT and relational aggregate inputs still refuse before source execution. Hash collisions or skew that cannot fit within the bounded partition contract return a resource refusal.
The scratch files share one memory allowance (--spill-memory-bytes, default 64 MiB), and split one append-only disk allowance (--spill-disk-bytes, default 1 GiB) equally across their files. Buffered external queries and grouping use three files; ordering over the resident view uses two. Every intermediate pass and metadata write spends disk quota. --max-spill-rows (default 1,000,000) bounds input occurrences independently of final --max-result-rows; --max-sort-work (default 1,000,000,000) bounds additional partition, reduction, and sort work independently of the query's source budget. Encoded evaluation rows, including hidden sort keys, and private aggregate frames are capped at 1 MiB; a computed-output or output-DISTINCT frame includes both its complete ranking row and its projected row. External grouping charges its resident groups, decoded aggregate rows, computed-output workspaces, projection copies, and distinct-comparison frames to the shared pool before allocation. Intermediate aggregate conversion also reserves its owned row and encoding overlap before allocation and retains those reservations across asynchronous writes. Deduplication retains one charged previous frame between pulls and preserves the original result cells without reevaluating expressions. The decoded source generation, one native source/computed input row and final transport encoding remain outside that pool; input and output expressions share the source cursor's work and scratch-entry budgets.
Grouping and sorting finish before delivery begins. Rows are decoded and flushed individually with the ordinary native cell types and streaming completion contract. Each invocation creates a private scratch directory and exclusive files, then retires its own files before the success result; failures and cancellation also clean them up. Process death can leave that invocation's private directory, which later invocations never reuse or sweep. An error, unsuccessful exit, or missing terminal result means incomplete delivery.
Native CREATE/INSERT, matched mutations and vertex MERGE also support aggregate RETURN: for example, UNWIND [1,1,2] AS x CREATE (n:Person {p:x}) RETURN n.p AS p,count(*) AS created ORDER BY p. Grouping uses the exact statement occurrences and their frozen post-effect values, including duplicates; it does not rescan the graph. COUNT, SUM, MIN, MAX and COLLECT use the existing native aggregate engine, including supported DISTINCT arguments. Work and scratch quotas remain cumulative, final rows share the normal transaction output allowance, and LIMIT 0 cannot skip effects or conceal an aggregate error. Counts and integer sums must fit the ordinary Int64 row domain; nonnull exact integer-domain averages still refuse rather than silently round.
fgdbd (crates/fgdb-server) serves the FGP handshake, AUTH_REFRESH, one autocommit GQL read or write per EXECUTE, atomic parameterized EXECUTE_BATCH writes, explicit connection-scoped read/write transactions, reusable prepared read templates, ephemeral flow-controlled result streams, and live SUBSCRIBE TO changefeeds (a baseline, then one exact delta per commit), plus the HTTP/1.1 JSON adapter (/v1/health, /v1/databases/<name>/schema, /query, /query-batch, /write, /write-batch, /transaction, /read-transaction). CREATE/INSERT, matched SET/REMOVE/deletion, and vertex MERGE can return rows with their native transaction outcome over FGP and HTTP. Their RETURN expressions run against the authorized statement result before commit, so expression or result-quota failures discard the writes; LIMIT 0 still applies effects. The Bolt-compat subset (BoltCompatProfileV1, --bolt-listen) accepts official Neo4j drivers: autocommit and explicit read transactions each use one pinned generation, bounded autocommit writes execute as one atomic authorized program on PULL/DISCARD, and write RETURN supports scalar values, lists, maps, nodes, relationships and paths. Write graph metadata is hydrated from the final unpublished overlay under the same capability and budgets before commit; a late conversion or output-limit failure rolls back all effects, even with PULL 1 or DISCARD. Autocommit read graph values retain their statement's selected historical sequence. Explicit read transactions retain one native Read permit across RUN, metadata hydration and COMMIT, with cumulative signed limits and selectors constrained to the BEGIN basis. Explicit write transactions retain an authorized native workspace across BEGIN/RUN/COMMIT; later graph, aggregate, catalog, analytics and hybrid reads observe prior staged effects. Results remain provisional until the sole native commit, and rollback discards the workspace. Graph-valued write output was runtime-qualified on 2026-11-11 via bolt_autocommit.rs; it is not a full BoltCompatProfileV2 conformance claim. Every statement runs through a capability-authorized session built from the connection's Warden token, so a token's label/relation/property scope applies before expansion (including native GQL SUBSCRIBE TO changefeeds via a pre-expansion Z-set capability homomorphism; analytic CALL fnx.* subscriptions still require unrestricted graph scope). It does not yet serve durable result retention (ACK/release/resume), durable transaction reattachment, durable subscriptions, gRPC, HTTP/2 JSON routes, or multiple HTTP/2 request streams; docs/FABRIC_PROTOCOL.md lists exactly what is served.
HTTP/2 FGP. Add --http2-listen 127.0.0.1:8791 to serve native FGP in
one bidirectional HTTP/2 POST /v1/fgp per connection. The request and response
use content-type: application/fgp; DATA boundaries preserve the ordinary FGP
byte stream. Native authentication, prepared operations, explicit transactions,
subscriptions and FGP child streams use the existing dispatcher. HTTP 200
admits the carrier only; clients still perform HELLO/AUTH/SELECT_DATABASE.
fgdbd serve --listen 127.0.0.1:7687 --http2-listen 127.0.0.1:8791 \
--database social=mydb.fgdbdir --key-file fgdb.keys --issuer-key-file issuer.key
Cleartext clients use HTTP/2 prior knowledge. TLS requires h2 ALPN and the
same verified TLS 1.3 identity as the other listeners. --http2-allow-host
replaces the localhost/loopback/listen-IP authority allowlist. The dedicated
endpoint rejects browser Origin, request trailers, additional HTTP/2 streams
and JSON routes. One setup deadline spans the HTTP/2 preface through FGP READY;
bounded HTTP/2 receive credit and native result credit remain independent.
Rust embedding hosts use Server::serve_http2 with Http2Config. The native
CLI opens this transport for every remote operation:
fgdb remote --http2 --addr 127.0.0.1:8791 \
--token-file token.hex --database social query "MATCH (n) RETURN n LIMIT 10"
--http2-host host[:port] optionally supplies a validated HTTP authority;
otherwise it defaults to --addr. Pair --tls-server-name and --tls-ca-file
for verified TLS with required h2 ALPN. --http2 and --websocket are mutually
exclusive. Rust clients use Http2Target with Client::connect_http2 for
cleartext or Client::connect_http2_stream for an already verified transport.
One client deadline covers carrier admission through native AUTH_OK. Rejected
responses receive no FGP bytes or credentials; no redirect, reconnect or
uncertain-write replay occurs. See the
HTTP/2 transport contract and
qualification status.
WebSocket FGP. Add --websocket-listen 127.0.0.1:8789 and an explicit
--websocket-allow-origin http://localhost:3000 to serve native FGP at
ws://127.0.0.1:8789/v1/fgp (or wss:// when TLS is configured). The required
WebSocket subprotocol is fgp.v1. Binary messages carry the existing FGP byte
stream, so authentication, prepared statements, explicit transactions, native
streams and subscriptions use the same server dispatcher. Browser callers
still perform FGP HELLO/AUTH/SELECT_DATABASE after the upgrade; the URL contains
no token. Explicit Host and Origin policies fence the upgrade, and one
30-second deadline spans it through READY. See the
WebSocket transport contract.
This adapter has source review and regression sources. Native build and runtime
qualification are recorded in IMPLEMENTATION_STATUS.md.
The native CLI and Rust client also open this transport directly. For example:
fgdb remote --websocket --addr 127.0.0.1:8789 \
--token-file token.hex --database social query "MATCH (n) RETURN n LIMIT 10"
--websocket applies to every remote operation, including transactions,
prepared batches and subscriptions. --websocket-host host[:port] selects an
explicit virtual Host; otherwise the address is used. The existing paired TLS
options enable WSS with certificate/name verification and HTTP/1.1 ALPN.
The client validates the complete upgrade before sending an FGP credential,
retains upgrade read-ahead, and bounds establishment through authentication
with one context-clock deadline. Rust callers use WebSocketTarget and
Client::connect_websocket, or connect_websocket_stream with an already
verified TLS transport.
FGP also supports reusable native read templates through Client::prepare_read, execute_prepared/execute_prepared_streaming, and release_prepared. Preparation binds syntax and operand types without executing or pinning a snapshot; each execution supplies its parameters again and opens a fresh authorized read. Handles belong to one connection, are invalidated by authority refresh or database recovery, and cannot be used to execute writes. Each connection retains at most 64 templates and 4 MiB of original query text. Both schema and row callbacks return Result<(), ClientError>; a callback error cancels and drains its result before the client can execute another request.
Remote queries select their execution path with --read-mode buffered|source|ordered. The default buffered mode collects the ordinary eager answer. source uses the authorized native row or aggregate cursor with transport credit driving source demand. Its row profile is identity-leading: a vertex scan's rows begin with the scanned vertex and a fixed-edge scan's with the captured edge, so MATCH (p:Person) RETURN p.name refuses in source mode (re-measured 2026-11-24) while buffered answers it; Native source streams gives the exact profile. ordered uses the server's private external sorter for property-only vertex and fixed-edge/join projections, hidden sort keys, DISTINCT and SKIP/LIMIT. It also accepts terminal COUNT, SUM, AVG, MIN, MAX and COLLECT over admitted graph and complete relational inputs, including prepared historical reads. Groups spill through the existing bounded reducer; exact counts, wide sums and rational averages retain their native wire types, and collections retain native occurrence order. Both native modes flush the schema and each row without collecting the complete result in the CLI. Unsupported source profiles and terminal aggregate expressions that require an additional graph-element lookup refuse before execution. New external aggregate regressions have source and formatting review; runtime qualification remains open in implementation status.
Source streams additionally admit computed projections when the native input
and final output both have proved identity order, for example
MATCH (n) RETURN n AS id, n.age + 1 AS next_age ORDER BY id. The identity may
be a private ranking key, as in
MATCH (n) RETURN {node:n, next_age:n.age+1} AS doc ORDER BY n SKIP 1 LIMIT 10.
Directed edges use the edge identity; undirected roots also require
the source vertex, and fixed joins retain every traversal identity. Expressions use the
same scoped readers and cumulative allowance as the source. Every reached
expression, including the unselected suffix, is checked before successful
exhaustion. Bare property-only queries still require canonical value ordering,
and configured cold/buffered source streams admit vertex, single-edge and
fixed-hop join forms when property reads target the current vertex, a captured
edge or its endpoints.
For example, MATCH (a)-[r:KNOWS]->(b) RETURN r AS id,a.age+1 AS from_age,r.age+1 AS weight ORDER BY id
computes endpoint and edge fields without opening another graph read. The cold
source admits the complete predicate and projection field demand before
capability masking and source construction. A non-self undirected edge retains
one admitted record for both orientations; their computed values and output
guards share that record's growing memory reservation. Fixed-hop joins keep
their full active binding frame until the projection finishes, then retain
computed payloads in an independent output guard while traversal continues.
For example, MATCH (a)-[r:KNOWS]->(b)-[s:KNOWS]->(c) RETURN r AS first,s AS second,r.age+s.age AS cost ORDER BY first,second
streams computed two-hop occurrences. Undirected roots also require the root
source vertex immediately after the first edge identity. Indirect element
lookups, terminal optional expansions and other unsupported source shapes
still refuse.
These new source projections have qualification pending.
Enable external ordered reads by adding --query-scratch-dir /existing/private/scratch to the database's fgdbd serve options, after its --database argument. This is an operator path; clients cannot choose files or physical limits. Defaults bound the database's shared tracked spill buffers to 64 MiB and concurrent ordered sessions to four, with three private files of at most 512 MiB each per session and at most 100,000 input rows. The complete sort-work ceiling is reserved from the same signed allowance that pays for source work and final delivery. The server announces the stream before sorting, handles controls while setup or sort I/O is pending, and streams only the completed final rows under credit. Aggregate inputs and completed-group expressions finish even when LIMIT 0 suppresses output; only delivered groups spend the signed result-row allowance. Each collection must fit the per-value memory and encoded-row limits. On Unix, scratch files are exclusive and unlinked before query data is written. Ordered reads use the resident source by default. Ordered stream details and limits describe the supported profile and ownership boundaries.
To serve an existing checkpoint from disk, add --buffered-read-only --buffered-reads-memory-bytes <bytes> to that database's options. This opens one authenticated publication and its durable symbol catalog. Signed FGP clients use --read-mode source or --read-mode ordered with the host scratch directory above. Prepared source and ordered reads use the same publication, including historical cuts within its frontier. Ordinary FGP reads, default prepared reads and HTTP queries use the admitted cold source profile by default. Add --buffered-default-ordered alongside the fixed cold mount and host scratch options to select the native external sorting, exact aggregation and supported relational composition profile for those ordinary interfaces. This explicit policy prepays the configured sort-work allowance and retains both cold and ordered query slots until delivery completes. Collected output is charged to the cold pool; large answers can use the explicit streaming modes. See ordinary reads on fixed cold mounts for the policy and pending runtime qualification. Keep the checkpoint's immutable objects available while serving it and restart to select a newer frontier. The specified byte limit covers the shared graph pool. Query scratch, catalog, and transport memory have separate bounds.
Read-only pools above 64 MiB allow a cumulative encoded root and segment transfer of half the pool, matching the standalone buffered CLI. Decoded root allocations are charged separately to the same graph pool. Use --buffered-reads-root-bytes to set a smaller transfer limit.
With Person, name and age configured on the server:
fgdb remote --addr 127.0.0.1:7687 --token-file token --database social \
query --read-mode ordered \
"MATCH (p:Person) RETURN p.name AS name ORDER BY p.age DESC LIMIT 20"
In robot output, remote native modes emit columns with stream=true; the selected snapshot sequence arrives in FGP's terminal and appears only in the final rows result. A late refusal, EOF or output failure leaves the earlier prefix incomplete and emits no successful result. Remote --param name=uint:<decimal-u64> preserves the complete unsigned range for typed temporal and pagination operands.
To compare a read at two exact revisions, use fgdb remote ... diff --before 7 --after 12 '<read>', the Rust client's execute_diff / execute_prepared_diff, or POST /v1/databases/<name>/query-diff with {"statement":"<read>","before":"7","after":"12","parameters":{}}. Results carry exact signed occurrence counts: additions are positive and removals negative. Each endpoint preserves the query's DISTINCT, ordering and pagination before comparison, with capability scope applied at both cuts. remote diff --stream selects the configured external sorter and delivers changed tuples under flow control. Supported unary WITH, computed filters and UNWIND pipelines execute completely at both endpoints, including intermediate pages and scoped historical property reads through carried elements. Buffered mode supports native aggregate results as well. Only the exact terminal endpoints and changed-tuple count establish a complete answer. Finite difference examples and limits cover JSON output, cancellation and shared budgets.
For atomic parameterized ingestion, use Client::execute_batch over FGP or POST /v1/databases/<name>/write-batch with {"statement":"<write script>","argument_sets":[{...},{...}]}. All records bind before effects and share one authorized program, one signed allowance and one commit; later records see earlier records' effects. The default host limit is 64 expanded statements across the batch. This statistics-only operation refuses RETURN before effects and supports max_rows=0. A lost response can leave a committed batch with an unknown outcome, so the client never retries automatically. Batch examples and limits show the HTTP and Rust APIs.
For a read-modify-write operation, fgdb remote ... write --if-current 12 '<write>' or Client::execute_write_if_current requires the selected database to remain at the revision you read. The server checks under its exclusive writer lock and retains that lock through native completion, including RETURN. A stale condition returns conflict before effects; it is never retried as an unconditional write. HTTP provides /v1/databases/<name>/write-if-current with an expected_seq decimal string beside the usual statement and parameters. This whole-database condition also conflicts on unrelated commits, and the revision must belong to the same database incarnation. Conditional-write examples and semantics distinguish prepublication conflicts from unknown write outcomes.
Served subscriptions now reserve the capability's signed work and graph-node allowances across preparation, all maintained operators, replay, baseline delivery and wire conversion. Later maintenance retains its admitted per-operator ceilings; each poll shares one allowance across normal delivery and any replacement baseline after replay eviction. Final row limits count the complete compressed change batch, including pending redelivery, before framing. Failed setup removes its private producers and restores the registration slot. Source-free subscriptions can run with a zero graph-node grant, including grouped UNWIND input. These limits are conservative per-registration, maintenance-tick and poll ceilings; native GQL subscriptions project the initial snapshot and each commit through the capability's pre-expansion scope (with hidden mutations emitting zero frontier advances), while analytic CALL fnx.* subscriptions still require unrestricted graph scope and subscriptions have no durable reconnect resume.
Each served database has a supervised authoritative recovery worker. A write that leaves the engine requiring recovery fences new requests, invalidates old sessions and queued results, and triggers a reopen through Chronicle after active source operations drain. Recovery never replays the write: uncertain completion remains outcome_unknown. Successful recovery admits a new generation; a failed reopen keeps the database unavailable for operator intervention. A subscription invalidated by recovery receives a terminal reset with its last fully delivered sequence when the connection can safely deliver one, and must subscribe again for a replacement baseline. That sequence is a delivery checkpoint, not a durable resume token.
To encrypt all configured listeners, add --tls-cert-file server-chain.pem --tls-key-file server.key to fgdbd serve. The PEM private key must be owner-only. FGP, HTTP/1.1, HTTP/2, WebSocket and Bolt then require TLS 1.3 through the pinned foundation; a refused handshake never falls back to plaintext. FGP requires ALPN fgp/1, HTTP/1.1 JSON and WSS require http/1.1, HTTP/2 FGP requires h2, and Bolt retains its encrypted version negotiation without requiring ALPN. Capability authentication and fresh checks before physical output still apply. Clients connect with an explicit trusted CA and the name on the server certificate:
fgdb remote --addr 127.0.0.1:7687 --token-file token --database social \
--tls-server-name db.example.test --tls-ca-file ca.pem \
query "MATCH (p:Person) RETURN p.name"
The same TLS options apply to remote writes and subscriptions. HTTP clients use https:// with their CA verification enabled; Neo4j drivers use their encrypted Bolt configuration. Server identity is validated at startup, early data is disabled, and drain cancels unfinished handshakes.
Target state. The interactive shell,
branch,backup/restorearchives,doctor/analyzeoperations,robot health, a--jsonoutput flag, and the remainingfgdbdsurfaces above remain W10 composition work (registries/workspace_topology.toml). The commands above are exactly the ones that run today.
Installation
1. Installer and release binaries. Build from source using the commands below. The archive/* tags preserve development history. Issue fgdb-epic-w10-mhq.1 tracks the installer and signed release binaries.
2. From source (requires the pinned nightly toolchain, which rust-toolchain.toml auto-selects). This is the path that runs today:
git clone https://github.com/Dicklesworthstone/frankengraphdb
cd frankengraphdb
cargo build --release # builds the library workspace
cargo run -p fgdb --example open_a_database # a real main(): create, commit, reopen, verify
Build both command-line programs with cargo build --locked -p fgdb-cli -p fgdb-server. The server accepts FGP connections and offers HTTP/1.1 JSON and Bolt listeners. Its HTTP listener serves the read-only browser workspace at /studio/. See the CLI and FrankenGraph Studio.
3. Embedded, as a Rust library:
# Cargo.toml
[dependencies]
fgdb = { git = "https://github.com/Dicklesworthstone/frankengraphdb" }
To pass a runtime Cx between your application and fgdb, resolve both to the same asupersync package. If your workspace uses the crates.io release, put this in its root manifest and use asupersync = { version = "=0.7.0", default-features = false } in the application crate.
[patch.crates-io]
asupersync = { git = "https://github.com/Dicklesworthstone/asupersync", rev = "d6364ac476b51b5dea9abeb10d7897d96ac8fba3" }
cargo tree -i asupersync should show one package shared by the application and fgdb. Dependencies that pin asupersync to an older Git revision must also move to the same release revision.
Target state. The snippet below is the 1.0 embedded surface. Today's crate root differs in shape, not substance (checked 2026-09-24):
Database::create/open/open_memory/write/compactareasync fns taking an asupersync capability context (&CommitCx), so the caller owns the runtime; GQL runs throughdb.query(&cx, text, ¶ms, symbols, policy), pinned read views (db.read_session()), reusable prepared statements (PreparedNativeRead::prepare,prepare_gql_query), ordered write transactions (db.begin(&txn_cx)→WriteTxn), and capability-scopedAuthorizedReadSessions. What does not exist yet is this synchronousdb.session().prepare()shape. Theopen_a_databaseexample andcrates/fgdb/examples/show today's calls.
use fgdb::Database;
fn main() -> fgdb::Result<()> {
// Synchronous, blocking API; the async runtime is an owned internal detail.
let db = Database::open("mydb.fgdbdir")?; // or Database::open(":memory:")?
let mut session = db.session()?;
let stmt = session.prepare("MATCH (p:Person)-[:KNOWS]->(f) RETURN p.name, count(f) AS deg")?;
for row in stmt.query(&[])? {
let name: &str = row.get("p.name")?;
let deg: i64 = row.get("deg")?;
println!("{name}: {deg}");
}
Ok(())
}
Batch-at-a-time committed replay — qualification pending. Privileged embedded consumers can select a fixed committed interval with Database::delta_replay(after, through) and pull one complete authenticated batch with next_delta_replay. This reads checkpoint-omitted history directly through the existing Chronicle verifier without populating the entire missing LocalDeltaBatchIndex prefix:
let through = db.frontier()?;
let mut replay = db.delta_replay(last_applied, through)?;
while let Some(batch) = db.next_delta_replay(&commit, &mut replay).await? {
println!("committed batch at {:?}", batch.commit_seq());
}
Later writes do not extend through. Empty logical ticks still return a batch; repeated reads reproduce its canonical bytes and committed identity. Each pull rechecks the existing database identity and both boundary marker/chain commitments, and advances only after complete authentication and final cancellation checks. Missing/corrupt capsules, future cuts, changed history and explicit retirement return typed errors. Failure or a dropped pending pull leaves the cursor, graph snapshot and loaded delta window unchanged. Applications own their durable applied-position checkpoint and idempotency; this cursor records batches returned, not acknowledged effects.
The cursor holds no retention lease, durable consumer state or protected resume capability. It is an unmasked Local committed-delta API, separate from query-result subscriptions and public CDC. Its source identity inherits the current namespace/history authority, not physical-directory uniqueness. Each batch remains indivisible, and existing verification diagnostics are retained, so the bound is one batch of new payload per pull rather than total process memory. Source review and focused regression sources cover checkpoint reopen, fixed endpoints, canonical replay, retirement and failure atomicity; runtime qualification remains open in implementation status.
Buffered native reads available today. Database::open_buffered_read_view opens an owned, fixed checkpoint without constructing the resident graph snapshot or a block writer. Its async vertex, edge, and bounded incoming/outgoing adjacency_at methods fault authenticated immutable objects through the Strata extent cache. The corresponding *_at methods read historical statements with the same winning-version and retirement metadata as the ordinary resident view. open_buffered_read_view_with_vfs provides the same path through an injected filesystem.
The caller supplies a shared MemoryPool and BufferedReadLimits: root bytes, source bytes inspected during admission, block/vertex-patch counts, per-operation work, and cache frame/extent limits. Metadata, decoding workspace, admission history, cache frames and returned BufferedValue rows retain reservations for their lifetimes. A held result remains charged after its view is dropped. Point reads currently scan the admitted descriptors; bounded adjacency returns the complete winning incidence or a resource error, and parallel edges remain distinct.
Within the caller's async runtime, with commit, query, and keys supplied as the ordinary capability contexts and database keys:
use fgdb::{BufferLimits, BufferedReadLimits, Database, MemoryPool};
use fgdb_types::VId;
let memory = MemoryPool::new(16 * 1024 * 1024, 0)?;
let limits = BufferedReadLimits {
max_root_bytes: 64 * 1024,
max_source_bytes: 64 * 1024 * 1024,
max_blocks: 512,
max_vertex_patches: 512,
max_work: 1_000_000,
buffer: BufferLimits {
max_frames: 8,
max_ghost_entries: 16,
max_extent_bytes: 16 * 1024,
},
};
let mut view = Database::open_buffered_read_view(
&commit, "mydb.fgdbdir", keys, memory.clone(), limits,
).await?;
let vertex = view.vertex(&query, VId(1)).await?;
Buffered GQL execution. The same view now exposes stream_graph_values_governed and its historical _at counterpart. Prepare and bind with the existing native GQL compiler and your symbol resolver; execution then pulls canonical vertex histories through the extent cache. The supported projection begins with the scanned vertex identity and can include its canonical properties. Labels, local WHERE expressions, DISTINCT/ALL, and SKIP/LIMIT use the existing evaluator and row semantics. stream_graph_vertices_governed provides the identity-only counterpart for native prepared patterns.
For example, with property name score bound to the application's catalog ID:
use fgdb_delta_types::PropertyKeyId;
use fgdb_gql::{
GqlParameters, GqlQueryPolicy, GraphSymbol, GraphSymbolKind, PreparedGraphText,
};
let prepared = PreparedGraphText::prepare(
"MATCH (n) WHERE n.score >= 10 RETURN n, n.score LIMIT 100",
|kind, name| match (kind, name) {
(GraphSymbolKind::Property, "score") => Some(GraphSymbol::Property(PropertyKeyId(1))),
_ => None,
},
)?.bind_parameters(&GqlParameters::new())?;
let policy = GqlQueryPolicy::new(100_000, 100, 10_000_000, 1_000_000);
let mut cursor = view.stream_graph_values_governed(&query, &prepared, policy)?;
while let Some(row) = cursor.next().await {
println!("{:?}", row?.values());
}
The scan merges sorted patches with one decoded patch, while scan misses bypass point-cache admission. Authenticated, disjoint identity ranges in publication order use one lazily advanced scan head; other layouts retain one small head per patch. Identified-edge scans use the same range-proof principle while preserving original property positions. Root references and descriptors remain resident and bounded by the host pool; the new scan-head paths have regression sources but runtime qualification remains pending. It admits each candidate before reading that identity's history and shares one cumulative query budget across storage and evaluation. Evaluator temporaries and returned BufferedQueryRow values reserve bytes before allocation; a returned row stays charged after dropping the cursor or view. A failed or dropped in-flight pull permanently stops its cursor. Earlier successful pulls remain delivered after a later error, so complete success requires exhausting the cursor. Joins, edge expansion, probes, aggregation, property-only output, and alternate ordering still refuse in these direct streaming methods. These owner-level methods do not apply Warden session masking.
For buffered external queries, call PreparedNativeRead::prepare_buffered_order or prepare_buffered_aggregate with the parameters before opening the view. Each returned bound definition has spool_in_view, which pulls native singleton or admitted buffered graph sources into the ordinary external sorter or partitioned aggregate executor. The ordering definition also admits native projection/filter/scope/UNWIND/numeric-grouping relations and all six binary set operations, preserving every intermediate ordering and pagination boundary through separate completed scratch stages. stage_count() includes binary and aggregate descendants and their completion passes; aggregate_count() counts every reducer in the complete tree, including a terminal aggregate, for bounded scratch-metadata admission. Its spool_in_view_with_resolver counterpart accepts the pinned scalar artifact resolver for decoding intermediate values such as zoned timestamps; the CLI threads its existing --tzdb-file resolver through these stages. Graph sources use the view's memory pool for decoding and evaluation; native singletons and intermediate stage decoding, evaluation and encoding reserve from the destination scratch pool. Set merging retains two authenticated input positions and their row frames; DISTINCT additionally retains one prior equality representative while advancing an input. Source-free reads can use a zero snapshot-record allowance and leave the graph cache untouched. The execution preserves the original visible schema, hidden ranking cells and temporal selector. The source and stage rows retain their reservations through each asynchronous scratch append; the completed spool is accepted only after all source, expression, ordering and result limits succeed. Both APIs require three distinct private spill files with their existing shared scratch pool and cleanup contract. The ordering API takes scratch, destination and auxiliary files, followed by group capacity and partition limits, then its run/page/row/work limits; its completed result always belongs to destination. The aggregate API retains its source, partition and destination order. The CLI combination above exercises these same embedded APIs.
Opening checks the existing slot, manifest coordinates, Chronicle binding and complete object/history admission. A missing or lagging checkpoint returns BufferedOpenError::RecoveryRequired; recovery is an explicit ordinary writable open. The buffered view holds no writer lease once returned, so later writes and compaction leave its selected root unchanged. Vertex-history admission retains compact lifecycle metadata and birth-patch locators; a restatement refaults its original authenticated patch for exact label and property comparison. It keeps at most two decoded object workspaces instead of retaining the complete property history. Metadata still grows with distinct version count and can exhaust the pool. Both original reads and birth-patch refaults consume the source-byte and work limits; source-byte refusal can inspect one format-bounded object beyond the requested limit. Chronicle recovery and caller-owned query preparation/catalog metadata remain outside the pool. The view does not supply a cross-process object-retention/GC lease; the database's immutable object directory must remain available.
4. Python bindings (ABI3 wheels, with a zero-friction to_fnx() / from_fnx() bridge and NumPy views over Embedding columns). Target state: no wheels are published — pip install frankengraphdb installs nothing of ours today. When releases exist:
pip install frankengraphdb
import frankengraphdb as fgdb
db = fgdb.open("mydb.fgdbdir")
for row in db.query("MATCH (p:Person) RETURN p.name LIMIT 5"):
print(row["p.name"])
Quick start
Build the CLI and server as described in Installation, put both binaries on your PATH, and run these commands in a new directory. Keep the generated key for subsequent opens. The create command persists the bindings for every process that uses this database.
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"
The write commits at sequence 2. The final command reopens the database and returns one row with Ada under source and Charles under target. For the embedded equivalent, run cargo run -p fgdb --example open_a_database. For a server connection, follow the FGP and HTTP examples or open the same database in Studio.
Configuration
fgdbd serve takes command-line flags. Run fgdbd help for listener, database, authentication and resource options. The following TOML illustrates the planned 1.0 configuration format.
# fgdb.toml
[storage]
data_dir = "./mydb.fgdbdir"
space_amp_trigger = 2.0 # compaction fires above this space amplification (§5.5)
repair_overhead = 0.20 # RaptorQ repair symbols (heals torn/corrupt data)
[retention]
policy = "KEEP ALL" # "KEEP ALL" | "KEEP 90d" | "KEEP 100000 seqs" | "KEEP NONE"
anchor_every = { seqs = 100_000, bytes = "8GiB", time = "24h" } # AnchorSnapshot cadence
[transactions]
default_isolation = "SERIALIZABLE" # SNAPSHOT | READ_ONLY_HISTORICAL | SNAPSHOT_FOLLOWER | BRANCH_CAUSAL
result_determinism = "STRICT" # STRICT (byte-identical, incl. order) | RELAXED (declared in certificate)
tie_break_policy = "InsertionOrder"
[query]
semantic_profile = "gql-2024-strict" # pins null/duplicate/ordering/coercion semantics
certificate_mode = "Compact" # Compact | Budgeted | Full | Forensic
per_query_memory = "4GiB" # spills to temp ECS objects past budget, never OOM
[server]
listen = "0.0.0.0:7687"
protocols = ["fgp", "http2", "grpc", "ws", "bolt"]
tls_cert = "/etc/fgdb/cert.pem"
tls_key = "/etc/fgdb/key.pem"
[security]
at_rest_encryption = true # Argon2id → KEK → per-DB DEK; XChaCha20-Poly1305, encrypt-then-code
require_capability = true # macaroon-gated; caveats compile to planner predicates
[replication]
role = "leader" # leader | follower
peers = ["10.0.0.2:7688", "10.0.0.3:7688"]
The TOML above describes the proposed configuration. The server and CLI currently take command-line flags. Write transactions use first-committer-wins backward validation and can rebase compatible intents.
For a passphrase-protected database key, create an owner-only passphrase file and run fgdbd keygen --database graph.keys --passphrase-file pass. Supply --key-file graph.keys --kek-passphrase-file pass when creating and reopening the database. The Argon2id-wrapped key enables protected Strata storage. A raw three-line key also protects Chronicle commit capsules. To enable protected Strata storage with that key, supply --strata-ecs on creation and subsequent opens.
The server has an in-memory replica coordinator. Durable distributed replication and an operator workflow for key rotation remain open.
Performance
Numbers below are the provisional CI gates (§17 EmpiricalGates, activated only under pinned benchmark manifests) on the reference machine (32-core/64-thread, 256 GB RAM, PCIe-4 NVMe at 7 GB/s, single node), chosen from measured SOTA anchors with leapfrog margins. Six standing laws bind every published figure: no benchmark-only semantics (durability/isolation/result-consumption match production), distributions not averages (p50/p95/p99/p99.9 and worst hot-key), never hide compaction (foreground latency during compaction/checkpoint/GC/index-build is part of the result), memory is a first-class metric (bytes/live-edge include versions, indexes, witnesses, and allocator slack), adaptive numbers disclose their policy epoch, and no unpriced protocol weight (every gate names its operation class in the plan's operation-cost registry and is derivable from it).
| Domain | Gate |
|---|---|
| Cold bulk load (CSV/Parquet-lite → sealed runs) | ≥ 40M edges/s sustained (≥ 60% of NVMe seq-write ceiling) |
| Transactional ingest (small txns, honest group-commit fsync) | ≥ 2M edge-inserts/s for the pinned batch/txn mix; latency includes final rebase/constraint work, payload D1, root D2, and configured encryption/FEC |
Point reads (vertex by key, 1-hop existence; SnapshotQuery class) |
≥ 8M lookups/s across cores; p99 < 15 µs warm |
| Neighbor scans, sealed runs (decoded-cache path) | ≥ 500M edges/s per core; ≥ 10B edges/s node aggregate |
| 2-hop factorized count (10⁸-flat-row equivalent) | < 50 ms (must not materialize) |
| Triangle count (WCOJ over compressed runs) | within 2× of best static-CSR WCOJ systems; ≥ 20× any pointer-chasing GDBMS |
| LDBC SNB Interactive SF-100 | throughput ≥ 3× Neo4j, ≥ 1.5× best published embedded engine |
| LDBC Graphalytics (BFS/PR/WCC/CDLP/LCC/SSSP) | within 1.5× of dedicated static analytics engines, on transactional storage |
Time-travel overhead (KEEP ALL, recent AS OF) |
current-time OLTP degradation < 8%; AS OF in anchor window < 2.5× current-time cost |
| Vector: 10M × 768-d f32 HNSW | ≥ 20k QPS @ recall ≥ 0.95 (k=10); insert-to-searchable < 100 ms (the freshness gate) |
| Ripple view maintenance | ≥ 1M input-changes/s per circuit worker; subscription end-to-end p99 < 10 ms |
| Branch create / snapshot open | O(1), < 100 µs |
| Recovery (crash @ 1 TB) | < 30 s to first query (anchor-mapped, capsule-tail replay) |
Every gate has a bench binary, a committed baseline, a variance budget, and a flamegraph artifact on regression. Complexity-witness regression locks fail CI when an operator's observed op-count exceeds its declared bound; a regression is a build break, not a dashboard blip.
Target state. None of the gates above is measured yet (checked 2026-09-24). One bench binary (
crates/fgdb-bench) runs its shapes and labels every eventempirical_gate_activated=false; no baseline, variance budget or flamegraph is tracked. The numbers in the table are commitments, not results.
Determinism, verification & governance
- Simulation-first. The entire database (storage, transactions, compaction, Ripple, replication, server) runs under asupersync's lab runtime with virtual time, a fault-injecting virtual disk (torn writes, bit flips, ENOSPC, fsync lies), and DPOR schedule exploration. Every concurrency bug is a seed; failing runs auto-attach crashpacks with replay commands.
- A reference oracle.
fgdb-referenceis a deliberately simple, single-threaded, obviously-correct implementation of the full logical semantics, compiled for tests only. "What should this return" is a program, not a debate, and it exists before the first optimized line. - Continuous consistency oracles. SI and SSI oracles reconstruct the dependency graph from traces and assert no committed dangerous structure (the database's own cycle detection verifies its own serialization graphs), alongside Elle-class history checking and obligation-leak detection.
- Formal anchors (scoped, honest). Lean proves MVCC visibility, block-level SSI safety, merge-ladder soundness, and the Z-set operator subset; TLA+/TLC models the two-fsync commit + recovery, compaction publish/retire, Raft-marker interaction, and branch fork/merge. Every load-bearing invariant carries a stable ID (
FG-INV-01 … FG-INV-20) in a machine-readable registry that CI cross-checks for a live checker. - Plan certificates. Every query result is an auditable artifact: plan hash, tie-break policy, snapshot seq, per-operator observed-vs-bound counts, re-plan events, and a BLAKE3 decision-path hash.
replay(certificate, seq, seed)reproduces a result byte-for-byte. For agents and regulated pipelines, this is a feature no competitor ships. - Governance applied before expansion. Macaroon caveats compile to mandatory planner predicates: a capability that can't see an edge type can't observe its existence via degree either. Absence-of-results witnesses are scoped to the authorized subgraph, so the serializability machinery can never become an oracle about data you can't see.
Limitations
A few honest boundaries:
- Horizontal sharding is designed-in, not yet activated. Single-node excellence plus replication (durability, availability, read scale, multi-writer) is the shipping product. Strata's partition grid, per-partition dense ordinals, capsule-based movement, and
topology_epochfields are all present so that sharding is an activation, not a rewrite, but distributed FreeJoin and per-shard Raft groups are the final workstream. If you need a graph sharded across dozens of machines today, that milestone is still landing. - Multi-writer replication follows single-leader consensus. Writer-anywhere with merge-ladder rebase gives skew-commutative workloads (agent swarms appending facts) near-linear write scaling; true conflicts behave exactly like local first-committer-wins. It is sequenced after the single-leader path.
- The native language is GQL, not Gremlin. Gremlin is imperative and optimizer-hostile; it is provided only as a possible later compatibility shim, if ever. openCypher is the pragmatic on-ramp; the Bolt-compat subset is an adoption wedge for read/query workloads, not the native path.
- Property graph first; RDF is import/view, not the core model. GQL, LDBC, and fnx are binary-graph worlds. N-ary facts are modeled by reification (an event vertex plus typed edges), which the planner already optimizes.
- It targets documented conformance, not universal Cypher. Where standards diverge, behavior is pinned by a versioned SemanticProfile and every divergence is a published matrix entry: folklore-free, but not "runs every Cypher snippet unchanged."
FAQ
Is this production-ready today? The README describes the 1.0 target state (see the note at the top). Track the convergence gates in §19 of the plan for exactly what is enforced at each milestone: G1 "The Engine Lives", G2 "One Version Universe", G3 "Verified & Networked", G4 "Leapfrog, Published".
Why build every codec, index, and parser in-house instead of using great existing crates? The closed dependency universe is the moat, not an albatross. The entire dependency surface, down to the RaptorQ decoder and the HNSW graph, is auditable, deterministic under the lab runtime, and owned. That is what makes FoundationDB-class deterministic testing of the whole system possible; you cannot seed-replay a bug that lives inside an opaque third-party thread pool.
How can time travel be nearly free? Because it isn't a separate feature. Retired MVCC versions don't get deleted; they cool into retention tiers, and those tiers are the durability layer. AS OF s resolves to the nearest anchor ≤ s plus a forward-apply of commit capsules the database already stored for durability. AeonG bolts temporal onto Memgraph; here it's a corollary of how MVCC works (current-time OLTP degradation gate: < 8%).
Are the branches real, or copy-on-write snapshots with a fancy name? Real. Because state is { anchor set + capsule chain } and everything is content-addressed, a branch is a BranchManifest that structurally shares all sealed objects: O(1) creation, O(live-delta) memory, 10k+ concurrent. Merge replays the branch's intent log through the same semantic ladder that resolves write conflicts and replication rebases: one mechanism, three features. Today that is not built: BranchManifest is deliberately absent from fgdb-chronicle, so there is no fork, merge or branch write. What exists is the read half: AT BRANCH name on a read, against a pinned snapshot the host resolves (Database::query_with_branch_resolver).
Is vector search actually transactional, or eventually-consistent like the plugins? The target is a durable, branch-scoped HNSW index using the same delta→sealed→compaction lifecycle and MVCC visibility filtering as adjacency. Today results are snapshot-consistent and honour AS OF. A search can build an index for that call or reuse a pinned resident generation. Embedded applications can register resident indexes for synchronous maintenance after successful graph commits: current lookup refuses stale or failed generations, and previously returned pins retain their exact source and ANN topology. Explicit refresh remains available for independently owned resident indexes. The durable index catalog and branch scope are still unimplemented.
Can I embed it in my Rust or Python program? Yes, that's a primary goal. The 1.0 library API is synchronous and blocking; the engine owns its runtime internally, so there's no async plumbing to thread through your code. Python gets ABI3 wheels and a zero-copy fnx / NumPy bridge. Today the Rust API is async and takes an asupersync capability context, so the caller drives the runtime, and there are no Python wheels yet (see Installation).
Will it connect to my existing Neo4j tooling? For read/query workloads, yes, via the Bolt-compat subset (enough of Bolt v5 + Neo4j type mapping for standard drivers and visualization tools). Divergences are documented; it is an adoption wedge, not the native surface.
Why does every result come with a "certificate"? So results are reproducible and auditable. For agent memory and regulated pipelines, "why did this query return this, and can I prove it again bit-for-bit" is the actual requirement, and certificates make a query result a replayable artifact instead of a transient event.
About Contributions
Please don't take this the wrong way, but I do not accept outside contributions for any of my projects. I simply don't have the mental bandwidth to review anything, and it's my name on the thing, so I'm responsible for any problems it causes; thus, the risk-reward is highly asymmetric from my perspective. I'd also have to worry about other "stakeholders," which seems unwise for tools I mostly make for myself for free. Feel free to submit issues, and even PRs if you want to illustrate a proposed fix, but know I won't merge them directly. Instead, I'll have Claude or Codex review submissions via gh and independently decide whether and how to address them. Bug reports in particular are welcome. Sorry if this offends, but I want to avoid wasted time and hurt feelings. I understand this isn't in sync with the prevailing open-source ethos that seeks community contributions, but it's the only way I can move at this velocity and keep my sanity.
License
The frankengraphdb source code is licensed under the MIT License with an OpenAI/Anthropic Rider, Copyright (c) 2026 Jeffrey Emanuel (see LICENSE). The rider withholds all rights from OpenAI, Anthropic, their affiliates, and anyone acting on their behalf, including any use of the software or derivative works in a machine-learning dataset, training corpus, evaluation harness, or pipeline. In any conflict between the rider and the rest of the license, the rider controls.
See also
COMPREHENSIVE_PLAN_FOR_THE_DESIGN_OF_FRANKENGRAPHDB.md, the master plan: the six bets, the foundation audit, the SOTA distillation (adopt/adapt/reject), every subsystem (Chronicle, Strata, Loom, Ripple, Beacon, Prism, Warden, Fabric, Aegis), the verification doctrine, the workstreams and convergence gates, the on-disk formats, the graph intent-log vocabulary, the GLA operator inventory, the invariant registry, and the operation-cost registry.AGENTS.md, conventions for human and AI agents working in this codebase, including the engineering doctrine and the verification ladder.
Explore projetos relacionados
Carregando…