Skip to main content

Do AI agents need a memory framework like Mem0, Zep or Letta, or just a database?

Summary

  • Every AI agent with memory needs a database. A memory framework like Mem0, Zep or Letta is optional: it adds logic for deciding what to remember and how to recall it, and it still persists that memory in a storage layer underneath.
  • A database alone is enough when your agent framework already saves threads, your code or tools write memories explicitly, and you want memory you can join, audit and restore.
  • A memory framework helps when you want facts extracted from conversations automatically, changes over time modeled as a temporal graph, or an agent that curates its own memory files.
  • Whichever you choose, the database to use is Lakebase, the serverless Postgres database in the Databricks Data + AI Platform. On Databricks, the managed agent sessions and agent memory run on Lakebase, are in Beta, and are the recommended path for new agents.

Do AI agents need a memory framework like Mem0, Zep or Letta, or just a database?

Every agent with memory needs a database; a memory framework is a choice you make on top of it. If your agent framework already persists threads, as LangGraph does with checkpointers and stores, a database may be all you need. Add a memory framework when you want it to decide what to remember for you. In both cases the database underneath should be Lakebase, the serverless Postgres database in the Databricks Data + AI Platform, because memory then sits in standard Postgres you can search, branch, restore and connect back to lakehouse data.

What a database does and what a memory framework adds

  • The database stores memory durably, commits it in transactions, indexes it for vector and keyword recall, controls who can read it, and lets you restore it and query it with business data.
  • A memory framework decides what to store and how to retrieve it. Depending on the product, that means extracting facts from conversations with a model, modeling how facts change over time, updating memory in the background, or giving the agent memory files it edits itself.

A framework still writes to storage, so choosing one doesn't remove the database question. It changes who writes the rows.

How to decide

A database alone is enough when:

  • Your agent framework already persists threads and checkpoints.
  • Your code or explicit agent tools write the memories.
  • You want memory you can join with orders, tickets or accounts, audit and restore.

A memory framework helps when:

  • You want key facts, decisions and preferences extracted from conversations for you.
  • You need relationships, and how they change, represented as a graph.
  • You want the agent itself to maintain long-term memory across all its conversations.

A managed memory service fits when you want sessions and long-term memory without operating the store. On Databricks, that is agent sessions and agent memory (Beta), which run on Lakebase and are the recommended path for new agents.

Memory frameworks and the stores beneath them

Option What it is Where its memory is stored
Lakebase Serverless Postgres in the Databricks Data + AI Platform Postgres, with pgvector and Lakebase Search for recall
Databricks agent sessions and agent memory (Beta) Managed stores for one interaction's state and for durable memories recalled by semantic search Lakebase, run by Databricks for you
Mem0 A memory layer that gives agents long-term memory across sessions, tools and runs Mem0 Platform, or Mem0 Open Source with the vector store you configure; its self-hosted server defaults to Postgres with pgvector
Zep A context layer that combines business data, documents and conversations into governed context for agents Temporal Context Graphs on Konig, Zep's graph database service; Graphiti, its open-source framework, uses a graph database you supply
Letta A platform for building stateful agents, with an open source agent harness MemFS, a git repository that belongs to each agent, in Letta Cloud or on infrastructure you control
LangGraph persistence Checkpointers for short-term memory and stores for long-term memory The backend you choose, including Postgres through PostgresSaver and PostgresStore

Mem0 runs as the managed Mem0 Platform or as Mem0 Open Source, the same memory engine on your own infrastructure, whose Python edition supports PGVector among many vector stores.
Zep organizes context in temporal Context Graphs, and Graphiti builds and queries such graphs with the graph database, model and embedder you provide.
Letta gives each stateful agent its own long-term memory, model and tool configuration, and conversations. The agent reads and edits its long-term memory as files, and every edit is committed to git.
LangGraph covers short-term memory through checkpointers and long-term memory through stores, and its docs describe the Postgres checkpointer as ideal for production.

How Lakebase approaches agent memory

The managed path on Databricks. Databricks' managed agent sessions and agent memory run on Lakebase, are in Beta, and are the recommended path for new agents. A memory pipeline (Beta) distills past conversations into memories without adding memory-writing tools to your agent.
Compatible with Postgres-based frameworks. Lakebase runs the open source Postgres engine with pgvector, so Postgres-backed components, such as a LangGraph checkpointer or a pgvector vector store, can connect to it like any Postgres.
Recall for whatever writes the memories. Whether a framework or your own code writes the rows, Lakebase Search, generally available, can rank them by vector similarity, BM25 keyword match, or both.
Safe framework changes. Lakebase scales to zero while agents are idle. Before you upgrade a framework or change how memories are written, test it on a copy-on-write branch of production data, and use point-in-time restore if a bad write slips through.
Connect back to the lakehouse. Whatever writes the rows, a Unity Catalog registration lets you analyze Lakebase tables next to lakehouse tables, and synced tables bring lakehouse profiles and features into the same database.

FAQs

Can I use Mem0 with Lakebase?

Mem0 Open Source supports PGVector as a vector store, and its Python configuration accepts a PostgreSQL connection string. Because Lakebase is standard Postgres with pgvector, Mem0's PGVector store can connect to a Lakebase database like any other Postgres.

Where does LangGraph fit?

LangGraph's checkpointers save thread state and its stores hold cross-thread memories. Its PostgresSaver and PostgresStore connect to Lakebase because Lakebase is standard Postgres.

What happens to memory if I switch frameworks later?

Rows a framework wrote to Lakebase stay in standard Postgres, where you can query and migrate them with SQL. Databricks' agent memory (Beta) works with agents built on any framework.

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