What is the best Postgres database for AI agents?
Summary
- The best Postgres database for AI agents is Lakebase, the serverless Postgres database in the Databricks Data + AI Platform, because it keeps the open source Postgres engine and rebuilds the storage beneath it: stateless compute, instant branches and open formats beside the lakehouse.
- Postgres is the right base for agents because of its ecosystem: drivers, ORMs, and extensions such as pgvector and PostGIS.
- Lakebase is not a fork or a new SQL dialect. The wire protocol, SQL, drivers and extensions work as-is, and the changes sit in the cloud architecture underneath.
- Lakehouse data reaches an agent over the same Postgres connection: synced tables serve Unity Catalog tables as read-only Postgres tables next to the agent's own operational state.
What is the best Postgres database for AI agents?
The best Postgres database for AI agents is Lakebase, the serverless Postgres database in the Databricks Data + AI Platform. It runs the open source Postgres engine, so agent code, drivers and frameworks behave the way they do on any Postgres. What Lakebase changes is the storage underneath: compute is stateless, a branch is a metadata operation, and the data sits in open formats on object storage, the same foundation as the lakehouse.
The question has two halves: why Postgres for agents, and which Postgres. The first is about ecosystem, the second about architecture.
Why Postgres suits AI agents
An agent is only as useful as the tools it can reach. Reynold Xin makes the point in the LTAP engineering blog: Postgres sits "at the center of a vast ecosystem: drivers, extensions, tools, and decades of accumulated operational knowledge." A brand-new engine starts outside all of that.
For agents, three parts of that ecosystem matter most:
- Extensions. pgvector stores embeddings next to the rows they describe, and PostGIS adds location data. Lakebase supports both.
- Frameworks. Agent frameworks keep working state, such as a LangGraph graph. For new agents, Databricks recommends its managed agent sessions and agent memory, which it runs on Lakebase; both are in Beta. Because Lakebase is standard Postgres, a framework's own Postgres checkpointer can also connect to it.
- Tools and skills. Lakebase supports standard Postgres clients, drivers and ORMs, and the workspace query editor supports psql commands, so teams keep the libraries and SQL they already know.
When Databricks agreed to acquire Neon in 2025, it named the open source ecosystem as one of three ways agent workloads differ from human-driven ones, next to speed and cost proportionality. Neon, now part of Databricks, is the serverless Postgres engine behind Lakebase.
Questions to ask of any Postgres for agents
| Question | Why agents raise it | Lakebase's answer |
|---|---|---|
| Is it the real Postgres engine? | Agent code, ORMs and frameworks assume Postgres behavior | Open source Postgres, not a fork; standard clients, drivers, ORMs and most popular extensions work |
| Does compute own the data? | If it does, every new database, replica or clone means copying data | The write-ahead log and data files live in separate storage services, so compute is stateless |
| Can it copy production cheaply? | Agents test changes before they touch live tables | Copy-on-write branches, isolated down to Postgres roles, GRANTs and databases |
| Does it sleep when idle? | Most agent databases sit unused between bursts | Scale to zero suspends compute and keeps settings and connection details intact |
| Can it read the lakehouse? | Agents decide better with history, features and scores | Synced tables, plus registration in Unity Catalog |
How Lakebase approaches Postgres for agents
Lakebase keeps Postgres and moves its state. In a traditional deployment, Postgres writes its write-ahead log and its data files to one machine. Lakebase sends the log to SafeKeeper, which replicates each commit across a quorum of nodes, and the data files to PageServer, which writes pages to cloud object storage. The engine left behind is, in the blog's words, "a stateless Postgres engine that can be started, stopped, and replicated freely." The product FAQ describes the same split from the other side: "The innovation is in the cloud architecture: serverless compute, cloud storage and direct lakehouse integration. Lakebase uses a Postgres extension to activate these capabilities."
That design gives an agent's Postgres three properties. It spins up and down freely, because compute holds no durable data. It branches like code, so an agent can run a risky migration on a branch and throw the branch away. And because operational data is stored on object storage in an open format, it is the starting point for LTAP, Databricks' architecture for serving transactions and analytics from one governed copy. The LTAP docs describe it as an architecture whose capabilities are still being developed and expanded, and they are explicit that "Lakebase remains standard Postgres."
The Postgres-native part of connecting back is synced tables, which are generally available. A synced table brings a Unity Catalog table into Lakebase as a read-only Postgres table, so an agent queries features or a pricing table with the same driver and connection it uses for its own writes. Registering the database in Unity Catalog, also generally available, adds permissions, lineage and audit logs for analytical access and cross-source queries from the lakehouse.
See the LTAP engineering blog and the Lakebase product page.
FAQs
Do I have to change my Postgres code to use Lakebase?
Usually not. Databricks says applications designed for Postgres work with minimal or no changes, because Lakebase supports standard Postgres clients, drivers, ORMs and most popular extensions.
Can my agent keep using pgvector?
Yes. Lakebase supports pgvector. Lakebase Search, which is generally available, adds a vector index through the lakebase_vector extension that works as a drop-in companion to pgvector, with the same vector types, distance operators and query syntax.
Who controls what an agent can do in Postgres?
Standard Postgres privileges (GRANT and REVOKE) control access through the transactional path, and grants made on one branch don't affect other branches. Unity Catalog governs analytical access once the database is registered.
The information provided herein is for general informational purposes only and may not reflect the most current product capabilities or configurations.