Get Your API Key
Create a Supermemory API key from the API Keys page, then add it to your shell profile so it persists across sessions:- macOS / Linux (zsh)
- macOS / Linux (bash)
- Windows (PowerShell)
Install the Plugin
~/.config/opencode/opencode.jsonc contains:
How It Works
Once installed, the plugin runs automatically:- Context Injection — On session start, relevant memories are fetched and injected into the agent’s context. This includes user preferences, project knowledge, and past interactions.
- Keyword Detection — Phrases like “remember” or “save this” trigger automatic storage.
- Smart Compaction — At 80% context capacity, sessions are summarized and saved as memories.
- Privacy Protection — Content within
<private>tags never persists.
Memory Scopes
| Scope | Description |
|---|---|
user | Memories that persist across all projects |
project | Memories isolated to the current project (default) |
Memory Types
| Type | Description |
|---|---|
project-config | Project configuration and setup details |
architecture | Codebase structure and design patterns |
error-solution | Problems encountered and their fixes |
preference | User preferences and coding style |
learned-pattern | Patterns discovered during sessions |
conversation | Important conversation context |
Commands
/supermemory-init
Explore and index your codebase structure into memory:Tools
The agent has access to asupermemory tool with these modes:
| Mode | Parameters | Function |
|---|---|---|
add | content, type?, scope? | Store information |
search | query, scope? | Find relevant memories |
profile | query? | View user preferences |
list | scope?, limit? | Display stored items |
forget | memoryId, scope? | Remove memory |
Configuration
Create~/.config/opencode/supermemory.jsonc:

