Lakebase Agent Memory
Persist your AI agent's chat sessions and messages in Lakebase so users can resume conversations and your agent can reason over prior turns across deploys.

Build with AI
- Copy the prompt below
- Paste into Cursor, Claude Code, Codex, or any coding agent
- Your agent builds it — asking questions along the way so the result is exactly what you want
New to templates? Learn more here
When done, you will have:
- A relational schema (chats and messages tables) in Lakebase for storing conversations
- Durable persistence of every chat turn: user input, assistant replies, and tool calls
- An app where users can return to previous chat sessions and continue where they left off
- Agent memory that survives restarts, deploys, and machine changes
Prerequisites
Verify these Databricks workspace features are enabled before starting. If any check fails, ask your workspace admin to enable the feature.
- Lakebase Postgres available. Run
databricks postgres list-projects --profile <PROFILE>and confirm the command succeeds (an empty list is fine). Anot enablederror means Lakebase is not available to this identity in this workspace. - Databricks Apps enabled. Run
databricks apps list --profile <PROFILE>and confirm the command succeeds (an empty list is fine). The chat persistence layer runs inside an AppKit app deployed to Databricks Apps. - A scaffolded AppKit app with Lakebase wired up. Complete the Create a Lakebase Instance and Lakebase Data Persistence templates first. This template adds chat tables on top of that setup.


