Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 12 additions & 28 deletions apps/docs/integrations/opencode.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -62,33 +62,17 @@ Or set an API key manually from the [API Keys](https://console.supermemory.ai/ke
</Tab>
</Tabs>

OpenCode V1 and OpenCode 2 read different keys from `~/.config/opencode/opencode.jsonc`. Use the config for the version you run:
The installer adds Supermemory to `~/.config/opencode/opencode.jsonc`. This one config works on both OpenCode v1 and v2:

<Tabs>
<Tab title="OpenCode V1">
```jsonc
{
"plugin": ["opencode-supermemory@latest"]
}
```
</Tab>
<Tab title="OpenCode 2">
```jsonc
{
"plugins": ["opencode-supermemory"],
"permissions": [
{ "action": "supermemory_recall", "resource": "*", "effect": "allow" }
]
}
```

The `permissions` rule lets the read-only `supermemory_recall` tool run without prompting.
</Tab>
</Tabs>
```jsonc
{
"plugin": ["opencode-supermemory@latest"],
"plugins": ["opencode-supermemory"],
"permission": { "supermemory_recall": "allow" }
}
```

<Warning>
The installer writes all three keys (`plugin`, `plugins`, and `permissions`) so that one file covers both versions. OpenCode V1 refuses to start when the file has a top-level `permissions` field ("V2 permissions are not supported by OpenCode V1"), so V1 users must remove `permissions` after installing. V1 ignores `plugins` with a warning, so you can remove it too.
</Warning>
If OpenCode won't start after an older install, run the installer again to update your config.

## How it works

Expand All @@ -98,7 +82,7 @@ Once installed, the plugin runs automatically:
- **Direct Recall** — On every substantive prompt, the plugin searches the current project and injects up to five fresh matches. Set `recallMode` to `"advisory"` to let the agent decide when to search, or `"off"` to disable it.
- **Automatic Capture** — Completed turns are saved every `captureEveryNTurns` turns (fresh installs use `0`, which saves only at the end), and any remainder is flushed when the session ends or OpenCode shuts down.
- **Keyword Detection** — Phrases like "remember" or "save this" nudge the agent to save to memory.
- **Smart Compaction** — On OpenCode V1, sessions are summarized at 80% context capacity; on OpenCode 2, the plugin enriches native compaction. Both save the summary as a memory.
- **Smart Compaction** — On OpenCode v1, sessions are summarized at 80% context capacity; on OpenCode v2, the plugin enriches native compaction. Both save the summary as a memory.
- **Privacy Protection** — Content within `<private>` tags never persists.

### Memory scopes
Expand Down Expand Up @@ -162,8 +146,8 @@ Create `~/.config/opencode/supermemory.jsonc`:
"keywordPatterns": ["log\\s+this"], // Extra auto-save triggers
"recallMode": "direct", // "direct", "advisory", or "off"
"captureEveryNTurns": 3, // Save completed turns every N turns (0 = session end only)
"compactionThreshold": 0.80, // OpenCode V1: context usage ratio for summarization
"compactionEnabled": true // OpenCode 2: enrich native compaction and save summaries
"compactionThreshold": 0.80, // OpenCode v1: context usage ratio for summarization
"compactionEnabled": true // OpenCode v2: enrich native compaction and save summaries
}
```

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/snippets/api-v5-overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ URL values are positional (`namespace` first, then `id` where there is one); eve

### Connectors

Connector routes also move under the namespace. Legacy `containerTags` arrays become one namespace per connector.
Connector routes also move under the namespace. Legacy `containerTags` arrays become one namespace per connector. Connectors created without container tags belong to `sm_project_default`, where their syncs already write documents.

| Legacy | v5 | SDK method |
| --- | --- | --- |
Expand Down
Loading