Bitrip007
New Contributor II

Since you're using LangGraph on Databricks Classic Compute, you don't have Agent Bricks or Managed Agent Memory. I would build the memory layer directly on Delta Lake + Unity Catalog. This gives you full control, is scalable, auditable, and integrates naturally with Databricks.

In fact, the architecture is almost identical to how Databricks' newer self-managed memory works internally, except they use Lakebase/Postgres instead of Delta. The underlying concepts—thread memory, semantic memory, episodic memory, and memory consolidation—are the same.

I recommend never writing directly to long-term memory from every node. Instead, add a dedicated Memory Consolidation Node at the end of the graph.

Memory Layers

Instead of a single table, split memory into specialized Delta tables.

catalog.agent_memory

conversations
episodic_memory
semantic_memory
user_profile
memory_embeddings

1. Short-Term Memory (Conversation State)

Short-term memory should only exist during the current conversation and should be managed by LangGraph State/Checkpointing.

It should contain:

  • Conversation messages
  • Tool outputs
  • SQL query results
  • API responses
  • Intermediate reasoning
  • Planner outputs
  • Scratchpad/context

This memory is automatically passed between LangGraph nodes.

3. Semantic Memory (Long-Term Facts & Preferences)

This is the most important long-term memory.

Store only durable knowledge about the user.

Examples

  • User prefers SQL over explanations
  • User prefers charts over tables
  • User works with Databricks
  • User works in Retail Analytics
  • User prefers concise responses
  • User timezone is IST

Recommended Four-Layer Memory Model

For a production-grade implementation, I recommend extending beyond just short-term and long-term memory into four complementary memory types:

Memory Type Purpose Storage
Working MemoryCurrent conversation, intermediate reasoning, tool outputsLangGraph State / Checkpoint
Semantic MemoryUser preferences, permanent facts, profileDelta Lake + Vector Search
Episodic MemorySummarized past sessions, important experiencesDelta Lake
Procedural MemoryReusable workflows, SQL templates, preferred tool sequences, successful reasoning patternsDelta Lake (versioned)

This design closely aligns with Databricks' self-managed memory concepts while remaining fully compatible with LangGraph running on Databricks Classic Compute.

 

Reference Links: