Skip to content

Commit 917db02

Browse files
authored
Migrate from Clawdbot to OpenClaw (#5)
### Migrate plugin from Clawdbot to OpenClaw following the upstream rename. - Updated peer dependency from `clawdbot >=2026.1.24` to `openclaw >=2026.1.29` - Changed plugin ID to `openclaw-supermemory` - Updated all imports from `clawdbot/plugin-sdk` to `openclaw/plugin-sdk` - Renamed env var from `SUPERMEMORY_CLAWDBOT_API_KEY` to `SUPERMEMORY_OPENCLAW_API_KEY`
2 parents 574b7ed + ce9eac4 commit 917db02

File tree

14 files changed

+57
-57
lines changed

14 files changed

+57
-57
lines changed

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
# Supermemory Plugin for Clawdbot
1+
# Supermemory Plugin for OpenClaw (previously Clawdbot)
22

33
<img width="1200" height="628" alt="Announcement-3 (2)" src="https://github.com/user-attachments/assets/caa5acaa-8246-4172-af3a-9cfed2a452c1" />
44

55

66

7-
Long-term memory for Clawdbot. Automatically remembers conversations, recalls relevant context, and builds a persistent user profile — all powered by [Supermemory](https://supermemory.ai) cloud. No local infrastructure required.
7+
Long-term memory for OpenClaw. Automatically remembers conversations, recalls relevant context, and builds a persistent user profile — all powered by [Supermemory](https://supermemory.ai) cloud. No local infrastructure required.
88

99
## Install
1010

1111
```bash
12-
clawdbot plugins install @supermemoryai/clawdbot-supermemory
12+
openclaw plugins install @supermemory/openclaw-supermemory
1313
```
1414

15-
Restart Clawdbot after installing.
15+
Restart OpenClaw after installing.
1616

1717
## Configuration
1818

@@ -21,19 +21,19 @@ The only required value is your Supermemory API key. Get one at [console.superme
2121
Set it as an environment variable:
2222

2323
```bash
24-
export SUPERMEMORY_CLAWDBOT_API_KEY="sm_..."
24+
export SUPERMEMORY_OPENCLAW_API_KEY="sm_..."
2525
```
2626

27-
Or configure it directly in `clawdbot.json`:
27+
Or configure it directly in `openclaw.json`:
2828

2929
```json5
3030
{
3131
"plugins": {
3232
"entries": {
33-
"clawdbot-supermemory": {
33+
"openclaw-supermemory": {
3434
"enabled": true,
3535
"config": {
36-
"apiKey": "${SUPERMEMORY_CLAWDBOT_API_KEY}"
36+
"apiKey": "${SUPERMEMORY_OPENCLAW_API_KEY}"
3737
}
3838
}
3939
}
@@ -45,7 +45,7 @@ Or configure it directly in `clawdbot.json`:
4545

4646
| Key | Type | Default | Description |
4747
|-----|------|---------|-------------|
48-
| `containerTag` | `string` | `clawdbot_{hostname}` | Memory namespace. All channels share this tag. |
48+
| `containerTag` | `string` | `openclaw_{hostname}` | Memory namespace. All channels share this tag. |
4949
| `autoRecall` | `boolean` | `true` | Inject relevant memories before every AI turn. |
5050
| `autoCapture` | `boolean` | `true` | Automatically store conversation content after every turn. |
5151
| `maxRecallResults` | `number` | `10` | Max memories injected into context per turn. |
@@ -83,7 +83,7 @@ The AI can use these tools autonomously during conversations:
8383
## CLI Commands
8484

8585
```bash
86-
clawdbot supermemory search <query> # Search memories
87-
clawdbot supermemory profile # View user profile
88-
clawdbot supermemory wipe # Delete all memories (destructive, requires confirmation)
86+
openclaw supermemory search <query> # Search memories
87+
openclaw supermemory profile # View user profile
88+
openclaw supermemory wipe # Delete all memories (destructive, requires confirmation)
8989
```

bun.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

commands/cli.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
import type { ClawdbotPluginApi } from "clawdbot/plugin-sdk"
1+
import type { OpenClawPluginApi } from "openclaw/plugin-sdk"
22
import type { SupermemoryClient } from "../client.ts"
33
import type { SupermemoryConfig } from "../config.ts"
44
import { log } from "../logger.ts"
55

66
export function registerCli(
7-
api: ClawdbotPluginApi,
7+
api: OpenClawPluginApi,
88
client: SupermemoryClient,
99
_cfg: SupermemoryConfig,
1010
): void {
1111
api.registerCli(
12-
// biome-ignore lint/suspicious/noExplicitAny: clawdbot SDK does not ship types
12+
// biome-ignore lint/suspicious/noExplicitAny: openclaw SDK does not ship types
1313
({ program }: { program: any }) => {
1414
const cmd = program
1515
.command("supermemory")

commands/slash.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import type { ClawdbotPluginApi } from "clawdbot/plugin-sdk"
1+
import type { OpenClawPluginApi } from "openclaw/plugin-sdk"
22
import type { SupermemoryClient } from "../client.ts"
33
import type { SupermemoryConfig } from "../config.ts"
44
import { log } from "../logger.ts"
55
import { buildDocumentId, detectCategory } from "../memory.ts"
66

77
export function registerCommands(
8-
api: ClawdbotPluginApi,
8+
api: OpenClawPluginApi,
99
client: SupermemoryClient,
1010
_cfg: SupermemoryConfig,
1111
getSessionKey: () => string | undefined,
@@ -28,7 +28,7 @@ export function registerCommands(
2828
const sk = getSessionKey()
2929
await client.addMemory(
3030
text,
31-
{ type: category, source: "clawdbot_command" },
31+
{ type: category, source: "openclaw_command" },
3232
sk ? buildDocumentId(sk) : undefined,
3333
)
3434

config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ function sanitizeTag(raw: string): string {
5353
}
5454

5555
function defaultContainerTag(): string {
56-
return sanitizeTag(`clawdbot_${hostname()}`)
56+
return sanitizeTag(`openclaw_${hostname()}`)
5757
}
5858

5959
export function parseConfig(raw: unknown): SupermemoryConfig {
@@ -69,11 +69,11 @@ export function parseConfig(raw: unknown): SupermemoryConfig {
6969
const apiKey =
7070
typeof cfg.apiKey === "string" && cfg.apiKey.length > 0
7171
? resolveEnvVars(cfg.apiKey)
72-
: process.env.SUPERMEMORY_CLAWDBOT_API_KEY
72+
: process.env.SUPERMEMORY_OPENCLAW_API_KEY
7373

7474
if (!apiKey) {
7575
throw new Error(
76-
"supermemory: apiKey is required (set in plugin config or SUPERMEMORY_CLAWDBOT_API_KEY env var)",
76+
"supermemory: apiKey is required (set in plugin config or SUPERMEMORY_OPENCLAW_API_KEY env var)",
7777
)
7878
}
7979

hooks/capture.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export function buildCaptureHandler(
8989
try {
9090
await client.addMemory(
9191
content,
92-
{ source: "clawdbot", timestamp: new Date().toISOString() },
92+
{ source: "openclaw", timestamp: new Date().toISOString() },
9393
customId,
9494
)
9595
} catch (err) {

index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { ClawdbotPluginApi } from "clawdbot/plugin-sdk"
1+
import type { OpenClawPluginApi } from "openclaw/plugin-sdk"
22
import { SupermemoryClient } from "./client.ts"
33
import { registerCli } from "./commands/cli.ts"
44
import { registerCommands } from "./commands/slash.ts"
@@ -12,13 +12,13 @@ import { registerSearchTool } from "./tools/search.ts"
1212
import { registerStoreTool } from "./tools/store.ts"
1313

1414
export default {
15-
id: "clawdbot-supermemory",
15+
id: "openclaw-supermemory",
1616
name: "Supermemory",
17-
description: "Clawdbot powered by Supermemory plugin",
17+
description: "OpenClaw powered by Supermemory plugin",
1818
kind: "memory" as const,
1919
configSchema: supermemoryConfigSchema,
2020

21-
register(api: ClawdbotPluginApi) {
21+
register(api: OpenClawPluginApi) {
2222
const cfg = parseConfig(api.pluginConfig)
2323

2424
initLogger(api.logger, cfg.debug)
@@ -52,7 +52,7 @@ export default {
5252
registerCli(api, client, cfg)
5353

5454
api.registerService({
55-
id: "clawdbot-supermemory",
55+
id: "openclaw-supermemory",
5656
start: () => {
5757
api.logger.info("supermemory: connected")
5858
},
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
{
2-
"id": "clawdbot-supermemory",
2+
"id": "openclaw-supermemory",
33
"kind": "memory",
44
"uiHints": {
55
"apiKey": {
66
"label": "Supermemory API Key",
77
"sensitive": true,
88
"placeholder": "sm_...",
9-
"help": "Your API key from console.supermemory.ai (or use ${SUPERMEMORY_CLAWDBOT_API_KEY})"
9+
"help": "Your API key from console.supermemory.ai (or use ${SUPERMEMORY_OPENCLAW_API_KEY})"
1010
},
1111
"containerTag": {
1212
"label": "Container Tag",
13-
"placeholder": "clawdbot_myhostname",
14-
"help": "Memory namespace. Default: clawdbot_{hostname}. All channels share this.",
13+
"placeholder": "openclaw_myhostname",
14+
"help": "Memory namespace. Default: openclaw_{hostname}. All channels share this.",
1515
"advanced": true
1616
},
1717
"autoRecall": {

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"name": "@supermemory/clawdbot-supermemory",
3-
"version": "1.0.0",
2+
"name": "@supermemory/openclaw-supermemory",
3+
"version": "1.0.1",
44
"type": "module",
5-
"description": "Clawdbot Supermemory memory plugin",
5+
"description": "OpenClaw Supermemory memory plugin",
66
"license": "MIT",
77
"dependencies": {
88
"supermemory": "^4.0.0",
@@ -15,9 +15,9 @@
1515
"build:lib": "esbuild lib/validate.ts --bundle --minify --format=esm --platform=node --target=es2022 --external:node:crypto --outfile=lib/validate.js"
1616
},
1717
"peerDependencies": {
18-
"clawdbot": ">=2026.1.24"
18+
"openclaw": ">=2026.1.29"
1919
},
20-
"clawdbot": {
20+
"openclaw": {
2121
"extensions": [
2222
"./index.ts"
2323
]

tools/forget.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { Type } from "@sinclair/typebox"
2-
import type { ClawdbotPluginApi } from "clawdbot/plugin-sdk"
2+
import type { OpenClawPluginApi } from "openclaw/plugin-sdk"
33
import type { SupermemoryClient } from "../client.ts"
44
import type { SupermemoryConfig } from "../config.ts"
55
import { log } from "../logger.ts"
66

77
export function registerForgetTool(
8-
api: ClawdbotPluginApi,
8+
api: OpenClawPluginApi,
99
client: SupermemoryClient,
1010
_cfg: SupermemoryConfig,
1111
): void {

0 commit comments

Comments
 (0)