lakebase-memory-patterns

Implement two-layer memory for stateful AI agents with Databricks Lakebase.

1|Updated Jan 22, 2026
One-click install
npx skills add https://github.com/prashsub/vibe_coding_lakehouse_starter_repo --skill lakebase-memory-patterns-prashsub
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: lakebase-memory-patterns
Source: https://github.com/prashsub/vibe_coding_lakehouse_starter_repo/tree/main/data_product_accelerator/skills/genai-agents/03-lakebase-memory-patterns
Command: npx skills add https://github.com/prashsub/vibe_coding_lakehouse_starter_repo --skill lakebase-memory-patterns-prashsub

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill enables stateful AI agents to maintain conversation continuity and remember user preferences across sessions by leveraging Databricks Lakebase for both short-term and long-term memory.

Core Features & Use Cases

  • Short-Term Memory: Ensures conversation continuity within a single session using CheckpointSaver for thread-based state.
  • Long-Term Memory: Stores user preferences and insights across sessions using DatabricksStore with vector embeddings for user-based persistence.
  • Graceful Degradation: Allows the agent to function even if memory tables are unavailable.
  • Thread ID Resolution: Intelligently determines the conversation thread ID from various request contexts.
  • Use Case: An AI customer support agent can remember a user's previous issues and preferences throughout a conversation and even recall them in future interactions, providing a more personalized and efficient experience.

Quick Start

Initialize the ShortTermMemory with your Lakebase instance name and use its get_checkpointer() context manager when compiling your LangGraph workflow.

Frequently Asked Questions about lakebase-memory-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add long-term memory to a stateful AI agent using Databricks?

To add long-term memory to a stateful AI agent, use DatabricksStore with vector embeddings to persist user preferences and insights across sessions. This enables continuous personalization by retrieving stored user data during future interactions.

What is the best way to maintain conversation continuity in LangGraph?

The best way to maintain conversation continuity in LangGraph is using CheckpointSaver for short-term memory. It provides thread-based state management within a single session, allowing the agent to track ongoing dialogue context effectively.

How does a two-layer memory architecture work for AI agents?

A two-layer memory architecture combines short-term thread-based state via CheckpointSaver for immediate dialogue and long-term user-based persistence via DatabricksStore. This separates active conversation continuity from durable user preference storage.

Can I use Databricks Lakebase for both short-term and long-term agent memory?

Yes, you can use Databricks Lakebase for both short-term and long-term agent memory. It supports CheckpointSaver for conversation continuity and DatabricksStore with vector embeddings for cross-session user preferences.

What happens to my stateful agent if Databricks memory tables are unavailable?

If Databricks memory tables are unavailable, your stateful agent will experience graceful degradation. This design allows the agent to continue functioning without crashing, ensuring operations remain robust even when memory persistence fails.

How do I resolve thread ID for stateful agent operations?

To resolve thread ID for stateful agent operations, the memory system intelligently determines the identifier from various request contexts. This ensures accurate state retrieval and seamless conversation tracking across different interaction environments.