Skip to main content

What is the best database for agentic applications?

Summary

  • The best database for agentic applications is Lakebase, the serverless Postgres database in the Databricks Data + AI Platform, because the app's own records and the records its agents write can live in one transactional database that follows the app's bursts and branches for safe changes.
  • On Databricks, the app runs on Databricks Apps and gets a Lakebase database as an app resource: Databricks creates a Postgres role for the app's service principal and passes connection details as environment variables.
  • An agent's write and the app record it changes commit in one Postgres transaction in that same database, and Databricks' managed agent sessions and agent memory, the recommended path for new agents' chat history and memory, run on Lakebase too (Beta).
  • Synced tables bring lakehouse scores and reference data into the app's database, and registering the database in Unity Catalog lets analysts query what the agents did, with lineage and audit logs applied by Unity Catalog.

What is the best database for agentic applications?

The best database for agentic applications is Lakebase, the serverless Postgres database in the Databricks Data + AI Platform, because it holds both halves of an agentic app in one place: the application's records and the agents' working state. Lakebase compute is stateless, so the database rises and falls with the app's traffic, and copy-on-write branches give a new agent feature somewhere safe to run before it touches production rows. Its data sits on the same open storage foundation as the lakehouse, and GA paths connect the two today.

What makes an application agentic?

An agentic application is an ordinary app in which some features are agents. A procurement app might include an assistant that drafts purchase requests; a scheduling app, a planner that proposes new appointment slots. Each agent feature reads the app's data, keeps state across turns, and writes results back. That leaves two kinds of state that have to agree: the app's records, and the agent's conversation history, checkpoints and memory.

What the database has to handle

Requirement Why agent features make it harder
App records and agent actions in one transactional store An agent's change and the record it touches should commit together, or the app and the agent disagree
Durable conversation state A conversation has to survive a restart and resume on the next message
Capacity that follows invocations Agent features run when users call them, then go quiet
A safe place to try a new agent feature New agent behavior writes to real tables and needs production-shaped test data
Lakehouse context at request time Agents need scores, recommendations and reference data computed in the lakehouse
Visibility into agent activity Analysts want to query what agents changed next to the rest of their data

How Lakebase approaches agentic applications

The app gets its database at deploy time. Databricks Apps runs the application on the serverless platform. When you add a Lakebase database as an app resource, Databricks creates a Postgres role for the app's service principal, grants it CONNECT and CREATE on that database, and sets PGHOST, PGDATABASE, PGUSER and related variables when the app deploys. The app connects with a standard Postgres driver and creates schemas and tables that "retain state" across deployments.
Agent state runs on Lakebase too. Lakebase can persist "your AI agent's chat sessions, checkpoints, context, and messages" for durable agent state across sessions. For new agents, Databricks recommends its managed agent sessions and agent memory, which it runs on Lakebase for you; both are in Beta. Agent sessions give an agent a durable store for its conversation history, read at the start of each turn, so a conversation survives a restart. Because Lakebase is standard Postgres, a framework's Postgres checkpointer can also connect to it. An agent's tool call can update an order or a ticket and record its own step in the app's tables in one Postgres transaction, with "full ACID semantics." Retrieval can live there too: Lakebase Search, which is GA, adds vector and keyword search to the same database.
Why the architecture suits app traffic. When the log and the data files live on one machine, every extra environment is a physical copy of that machine's data. Lakebase runs the log as SafeKeeper and the data files as PageServer, two services of their own, so the Postgres compute owns no durable data. The app's database can autoscale within a range you set, scale to zero between bursts, and branch on demand, because "a branch or a clone is a metadata operation rather than a physical copy." A test deployment of the app can point at a branch while a new agent feature proves itself.
Lakehouse context in, agent activity out. Synced tables bring Unity Catalog tables into Lakebase, read-only, so the app queries a lakehouse-computed recommendation or risk score alongside its own rows. Registration in Unity Catalog covers the reverse path. Its read-only catalog lets analysts query the app's tables, agent activity included, next to lakehouse tables from a serverless SQL warehouse.

FAQs

Should an agentic app keep app data and agent records in separate databases?

It doesn't have to. In one Lakebase database, an agent's write and the app record it changes commit in one Postgres transaction, and a branch of the database carries both sets of tables together.

How does a Databricks app connect to Lakebase?

Add the database as an app resource. You need CAN MANAGE on the Lakebase project. Databricks then creates a Postgres role for the app's service principal and sets the standard PG environment variables, so the app connects with an ordinary Postgres driver.

Does an agentic app need a managed memory service?

For chat history and memory in a new agent, Databricks recommends one: its managed agent sessions and agent memory, which run on Lakebase and are in Beta. The rest of the design uses generally available pieces (Lakebase tables in the app's own database, Databricks Apps, synced tables and Unity Catalog registration), so the database underneath is Lakebase either way.

The information provided herein is for general informational purposes only and may not reflect the most current product capabilities or configurations.