You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Lakebase-backed persistent memory for CODA sessions #14
At session end, a Stop hook extracts 3–8 structured memories from the Claude transcript via the Databricks Claude Haiku serving endpoint, persists them to a coda_memories Postgres table, and regenerates coda_memory.md so the next session opens with the accumulated context already loaded.
Components
memory/extractor.py — Stop hook: parses the JSONL transcript, calls Haiku, writes to Lakebase, regenerates the local memory file.
memory/store.py — psycopg 3 + psycopg_pool with an OAuthConnection subclass that mints a fresh Lakebase OAuth credential on every pool recycle (45 min, ahead of the 1h token expiry). Follows the canonical Databricks Apps + Lakebase Autoscaling pattern.
memory/injector.py — Regenerates ~/.claude/memory/coda_memory.md (or project-scoped variant) from Lakebase.
memory/searcher.py — FTS-ranked search CLI used by the memory-recall subagent.
memory/hooks/user_prompt_submit.py — Zero-cost nudge so Claude knows to invoke the subagent when historical context would help.
coda_memories: content_hash UNIQUE for dedup, content_tsv generated column + GIN index for FTS, nullable vector(1536) + HNSW (kept off by default — semantic search comes later).
Branch
feat/lakebase-memory — about to be pushed.
Diff scope
+6581 / -10, 36 files. Tests in tests/test_memory_*.py.
Follow-ups
Embedding ingestion + MMR retrieval (vector column is in place, query side isn't yet).
Activity