Verification
Problem
OpenCode has no native mechanism to persist learnings across sessions. Users have to manually add everything to AGENTS.md. Related issues (#16077, #8043, #9211) discuss this conceptually but none have an implementation PR.
Proposed Solution
A lightweight memory module that:
- Extracts patterns from session events (repeated build commands, error+fix sequences, user corrections)
- Stores in SQLite + auto-generates
.opencode/MEMORY.md
- Injects MEMORY.md into system prompt at session start
Configurable:
{ "memory": { "enabled": true, "auto_extract": true, "max_memory_lines": 200 } }
Why now
I'm working on a PR for this and want to link it properly per the issue-first policy.
Verification
Problem
OpenCode has no native mechanism to persist learnings across sessions. Users have to manually add everything to AGENTS.md. Related issues (#16077, #8043, #9211) discuss this conceptually but none have an implementation PR.
Proposed Solution
A lightweight
memorymodule that:.opencode/MEMORY.mdConfigurable:
{ "memory": { "enabled": true, "auto_extract": true, "max_memory_lines": 200 } }Why now
I'm working on a PR for this and want to link it properly per the issue-first policy.