Skip to main content

Lakebase vs MongoDB Atlas vs Redis for AI agent state and memory

Summary

  • For AI agent state and memory, pick Lakebase, the serverless Postgres database in the Databricks Data + AI Platform, because agent state, long-term memories and the business records agents act on can all live in Lakebase, connected to the lakehouse.
  • All three can store agent state: each has a LangGraph checkpointer package and vector search. The deciding question is what else that state has to do once it's written.
  • MongoDB Atlas is a fully managed document database with vector and full-text search. Redis is an in-memory data platform with configurable persistence and a two-tier Redis Agent Memory product that Redis's docs label preview.
  • On Databricks, the managed agent sessions and agent memory run on Lakebase, are in Beta, and are the recommended path for new agents. Lakebase adds copy-on-write branches, point-in-time restore, scale to zero and Unity Catalog registration.

Lakebase vs MongoDB Atlas vs Redis for AI agent state and memory

Pick Lakebase, the serverless Postgres database in the Databricks Data + AI Platform. All three can persist an agent's checkpoints and recall memories by vector search, so storage alone doesn't decide it. What decides it is everything that happens to agent state after the write: joining it with orders and accounts, rolling back a bad write, testing a new agent version against real state, and analyzing it next to lakehouse data. Lakebase does all of that in standard Postgres, on the same platform as your lakehouse, and it is the database under Databricks' managed agent sessions and agent memory (Beta).

What each database is

Lakebase is fully managed, serverless Postgres that runs the open source Postgres engine. Its compute is stateless and its data sits in a durable storage layer, which is what makes scale to zero, instant branches and fast failover possible.
MongoDB Atlas is MongoDB's fully managed cloud database service. It is built on the document model and supports multi-cloud deployments on AWS, Azure and Google Cloud.
Redis is an in-memory data platform for AI applications. Redis Search adds vector search, full-text search and indexing on JSON and hash documents, and Redis Agent Memory (preview, per Redis's docs) provides session and long-term memory for agents.

Lakebase vs MongoDB Atlas vs Redis: how they compare

Capability Lakebase MongoDB Atlas Redis
Data model Postgres tables, with json and jsonb types for flexible state Documents In-memory data; vectors and metadata stored in hashes or JSON documents
Durability Commits replicated across a quorum of SafeKeeper nodes Replica sets for redundancy and high availability; Atlas automates backups Configurable: RDB snapshots, AOF logging, both, or none
Semantic recall pgvector and Lakebase Search vector indexes Vector search on operational data Vector search with FLAT and HNSW indexes
Keyword search Lakebase Search BM25 indexes Full-text search Full-text search in Redis Search
LangGraph checkpointer langgraph-checkpoint-postgres (PostgresSaver), since Lakebase is standard Postgres langgraph-checkpoint-mongodb (MongoDBSaver) langgraph-checkpoint-redis (RedisSaver)
LangGraph long-term store PostgresStore, with optional pgvector search MongoDBStore Redis Stores, with optional vector search
How you run it Managed in the Databricks Data + AI Platform Managed cloud service on AWS, Azure and Google Cloud Redis Cloud, Redis Software on-premises, or open source

Where each layer of agent state lives

Agent state has layers with different lifetimes:

  • Session state is the conversation history and saved graph state an agent replays to continue one interaction.
  • Long-term memories are durable facts recalled by meaning or by exact term in future conversations.
  • Business records and analytics are the orders, tickets and profiles the agent reads and changes, plus the reporting and evaluation you run over what agents did.

On Databricks, the first two layers have a managed home. Databricks' managed agent sessions and agent memory run on Lakebase, are in Beta, and are the recommended path for new agents. Agent sessions can hold any state a framework persists, such as a LangGraph graph, and agent memory is recalled by semantic search. Any of the three checkpointers in the table can also hold session state; the Postgres one connects to Lakebase because Lakebase is standard Postgres.
The third layer is where Lakebase is the pick. Business records are ordinary Lakebase tables, so one transaction can update an order and log the agent's decision together, and a single query can join a customer's open tickets with their account. Register Lakebase in Unity Catalog and the same tables are queryable from the lakehouse.

How Lakebase approaches agent state and memory

Size compute to agent traffic. Lakebase scales to zero when idle and reactivates on the next query, and autoscaling works within a minimum and maximum you set. High-availability computes don't scale to zero, so use them for the production endpoint and scale-to-zero computes for development.
Branch agent state. A branch is created instantly with copy-on-write, and its size doesn't affect creation time. Test a new prompt, tool or schema against a branch of production state, then reset or discard it. Point-in-time restore recovers from an unintended deletion while the original branch keeps running.
One ranked list for recall. Lakebase Search, generally available, merges vector and BM25 matches into a single ranking inside Postgres.
Govern analytical access. Registering Lakebase in Unity Catalog creates a read-only catalog, so analytical access to the tables agents write gets Unity Catalog permissions, lineage and audit logs alongside lakehouse data. Synced tables bring lakehouse profiles, features and scores into Lakebase for agents to read at low latency. Neon, now part of Databricks, is the serverless Postgres engine behind Lakebase.

FAQs

Do Lakebase, MongoDB Atlas and Redis all work with LangGraph?

Yes. LangGraph's checkpointer integrations list langgraph-checkpoint-postgres, langgraph-checkpoint-mongodb and langgraph-checkpoint-redis. The Postgres package connects to Lakebase because Lakebase is standard Postgres.

If I pick Lakebase, where do sessions and memory go?

For a new agent, into Databricks' managed agent sessions and agent memory: both run on Lakebase, both are in Beta, and they are the recommended path for new agents. The orders, tickets and decision logs the agent writes go in your own Lakebase tables.

Can I store flexible, schema-light agent state in Lakebase?

Yes. Postgres offers json and jsonb types, so a tool result can sit in a JSON column next to typed columns you query and index.

Can I use Redis alongside Lakebase?

Yes. Lakebase is standard Postgres and works next to any store your application already uses, including Redis. Keep the records you restore, branch and analyze in Lakebase.

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