@shiyuhang0/smem-openclaw
v1.0.0
Published
OpenClaw memory plugin for `smem`.
Downloads
188
Readme
smem-openclaw
OpenClaw memory plugin for smem.
Features
toolMode=trueis the default, usingmemory_searchandmemory_storeas the primary memory path.toolMode=falseswitches to hook-based recall inbefore_prompt_buildand automatic store onagent_end.memory_searchandmemory_storeare always registered in both modes.
OpenClaw Integration
- Declares
kind: "memory"and occupiesplugins.slots.memory. - Uses
registerMemoryCapability({ promptBuilder })to inject static memory guidance. - Uses
registerTool(...)to registermemory_searchandmemory_store. - Uses
api.on("before_prompt_build", ...)for automatic hook-based recall whentoolModeisfalse. - Uses
api.on("agent_end", ...)for automatic hook-based store whentoolModeisfalse.
Tools
memory_search
- Manual recall path.
- Calls
POST /api/v1/memories/recall. - Intended for prior preferences, decisions, facts, and running context.
memory_store
- Manual store path.
- Calls
POST /api/v1/memories. - Intended for cases where the user explicitly asks to save something or the model decides a stable preference/fact should be persisted.
Config
serverURL: SMEM server base URL. Default:http://localhost:8080toolMode: whentrue, use tools as the default recall/store path. Whenfalse, use hook-based automatic recall/store. Default:truetopK: recall result count. Default:5storeMode:normalorsmart. Default:smarttimeoutMs: request timeout in milliseconds. Default:8000
OpenClaw Config Example
{
"plugins": {
"enabled": true,
"slots": {
"memory": "smem-openclaw"
},
"entries": {
"smem-openclaw": {
"enabled": true,
"config": {
"serverURL": "http://localhost:8080",
"toolMode": true,
"topK": 5,
"storeMode": "smart",
"timeoutMs": 8000
}
}
}
}
}Publish And Install
Option 1: Install from npm
openclaw plugins install @shiyuhang0/smem-openclawThen enable it in OpenClaw config and assign the memory slot to smem-openclaw.
Option 2: Local install into OpenClaw
Use OpenClaw's local plugin install flow:
openclaw plugins install /absolute/path/to/smem/plugin/openclawFor development symlink mode:
openclaw plugins install -l /absolute/path/to/smem/plugin/openclawThen set:
{
"plugins": {
"slots": {
"memory": "smem-openclaw"
},
"entries": {
"smem-openclaw": {
"enabled": true
}
}
}
}Option 3: Publish to npm
- Update
package.jsonbefore publishing:- choose the final package name
- remove or set
"private": false - keep
openclaw.extensions = ["./index.ts"]
- Make sure the published package includes:
index.tsopenclaw.plugin.jsonsrc/**package.json
- Publish:
cd plugin/openclaw
npm publish- Install from npm on an OpenClaw host:
openclaw plugins install <your-package-name>- Enable it in OpenClaw config and assign the memory slot.
Runtime Requirements
- SMEM server must be running and reachable at
serverURL. - OpenClaw must load this plugin as the active
memoryslot. - Gateway restart is required after plugin/config changes.
