feat(core): add sqlite long-term memory persistence with teach, recall, and learn - #48498
feat(core): add sqlite long-term memory persistence with teach, recall, and learn#48498prethiv wants to merge 5 commits into
Conversation
|
The following comment was made by an LLM, it may be inaccurate: Found 2 potentially related PRs (excluding the current PR #48498):
These PRs may be addressing similar memory persistence and learning features. Check if they're already closed/merged or if there's overlap in implementation. |
Summary of Review FixesAll review comments have been resolved across core, tool, and TUI packages:
|
|
Manual tested with the latest file system and fallback copilot review fixes. |



Issue for this PR
Closes #48497
Type of change
What does this PR do?
Implements an SQLite-backed long-term persistence memory system for OpenCode:
Storage Engine (
packages/core/src/memory):.dbpersistence located inGlobal.Path.data(memory.db) with WAL mode.memory_fts) with triggers for fast full-text search and BM25 ranking.teach,recall,learn,list,get, andremove.Agent Tool & Context (
packages/opencode/src/tool/memory.ts):memorytool registered inToolRegistrywith actions forteach,recall,learn,list, anddelete.CLI & Slash Commands (
packages/opencode):opencode memory [teach|recall|learn|list|delete]with top-level aliases (opencode teach,opencode recall,opencode learn,opencode memory)./teach,/recall,/learn, and/memory.TUI Explorer Dialog (
packages/tui/src/component/dialog-memory.tsx):/memoryand command paletteprompt.memory.How did you verify your code works?
bun test test/memory.test.tsinpackages/core(2/2 passing).bun test test/tool/memory.test.tsinpackages/opencode(1/1 passing).bun turbo typecheckacross all 36 workspace packages (30/30 passed).bun dev teach "Always use bun test for tests" --category "convention"bun dev recall "bun test"(verified FTS5 match returned)bun dev memory list(verified stored items listed)bun dev learn "Insight text" --title "Test Insight"Screenshots / recordings
Attached a screenshot or terminal recording of the
/memoryTUI dialog and CLI output._Checklist