@@ -12,13 +12,14 @@ Your agent remembers what you tell it - across sessions, across projects.
1212bunx opencode-supermemory@latest install
1313```
1414
15- Then get your API key from [ console .supermemory.ai] ( https://console .supermemory.ai ) and set it:
15+ Then get your API key from [ app .supermemory.ai] ( https://app .supermemory.ai/?view=integrations ) and set it:
1616
1717``` bash
1818export SUPERMEMORY_API_KEY=" sm_..."
1919```
2020
2121** Or let your agent do it** - paste this into OpenCode:
22+
2223```
2324Install opencode-supermemory by following https://raw.githubusercontent.com/supermemoryai/opencode-supermemory/main/README.md
2425```
@@ -37,6 +38,7 @@ bunx opencode-supermemory@latest install --no-tui
3738```
3839
3940This will:
41+
4042- Register the plugin in ` ~/.config/opencode/opencode.jsonc `
4143- Create the ` /supermemory-init ` command
4244
@@ -47,6 +49,7 @@ cat ~/.config/opencode/opencode.jsonc
4749```
4850
4951Should contain:
52+
5053``` json
5154{
5255 "plugin" : [" opencode-supermemory" ]
@@ -56,16 +59,18 @@ Should contain:
5659If not, add it manually:
5760
5861** JSONC:**
62+
5963``` jsonc
6064{
6165 " plugin" : [
62- " opencode-supermemory"
66+ " opencode-supermemory" ,
6367 // ... other plugins
64- ]
68+ ],
6569}
6670```
6771
6872** JSON:**
73+
6974``` json
7075{
7176 "plugin" : [" opencode-supermemory" ]
@@ -74,7 +79,7 @@ If not, add it manually:
7479
7580#### Step 3: Configure API key
7681
77- Ask the user to get their API key from [ console .supermemory.ai] ( https://console .supermemory.ai ) .
82+ Ask the user to get their API key from [ app .supermemory.ai] ( https://app .supermemory.ai/?view=integrations ) .
7883
7984Then set it via environment variable:
8085
@@ -86,7 +91,7 @@ Or create `~/.config/opencode/supermemory.jsonc`:
8691
8792``` jsonc
8893{
89- " apiKey" : " sm_..."
94+ " apiKey" : " sm_..." ,
9095}
9196```
9297
@@ -99,6 +104,7 @@ opencode -c
99104```
100105
101106They should see ` supermemory ` in the tools list. If not, check:
107+
1021081 . Is ` SUPERMEMORY_API_KEY ` set?
1031092 . Is the plugin in ` opencode.jsonc ` ?
1041103 . Check logs: ` tail ~/.opencode-supermemory.log `
@@ -114,11 +120,13 @@ Run `/supermemory-init` to have the agent explore and memorize the codebase.
114120### Context Injection
115121
116122On first message, the agent receives (invisible to user):
123+
117124- User profile (cross-project preferences)
118125- Project memories (all project knowledge)
119126- Relevant user memories (semantic search)
120127
121128Example of what the agent sees:
129+
122130```
123131[SUPERMEMORY]
124132
@@ -154,6 +162,7 @@ Run `/supermemory-init` to explore and memorize your codebase structure, pattern
154162### Preemptive Compaction
155163
156164When context hits 80% capacity:
165+
1571661 . Triggers OpenCode's summarization
1581672 . Injects project memories into summary context
1591683 . Saves session summary as a memory
@@ -172,23 +181,23 @@ Content in `<private>` tags is never stored.
172181
173182The ` supermemory ` tool is available to the agent:
174183
175- | Mode | Args | Description |
176- | ------| ------| -------------|
177- | ` add ` | ` content ` , ` type? ` , ` scope? ` | Store memory |
178- | ` search ` | ` query ` , ` scope? ` | Search memories |
179- | ` profile ` | ` query? ` | View user profile |
180- | ` list ` | ` scope? ` , ` limit? ` | List memories |
181- | ` forget ` | ` memoryId ` , ` scope? ` | Delete memory |
184+ | Mode | Args | Description |
185+ | --------- | ---------------------------- | ----------------- |
186+ | ` add ` | ` content ` , ` type? ` , ` scope? ` | Store memory |
187+ | ` search ` | ` query ` , ` scope? ` | Search memories |
188+ | ` profile ` | ` query? ` | View user profile |
189+ | ` list ` | ` scope? ` , ` limit? ` | List memories |
190+ | ` forget ` | ` memoryId ` , ` scope? ` | Delete memory |
182191
183192** Scopes:** ` user ` (cross-project), ` project ` (default)
184193
185194** Types:** ` project-config ` , ` architecture ` , ` error-solution ` , ` preference ` , ` learned-pattern ` , ` conversation `
186195
187196## Memory Scoping
188197
189- | Scope | Tag | Persists |
190- | -------| -----| ----------|
191- | User | ` opencode_user_{sha256(git email)} ` | All projects |
198+ | Scope | Tag | Persists |
199+ | ------- | -------------------------------------- | ------------ |
200+ | User | ` opencode_user_{sha256(git email)} ` | All projects |
192201| Project | ` opencode_project_{sha256(directory)} ` | This project |
193202
194203## Configuration
@@ -228,7 +237,7 @@ Create `~/.config/opencode/supermemory.jsonc`:
228237 " keywordPatterns" : [" log\\ s+this" , " write\\ s+down" ],
229238
230239 // Context usage ratio that triggers compaction (0-1)
231- " compactionThreshold" : 0.80
240+ " compactionThreshold" : 0.8 ,
232241}
233242```
234243
@@ -237,6 +246,7 @@ All fields optional. Env var `SUPERMEMORY_API_KEY` takes precedence over config
237246### Container Tag Selection
238247
239248By default, container tags are auto-generated using ` containerTagPrefix ` plus a hash:
249+
240250- User tag: ` {prefix}_user_{hash(git_email)} `
241251- Project tag: ` {prefix}_project_{hash(directory)} `
242252
@@ -248,11 +258,12 @@ You can override this by specifying exact container tags:
248258 " userContainerTag" : " my-team-workspace" ,
249259
250260 // Use a specific container tag for project memories
251- " projectContainerTag" : " my-awesome-project"
261+ " projectContainerTag" : " my-awesome-project" ,
252262}
253263```
254264
255265This is useful when you want to:
266+
256267- Share memories across team members (same ` userContainerTag ` )
257268- Sync memories between different machines for the same project
258269- Organize memories using your own naming scheme
@@ -282,7 +293,7 @@ Local install:
282293
283294``` jsonc
284295{
285- " plugin" : [" file:///path/to/opencode-supermemory" ]
296+ " plugin" : [" file:///path/to/opencode-supermemory" ],
286297}
287298```
288299
0 commit comments