-
Notifications
You must be signed in to change notification settings - Fork 14.5k
[FEATURE]: Native auto-memory for cross-session learning #20322
Copy link
Copy link
Open
Labels
coreAnything pertaining to core functionality of the application (opencode server stuff)Anything pertaining to core functionality of the application (opencode server stuff)
Description
Verification
- I searched existing issues and found related proposals: [FEATURE] Persistent Session Memory #16077, Feature Request: Model-Agnostic Memory Layer (Global & Per-Project) #8043, [FEATURE]: Advanced Dual-Scope Memory System for OpenCode #9211
- This issue adds a specific, focused implementation approach not covered in those
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
coreAnything pertaining to core functionality of the application (opencode server stuff)Anything pertaining to core functionality of the application (opencode server stuff)