What Belongs in the Database, and Why We Didn't Ship a Postgres Extension
Chasing one property (make the same AI decision twice) quietly rebuilt half of a database. The interesting question was: which half belongs there, and should the deterministic core ship as a Postgres extension, beyond "did we build a database?" We built the path, then chose not to. Here's the line, and the reasoning.
The runtime stack set out to make AI retrieval, planning and execution idempotent, with database-building unplanned: every decision replayable, auditable, independently verifiable. But idempotency has gravity. To make a decision reproducible you need identity; identity needs a catalog; a catalog needs constraints, lineage, transactions, a write path, and something to re-check the result. One by one, the runtime rebuilt the disciplines that produced relational databases decades ago: reference-first artifacts are normalization, the event ledger is a write-ahead log, replay is crash recovery, verification planes are CHECK constraints, the planner is a query optimizer.
Once you notice that, an obvious question arrives, and it's the right one to ask.
If the runtime now does planning, verification, lineage, replay and governed transactions, should the deterministic core just be a PostgreSQL extension?
We took that seriously enough to build the path. And then we didn't ship it. The reason is the interesting part.
First, draw the line: what belongs in the database
Two things wear the word "database" and they are not the same job.
The storage substrate belongs to the database, and PostgreSQL already does it superbly. MVCC, the write-ahead log, replication, query optimization, indexing, backup and recovery, ACID transactions, row locking, foreign keys, JSONB, exact numerics, decades of operational tooling. None of these problems are unique to AI, and reimplementing them from scratch to get an "AI database" would be throwing away the one part that's genuinely solved. So Postgres stays, promoted from "the app's row store" to the authoritative store for governed artifacts.
The execution semantics never belong in a storage engine. Compiling a goal into a mission, gating a side effect on human approval, unwinding a half-run job with a saga, planning across six axes under a budget, learning the best action per regime, proposing work that doesn't exist yet: that is orchestration of long-running, outside-the-database processes. A stored procedure is the wrong shape for it, and a database is the wrong place to run it.
And then there's the middle. A handful of the runtime's kernels are pure, deterministic functions: reconcile/merge, BM25 lexical scoring, temporal selection, Personalized PageRank over a fact graph, and the verification checks. Same input, same output, no side effects, no model calls. Those are exactly the shape of a database function. They are the only part of the runtime that could genuinely live inside Postgres, and they're what made the extension idea tempting.
The tempting version, and it really would work
The plan was concrete. Ship the deterministic kernels as Postgres: pg_tle + PL/Rust on managed instances, pgrx on self-managed, driven by the same golden fixtures every other implementation round-trips. Because the fixtures are the contract, a Postgres implementation that reproduces them is simply a fourth conforming implementation alongside Python, Go and Kotlin/JVM: SELECT rdo_reconcile(...) returning the identical, provable merge the Spark job produces. It's a lovely idea. The determinism that makes the runtime trustworthy is the same determinism that makes it portable into a stored function.
We built toward it. Then we looked at where it could actually be deployed.
Why we didn't ship it: an extension is deployable almost nowhere that matters
Three facts killed it as a product boundary on reach, engineering still sound.
1. We needed a thin deterministic layer, and the existing database was enough. The hard, unsolved problems are deterministic planning, governed execution, artifact identity, replay, verification, provenance and policy. The easy, solved problems are storage and transactions. A thin layer on top of an existing engine was always the right size. Building a whole new database to host a thin layer is the tail wagging the dog.
2. A thin layer across every database is infeasible. "Portable" would mean forking or extending PostgreSQL and MySQL and SQL Server and Oracle and Snowflake and whatever the customer already runs, each with its own extension model, its own certification, its own migration and regression testing. Those forks never get adopted. A hyperscaler will not run your custom C extension on its managed fleet, and an on-prem DBA will not certify a new one into a database that's already under change control. The per-engine extension strategy dies on adoption alone.
3. A Postgres-only extension limits deployment to the corner you control. Native extensions (C, pgrx) require superuser and installation rights: you get them on self-hosted Postgres only. On managed Postgres (RDS, Aurora, Cloud SQL, Azure), you cannot install arbitrary extensions; you get an allowlist, and at best pg_tle, which sandboxes trusted-language extensions with no native code. So a Postgres extension reaches self-hosted installs, plus a sandboxed subset of managed ones. That is a small fraction of where customers actually run their data.
Put those together and the conclusion writes itself. The whole value proposition of the runtime is reproducible everywhere. An extension is reproducible almost nowhere it needs to be. So we kept the deterministic kernels inside rAIls, where a single Helm chart deploys them onto any Kubernetes, pointed at managed or self-hosted Postgres, swapping the storage substrate underneath without touching a line of decision logic. We did not split the runtime into a database-extension layer.
Where the line landed
- Runtime: the deterministic execution kernel and the orchestration/governance semantics, portable across any substrate.
- PostgreSQL: the authoritative artifact and transaction store (managed or self-hosted; swappable).
- Object storage: immutable datasets and binaries.
- Search / RAG indexes: derived, rebuildable projections.
- Telemetry: expendable operational data.
The deterministic-core-as-Postgres path remains, deferred and optional. For a specific self-managed or pg_tle-friendly deployment, the golden fixtures mean we can drop a Postgres implementation in as a fourth conforming backend without changing the contract. But it's a deployment option for one substrate, a choice within the product.
The result
The interesting outcome is that deterministic AI execution converges on database architecture, and then you have to be disciplined about the line, beyond "AI with a database," and "a new AI database". Storage disciplines were already solved, so they belong to the database. Decision and governance semantics are the new, hard part, so they belong to a runtime that isn't welded to any one engine.
We didn't ship a Postgres extension for the same reason we didn't build a new database: the value is being deployable everywhere your data already lives, and an extension is deployable almost nowhere that counts.