@nowledge/openclaw-nowledge-mem 0.6.8 → 0.6.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +40 -0
- package/CLAUDE.md +18 -8
- package/README.md +67 -15
- package/SKILL.md +245 -0
- package/openclaw.plugin.json +18 -6
- package/package.json +11 -2
- package/skills/memory-guide/SKILL.md +65 -0
- package/src/client.js +105 -73
- package/src/commands/slash.js +2 -2
- package/src/config.js +18 -1
- package/src/hooks/behavioral.js +11 -11
- package/src/hooks/capture.js +7 -2
- package/src/hooks/recall.js +147 -9
- package/src/index.js +1 -1
- package/src/spawn-env.js +19 -0
- package/src/tools/connections.js +1 -3
- package/src/tools/forget.js +2 -2
- package/src/tools/save.js +1 -1
- package/src/tools/status.js +8 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,46 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to the Nowledge Mem OpenClaw plugin will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [0.6.12] - 2026-03-15
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- **Agent behavioral skill**: the plugin now registers a `skills/memory-guide/SKILL.md` skill via the OpenClaw manifest `skills[]` array. OpenClaw auto-discovers it and presents it to the agent as an available skill. The skill teaches the agent when and how to search, save, explore connections, browse timelines, fetch past conversations, and use Working Memory. This is the single biggest change for memory recall quality: agents now receive structured guidance before their first memory interaction, rather than relying on tool descriptions alone.
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- **Behavioral guidance is now directive**: the always-on system hint now says "Before answering questions about prior work, decisions, dates, people, preferences, or plans: search with memory_search" instead of the previous "When prior context would improve your response, search." This matches the imperative pattern that LLMs follow most reliably, and explicitly notes "natural language queries, not file paths" to prevent confusion with OpenClaw's built-in file-based memory guidance.
|
|
14
|
+
|
|
15
|
+
## [0.6.11] - 2026-03-15
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
|
|
19
|
+
- **Release-cycle alignment**: the OpenClaw plugin version now tracks the main Nowledge Mem `0.6.11` release line, so the published plugin and app-facing changelog stay in sync for this release.
|
|
20
|
+
- **Agent-assisted onboarding added**: the plugin now ships with a bundled `SKILL.md` playbook so AI agents can install, configure, verify, and explain the integration without collapsing the human docs into an agent script.
|
|
21
|
+
- **Aligned command execution with OpenClaw runtime**: the plugin now runs `nmem` through OpenClaw's runtime command runner instead of importing `child_process` directly. This removes gateway-blocking synchronous process calls from the plugin surface and matches current OpenClaw plugin abstractions.
|
|
22
|
+
- **Static guidance moved into system-prompt space**: the always-on behavioral hint now uses system-context injection instead of user-prompt prepend text, matching OpenClaw's newer `prependSystemContext` / `appendSystemContext` guidance for cacheable stable instructions.
|
|
23
|
+
- **Minimum supported OpenClaw version is now `2026.3.7`**: this is the first release with the system-context fields the plugin now relies on.
|
|
24
|
+
- **Package publishing is now explicit**: npm contents are pinned through the package manifest instead of relying on `.gitignore` fallback behavior, making releases more deterministic.
|
|
25
|
+
|
|
26
|
+
### Fixed
|
|
27
|
+
|
|
28
|
+
- **Health checks now keep the JSON contract**: the internal `status` probe now uses `--json`, matching the rest of the plugin's parseable CLI surface.
|
|
29
|
+
- **Resolved config now overrides inherited `NMEM_*` values cleanly**: child-process env construction now clears inherited `NMEM_API_URL` and `NMEM_API_KEY` before applying the effective plugin config, so local mode cannot accidentally inherit a stale remote backend.
|
|
30
|
+
- **Failure logs no longer echo full CLI argv**: plugin logs now record a sanitized command label instead of raw `nmem` arguments, avoiding retention of user queries or message batches in log files.
|
|
31
|
+
- **Thread CLI flag drift**: thread search and thread fetch now use `-n`, matching the current `nmem` thread CLI surface and the plugin's own internal docs.
|
|
32
|
+
- **Install and trust docs now match current OpenClaw behavior**: the docs now explain that `openclaw plugins install` enables the plugin and selects the memory slot automatically, and they document the recommended `plugins.allow` hardening path for non-bundled plugins.
|
|
33
|
+
- **Default-mode docs no longer over-promise auto-injected context**: Working Memory and recalled memories are now described as opt-in `sessionContext` behavior, not something every default install gets automatically.
|
|
34
|
+
|
|
35
|
+
## [0.6.9] - 2026-03-05
|
|
36
|
+
|
|
37
|
+
### Fixed
|
|
38
|
+
|
|
39
|
+
- **Auto-recall searched with full prompt instead of user message**: `event.prompt` contains the entire conversation history (system prompt + all prior turns), making recalled memories irrelevant as conversation grows. Now uses a tiered query strategy: substantial messages (>=40 chars) search alone; short messages (3-39 chars, likely follow-ups like "explain that more") include the last 3 messages as context for topic grounding; tiny messages (<3 chars) skip recall. Falls back to truncated `event.prompt` (500 chars) only when `event.messages` is unavailable.
|
|
40
|
+
|
|
41
|
+
### Added
|
|
42
|
+
|
|
43
|
+
- **`recallMinScore` config option** (0-100, default 0): Minimum relevance score threshold for auto-recalled memories. Set to e.g. 30 to filter out low-confidence results. Configurable via OpenClaw Config UI, config file, or `NMEM_RECALL_MIN_SCORE` env var.
|
|
44
|
+
|
|
5
45
|
## [0.6.8] - 2026-02-27
|
|
6
46
|
|
|
7
47
|
### Changed
|
package/CLAUDE.md
CHANGED
|
@@ -7,7 +7,8 @@ Continuation guide for `community/nowledge-mem-openclaw-plugin`.
|
|
|
7
7
|
- Plugin target: OpenClaw plugin runtime (memory slot provider)
|
|
8
8
|
- Runtime: JS ESM modules under `src/`, no TS build pipeline
|
|
9
9
|
- Memory backend: `nmem` CLI (fallback: `uvx --from nmem-cli nmem`)
|
|
10
|
-
-
|
|
10
|
+
- OpenClaw minimum: `2026.3.7` (`appendSystemContext` / system-context guidance required)
|
|
11
|
+
- Architecture: **CLI-first via OpenClaw runtime** - all CLI execution goes through `api.runtime.system.runCommandWithTimeout`, not direct `child_process`
|
|
11
12
|
- Remote mode: set `NMEM_API_URL` + `NMEM_API_KEY` env vars or config file `apiUrl` + `apiKey`
|
|
12
13
|
|
|
13
14
|
## Design Philosophy
|
|
@@ -27,7 +28,8 @@ Reflects Nowledge Mem's genuine v0.6 strengths:
|
|
|
27
28
|
```
|
|
28
29
|
src/
|
|
29
30
|
index.js - plugin registration (tools, hooks, commands, CLI)
|
|
30
|
-
client.js - CLI wrapper with API fallback; credential handling
|
|
31
|
+
client.js - CLI wrapper with API fallback; async runtime command execution; credential handling
|
|
32
|
+
spawn-env.js - env-only credential injection for the nmem runner
|
|
31
33
|
config.js - config cascade: ~/.nowledge-mem/openclaw.json > pluginConfig > env vars > defaults
|
|
32
34
|
hooks/
|
|
33
35
|
behavioral.js - always-on behavioral guidance (~50 tokens/turn)
|
|
@@ -43,7 +45,10 @@ src/
|
|
|
43
45
|
forget.js - memory deletion by ID or search
|
|
44
46
|
thread-search.js - search past conversations by keyword
|
|
45
47
|
thread-fetch.js - fetch full messages from a thread with pagination
|
|
46
|
-
|
|
48
|
+
skills/
|
|
49
|
+
memory-guide/
|
|
50
|
+
SKILL.md - agent behavioral skill: when/how to search, save, explore memory (auto-discovered by OpenClaw)
|
|
51
|
+
openclaw.plugin.json - manifest + config schema (version, uiHints, configSchema, skills)
|
|
47
52
|
~/.nowledge-mem/openclaw.json - optional user config file (overrides OpenClaw settings when present)
|
|
48
53
|
```
|
|
49
54
|
|
|
@@ -62,15 +67,19 @@ openclaw.plugin.json - manifest + config schema (version, uiHints, configSchema)
|
|
|
62
67
|
|
|
63
68
|
### Thread Tools (progressive conversation retrieval)
|
|
64
69
|
- `nowledge_mem_thread_search` - search past conversations by keyword. Returns threads with matched message snippets, relevance scores, and message counts. Supports `source` filter.
|
|
65
|
-
- `nowledge_mem_thread_fetch` - fetch
|
|
70
|
+
- `nowledge_mem_thread_fetch` - fetch messages from a specific thread. Start with a small page, then use `offset` + `limit` for progressive retrieval only when more context is needed.
|
|
66
71
|
|
|
67
72
|
### Diagnostics
|
|
68
73
|
- `nowledge_mem_status` - show effective config (mode, apiUrl, apiKey set, sessionContext, sessionDigest, etc.), backend connectivity, and version. No parameters.
|
|
69
74
|
|
|
75
|
+
## Skill Surface
|
|
76
|
+
|
|
77
|
+
- `skills/memory-guide/SKILL.md` - agent behavioral skill auto-discovered by OpenClaw via manifest `skills[]`. Teaches the agent when/how to search, save, explore connections, fetch threads, and use Working Memory. Read on-demand when the agent identifies a memory-related task.
|
|
78
|
+
|
|
70
79
|
## Hook Surface
|
|
71
80
|
|
|
72
|
-
- `before_prompt_build` (always-on) - behavioral guidance
|
|
73
|
-
- `before_prompt_build` (sessionContext) - session context: Working Memory + `searchRich()` with `relevanceReason`
|
|
81
|
+
- `before_prompt_build` (always-on) - directive behavioral guidance in system-prompt space: tells agent to search before answering questions about prior work/decisions/preferences, and to save decisions/learnings proactively. Explicitly notes semantic search (not file paths) to counter OpenClaw's hardcoded memory section. Adjusts when sessionContext is on to avoid redundant searches.
|
|
82
|
+
- `before_prompt_build` (sessionContext) - session context: Working Memory + `searchRich()` memories with `relevanceReason`. Note: does NOT inject thread snippets — threads are available via `memory_search` tool and `nowledge_mem_thread_fetch`.
|
|
74
83
|
- `agent_end` - thread capture + LLM triage/distillation (requires `sessionDigest: true`)
|
|
75
84
|
- `after_compaction` - thread append
|
|
76
85
|
- `before_reset` - thread append
|
|
@@ -91,6 +100,7 @@ Optional config file at `~/.nowledge-mem/openclaw.json`. Falls through to OpenCl
|
|
|
91
100
|
| `sessionDigest` | boolean | `true` | `NMEM_SESSION_DIGEST` | Thread capture + LLM distillation at session end |
|
|
92
101
|
| `digestMinInterval` | integer 0-86400 | `300` | `NMEM_DIGEST_MIN_INTERVAL` | Minimum seconds between session digests |
|
|
93
102
|
| `maxContextResults` | integer 1-20 | `5` | `NMEM_MAX_CONTEXT_RESULTS` | How many memories to inject at prompt time |
|
|
103
|
+
| `recallMinScore` | integer 0-100 | `0` | `NMEM_RECALL_MIN_SCORE` | Min relevance score (%) to include in auto-recall |
|
|
94
104
|
| `apiUrl` | string | `""` | `NMEM_API_URL` | Remote server URL. Empty = local (127.0.0.1:14242) |
|
|
95
105
|
| `apiKey` | string | `""` | `NMEM_API_KEY` | API key. Never logged. |
|
|
96
106
|
|
|
@@ -120,8 +130,8 @@ Legacy aliases accepted silently in all sources for backward compat:
|
|
|
120
130
|
| `nmem --json wm patch --heading "## S" --content/--append` | `client.patchWorkingMemory()` | Section-level WM update |
|
|
121
131
|
| `nmem --json m delete <id>` | `client.execJson()` in forget.js | Delete |
|
|
122
132
|
| `GET /threads/search?query=&limit=` | `client.searchThreads()` | Thread search enrichment (best-effort, API-only) |
|
|
123
|
-
| `nmem --json t search <q>
|
|
124
|
-
| `nmem --json t show <id>
|
|
133
|
+
| `nmem --json t search <q> -n N` | `client.searchThreadsFull()` | Full thread search (CLI-first, API fallback) |
|
|
134
|
+
| `nmem --json t show <id> -n N --offset O` | `client.fetchThread()` | Fetch thread messages with pagination |
|
|
125
135
|
|
|
126
136
|
All commands have API fallback for older CLI versions.
|
|
127
137
|
|
package/README.md
CHANGED
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
Local-first knowledge graph memory for [OpenClaw](https://openclaw.ai) agents, powered by [Nowledge Mem](https://mem.nowledge.co).
|
|
4
4
|
|
|
5
|
-
Your AI tools forget. We remember. Everywhere. This plugin gives
|
|
5
|
+
Your AI tools forget. We remember. Everywhere. This plugin gives OpenClaw both lossless session memory and the same graph-connected memory layer your other AI tools can use too. Every OpenClaw conversation is captured as a searchable thread, important moments can distill into linked memories with `sourceThreadId`, and knowledge from Claude, Cursor, web chats, and imported threads stays searchable inside OpenClaw. Local-first by default, with remote mode when you want a shared server.
|
|
6
|
+
|
|
7
|
+
This is not a flat note store. Nowledge Mem links related knowledge into a graph, tracks how ideas evolve, deduplicates repeated context, and can run background intelligence to produce daily briefings, contradiction checks, and crystals from converging evidence. OpenClaw can search that same growing memory layer instead of starting from scratch every time.
|
|
6
8
|
|
|
7
9
|
## Requirements
|
|
8
10
|
|
|
9
11
|
- [Nowledge Mem](https://mem.nowledge.co) desktop app **or** `nmem` CLI
|
|
10
|
-
- [OpenClaw](https://openclaw.ai) >= 2026.
|
|
12
|
+
- [OpenClaw](https://openclaw.ai) >= 2026.3.7
|
|
11
13
|
|
|
12
14
|
## Installation
|
|
13
15
|
|
|
@@ -15,9 +17,37 @@ Your AI tools forget. We remember. Everywhere. This plugin gives your OpenClaw a
|
|
|
15
17
|
openclaw plugins install @nowledge/openclaw-nowledge-mem
|
|
16
18
|
```
|
|
17
19
|
|
|
18
|
-
|
|
20
|
+
OpenClaw's installer writes the install record, enables the plugin, and switches the `memory` slot to `openclaw-nowledge-mem`. Restart OpenClaw after install to load it.
|
|
21
|
+
|
|
22
|
+
### Agent-assisted setup
|
|
23
|
+
|
|
24
|
+
If another AI agent is helping you install this plugin, point it at the bundled [SKILL.md](./SKILL.md).
|
|
25
|
+
|
|
26
|
+
Copyable instruction:
|
|
27
|
+
|
|
28
|
+
```text
|
|
29
|
+
Read https://raw.githubusercontent.com/nowledge-co/community/main/nowledge-mem-openclaw-plugin/SKILL.md and follow it to install, configure, verify, and explain Nowledge Mem for OpenClaw.
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
That guide is written for AI agents, not for humans. It handles local vs remote mode, optional API auth, trust pinning, restart, verification, and next steps.
|
|
33
|
+
|
|
34
|
+
### Recommended hardening
|
|
19
35
|
|
|
20
|
-
|
|
36
|
+
If you keep non-bundled plugins on an explicit trust allowlist, add:
|
|
37
|
+
|
|
38
|
+
```json
|
|
39
|
+
{
|
|
40
|
+
"plugins": {
|
|
41
|
+
"allow": ["openclaw-nowledge-mem"]
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
`plugins.allow` is id-based, not source-based. If you also use `plugins.load.paths` or `openclaw plugins install --link`, review those paths too. An allowlist trusts the active plugin with that id; it does not pin where it came from.
|
|
47
|
+
|
|
48
|
+
### Manual config or verification
|
|
49
|
+
|
|
50
|
+
If you manage config manually, or you want to verify what the installer selected, this is the expected shape:
|
|
21
51
|
|
|
22
52
|
```json
|
|
23
53
|
{
|
|
@@ -32,7 +62,7 @@ Start Nowledge Mem desktop app or run `nmem serve`, then enable the plugin:
|
|
|
32
62
|
}
|
|
33
63
|
```
|
|
34
64
|
|
|
35
|
-
|
|
65
|
+
By default the agent gets 10 tools on demand, a behavioral skill that teaches it when to search and save, a short always-on system hint, and end-of-session capture. Working Memory injection is optional and controlled by `sessionContext`.
|
|
36
66
|
|
|
37
67
|
### Remote mode
|
|
38
68
|
|
|
@@ -51,6 +81,11 @@ Or use a config file at `~/.nowledge-mem/openclaw.json`:
|
|
|
51
81
|
|
|
52
82
|
The `apiKey` is injected as `NMEM_API_KEY` into the nmem CLI process. Never passed as a CLI argument, never logged.
|
|
53
83
|
|
|
84
|
+
### Configure via WebUI of OpenClaw
|
|
85
|
+
|
|
86
|
+
<img width="1192" height="2007" alt="openclaw-config" src="https://github.com/user-attachments/assets/a4abd855-db56-4a1f-b0ac-0114909d0c20" />
|
|
87
|
+
|
|
88
|
+
|
|
54
89
|
## How It Works
|
|
55
90
|
|
|
56
91
|
### Per-Turn Flow
|
|
@@ -61,7 +96,7 @@ Every user message triggers hooks before the agent sees it, then the agent decid
|
|
|
61
96
|
flowchart TD
|
|
62
97
|
A["User sends message"] --> B["before_prompt_build hook"]
|
|
63
98
|
|
|
64
|
-
B --> C["Behavioral guidance(
|
|
99
|
+
B --> C["Behavioral guidance(cacheable system hint)"]
|
|
65
100
|
B -.->|"sessionContext: true"| D["Working Memory +relevant memories (~1-2 KB)"]
|
|
66
101
|
|
|
67
102
|
C --> E["Agent processes message(10 tools available)"]
|
|
@@ -80,7 +115,7 @@ flowchart TD
|
|
|
80
115
|
|
|
81
116
|
### When Each Tool Gets Called
|
|
82
117
|
|
|
83
|
-
The behavioral hook
|
|
118
|
+
The behavioral skill and always-on hook nudge the agent to **search before answering** and **save after deciding**. Here's when each tool fires:
|
|
84
119
|
|
|
85
120
|
| Scenario | Tool | What happens |
|
|
86
121
|
|----------|------|--------------|
|
|
@@ -155,7 +190,7 @@ Two entry points:
|
|
|
155
190
|
flowchart LR
|
|
156
191
|
subgraph "default" ["Default (recommended)"]
|
|
157
192
|
direction TB
|
|
158
|
-
D1["Every turn:
|
|
193
|
+
D1["Every turn: short system hint"]
|
|
159
194
|
D2["Agent calls 10 tools on demand"]
|
|
160
195
|
D3["Session end: thread capture + LLM distillation"]
|
|
161
196
|
end
|
|
@@ -169,7 +204,7 @@ flowchart LR
|
|
|
169
204
|
|
|
170
205
|
subgraph minimal ["Minimal"]
|
|
171
206
|
direction TB
|
|
172
|
-
M1["Every turn:
|
|
207
|
+
M1["Every turn: short system hint"]
|
|
173
208
|
M2["Agent calls 10 tools on demand"]
|
|
174
209
|
M3["No automatic capture"]
|
|
175
210
|
end
|
|
@@ -257,14 +292,14 @@ The plugin supports three modes. Choose based on how much you want to guarantee
|
|
|
257
292
|
|
|
258
293
|
| Mode | Config | Behavior | Tradeoff |
|
|
259
294
|
|------|--------|----------|----------|
|
|
260
|
-
| **Default** (recommended) | `sessionContext: false, sessionDigest: true` | Agent calls 10 tools on demand.
|
|
261
|
-
| **Session context** | `sessionContext: true` | Working Memory + relevant memories injected at prompt time, plus all 10 tools still available. |
|
|
262
|
-
| **Minimal** | `sessionDigest: false` | Tool-only, no automatic capture. |
|
|
295
|
+
| **Default** (recommended) | `sessionContext: false, sessionDigest: true` | Agent calls 10 tools on demand. A short system hint stays on. Conversations captured + distilled at session end. | Lowest overhead. Agent decides when to search, usually smart, occasionally forgets. |
|
|
296
|
+
| **Session context** | `sessionContext: true` | Working Memory + relevant memories injected at prompt time, plus all 10 tools still available. | Higher per-turn context cost. Guarantees context is present from the first turn. |
|
|
297
|
+
| **Minimal** | `sessionDigest: false` | Tool-only, no automatic capture. | Small overhead from the always-on hint only. Use when you handle memory manually. |
|
|
263
298
|
|
|
264
299
|
**Which mode should you use?**
|
|
265
300
|
|
|
266
301
|
- **Most users**: start with default. The agent gets behavioral guidance nudging it to search before answering and save after deciding. It works well for most conversations.
|
|
267
|
-
- **Short sessions or critical accuracy**: enable `sessionContext`. This guarantees relevant memories are present from the first turn. The agent doesn't need to decide whether to search. The tradeoff is
|
|
302
|
+
- **Short sessions or critical accuracy**: enable `sessionContext`. This guarantees relevant memories are present from the first turn. The agent doesn't need to decide whether to search. The tradeoff is a larger per-turn prompt.
|
|
268
303
|
- **Full manual control**: set `sessionDigest: false`. You control what gets saved (via `/remember` or `nowledge_mem_save`) and nothing is captured automatically.
|
|
269
304
|
|
|
270
305
|
### Session Context (`sessionContext`, default: false)
|
|
@@ -287,7 +322,7 @@ Honest answers to common questions about how the memory system works.
|
|
|
287
322
|
|
|
288
323
|
**Does the agent always search before answering?**
|
|
289
324
|
|
|
290
|
-
|
|
325
|
+
The plugin uses two layers to drive recall. First, a behavioral skill (auto-discovered by OpenClaw) teaches the agent when and how to use memory tools. Second, a short always-on system hint reminds it to "search before answering questions about prior work, decisions, dates, people, preferences, or plans." In practice, modern LLMs follow this directive guidance reliably for knowledge-related questions. For messages that don't need past context (like "hello" or "thanks"), the agent skips the search, which is the right tradeoff. If guaranteed recall matters for your use case, enable `sessionContext: true`. That injects relevant memories at prompt time, before the agent even processes your message.
|
|
291
326
|
|
|
292
327
|
**What stops the agent from saving duplicate memories?**
|
|
293
328
|
|
|
@@ -322,7 +357,7 @@ openclaw nowledge-mem status
|
|
|
322
357
|
|
|
323
358
|
## Configuration
|
|
324
359
|
|
|
325
|
-
No config
|
|
360
|
+
No config is required for a normal npm install. The defaults work for local mode, and `openclaw plugins install` already enables the plugin and selects the memory slot.
|
|
326
361
|
|
|
327
362
|
To change settings, use the OpenClaw plugin settings UI. Changes take effect on restart.
|
|
328
363
|
|
|
@@ -332,6 +367,7 @@ To change settings, use the OpenClaw plugin settings UI. Changes take effect on
|
|
|
332
367
|
| `sessionDigest` | boolean | `true` | Thread capture + LLM distillation at session end |
|
|
333
368
|
| `digestMinInterval` | integer | `300` | Minimum seconds between session digests for the same thread (0-86400) |
|
|
334
369
|
| `maxContextResults` | integer | `5` | Max memories to inject at prompt time (1-20, only used when sessionContext is enabled) |
|
|
370
|
+
| `recallMinScore` | integer | `0` | Min relevance score (0-100%) to include in auto-recall. 0 = include all |
|
|
335
371
|
| `apiUrl` | string | `""` | Remote server URL. Empty = local (`http://127.0.0.1:14242`) |
|
|
336
372
|
| `apiKey` | string | `""` | API key for remote access. Injected as `NMEM_API_KEY` env var, never logged |
|
|
337
373
|
|
|
@@ -345,6 +381,7 @@ For persistent or scripted config, create `~/.nowledge-mem/openclaw.json`:
|
|
|
345
381
|
"sessionDigest": true,
|
|
346
382
|
"digestMinInterval": 300,
|
|
347
383
|
"maxContextResults": 5,
|
|
384
|
+
"recallMinScore": 0,
|
|
348
385
|
"apiUrl": "",
|
|
349
386
|
"apiKey": ""
|
|
350
387
|
}
|
|
@@ -361,6 +398,7 @@ NMEM_SESSION_CONTEXT=true
|
|
|
361
398
|
NMEM_SESSION_DIGEST=true
|
|
362
399
|
NMEM_DIGEST_MIN_INTERVAL=300
|
|
363
400
|
NMEM_MAX_CONTEXT_RESULTS=5
|
|
401
|
+
NMEM_RECALL_MIN_SCORE=0
|
|
364
402
|
NMEM_API_URL=https://...
|
|
365
403
|
NMEM_API_KEY=your-key
|
|
366
404
|
```
|
|
@@ -373,6 +411,20 @@ config file > OpenClaw settings > env vars > defaults
|
|
|
373
411
|
|
|
374
412
|
Use `nowledge_mem_status` (or `openclaw nowledge-mem status`) to see where each value comes from.
|
|
375
413
|
|
|
414
|
+
### Trust warning after install
|
|
415
|
+
|
|
416
|
+
If OpenClaw logs a warning like `plugins.allow is empty; discovered non-bundled plugins may auto-load`, the plugin is installed correctly. OpenClaw is warning that you have not pinned trust for non-bundled plugins yet. Add:
|
|
417
|
+
|
|
418
|
+
```json
|
|
419
|
+
{
|
|
420
|
+
"plugins": {
|
|
421
|
+
"allow": ["openclaw-nowledge-mem"]
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
If you also use linked or workspace copies, review `plugins.load.paths` before relying on an allowlist. OpenClaw allowlists plugin ids, not install provenance.
|
|
427
|
+
|
|
376
428
|
## What Makes This Different
|
|
377
429
|
|
|
378
430
|
- **Local-first**: no API key, no cloud account. Your knowledge stays on your machine.
|
package/SKILL.md
ADDED
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
# Nowledge Mem for OpenClaw
|
|
2
|
+
|
|
3
|
+
Use this guide when an AI agent is helping a user install, configure, verify, or explain the Nowledge Mem OpenClaw plugin.
|
|
4
|
+
|
|
5
|
+
Nowledge Mem is not just "memory for OpenClaw." It is the user's shared memory layer across OpenClaw, Claude Code, Cursor, browser capture, imported threads, and documents. OpenClaw joins that context exchange.
|
|
6
|
+
|
|
7
|
+
## Use This When
|
|
8
|
+
|
|
9
|
+
- The user wants to install or configure the OpenClaw plugin
|
|
10
|
+
- The user wants OpenClaw to connect to existing Nowledge Mem data
|
|
11
|
+
- The user wants local-first memory on this machine
|
|
12
|
+
- The user wants remote or multi-machine memory through a remote `apiUrl`
|
|
13
|
+
- The user wants to verify that OpenClaw can recall, save, and search memory
|
|
14
|
+
|
|
15
|
+
## Do Not Use This When
|
|
16
|
+
|
|
17
|
+
- The user only wants temporary context in the current OpenClaw session
|
|
18
|
+
- The user is troubleshooting unrelated OpenClaw issues
|
|
19
|
+
- The user only wants direct MCP setup for another client
|
|
20
|
+
|
|
21
|
+
## Product Framing
|
|
22
|
+
|
|
23
|
+
When talking to users:
|
|
24
|
+
|
|
25
|
+
- Say "Nowledge Mem gives OpenClaw the same shared memory your other AI tools can use."
|
|
26
|
+
- Lead with cross-tool continuity, not with plugin internals.
|
|
27
|
+
- For local mode, say "No API key is needed for local mode."
|
|
28
|
+
- For remote mode, say "Set `apiUrl`, and add `apiKey` when the server requires auth."
|
|
29
|
+
- Do not imply that OpenClaw is the only source of truth. It is one client of the user's larger memory system.
|
|
30
|
+
- Do not imply that cloud backup is the default. Our default story is local-first.
|
|
31
|
+
|
|
32
|
+
Good user-facing explanation:
|
|
33
|
+
|
|
34
|
+
> OpenClaw can now read the same memory you already built in your other AI tools, and what happens in OpenClaw can enrich that shared memory too.
|
|
35
|
+
|
|
36
|
+
## Definition of Done
|
|
37
|
+
|
|
38
|
+
This task is not complete until all of the following are true:
|
|
39
|
+
|
|
40
|
+
1. `nmem` is available
|
|
41
|
+
2. The intended backend is verified reachable with `nmem`
|
|
42
|
+
3. The OpenClaw plugin is installed
|
|
43
|
+
4. OpenClaw is using the Nowledge Mem memory slot
|
|
44
|
+
5. Remote config is written only if the user chose remote mode
|
|
45
|
+
6. OpenClaw is restarted
|
|
46
|
+
7. `openclaw nowledge-mem status` succeeds
|
|
47
|
+
8. The user receives a short handoff covering:
|
|
48
|
+
- one real first question to ask
|
|
49
|
+
- how to bring in older history
|
|
50
|
+
- local vs remote expectations
|
|
51
|
+
- trust pinning if they see `plugins.allow` warnings
|
|
52
|
+
|
|
53
|
+
## Setup Flow
|
|
54
|
+
|
|
55
|
+
### Step 0 — Choose Local or Remote
|
|
56
|
+
|
|
57
|
+
Ask the user which setup they want:
|
|
58
|
+
|
|
59
|
+
1. Local Nowledge Mem already running on this machine
|
|
60
|
+
2. Existing remote Nowledge Mem server
|
|
61
|
+
|
|
62
|
+
Explain the difference plainly:
|
|
63
|
+
|
|
64
|
+
- Local mode: OpenClaw talks to the local Nowledge Mem app/server through `nmem`
|
|
65
|
+
- Remote mode: OpenClaw talks to a remote Nowledge Mem server through `nmem --api-url ...`; add `apiKey` when that server has auth enabled
|
|
66
|
+
|
|
67
|
+
### Step 1 — Verify `nmem`
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
nmem --version
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
If this fails:
|
|
74
|
+
|
|
75
|
+
- For users with the desktop app, direct them to **Settings > Preferences > Developer Tools > Install CLI**
|
|
76
|
+
- Otherwise suggest `pip install nmem-cli`
|
|
77
|
+
|
|
78
|
+
### Step 2 — Verify the Backend Before Plugin Setup
|
|
79
|
+
|
|
80
|
+
Local mode:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
nmem --json status
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Remote mode without auth:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
nmem --json --api-url "$API_URL" status
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Remote mode with auth:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
NMEM_API_KEY="$API_KEY" nmem --json --api-url "$API_URL" status
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Success means the backend responds correctly through `nmem`. Do not skip this step and assume the URL/auth is right.
|
|
99
|
+
|
|
100
|
+
### Step 3 — Install the Plugin
|
|
101
|
+
|
|
102
|
+
Default install:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
openclaw plugins install @nowledge/openclaw-nowledge-mem
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
If the user is on mainland China or npmjs is unusually slow, prefer a one-shot mirror override instead of changing global npm config:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
NPMJS_TIME="$(curl -o /dev/null -sS --connect-timeout 2 --max-time 6 -w '%{time_total}' https://registry.npmjs.org/@nowledge%2fopenclaw-nowledge-mem || echo timeout)"
|
|
112
|
+
MIRROR_TIME="$(curl -o /dev/null -sS --connect-timeout 2 --max-time 6 -w '%{time_total}' https://registry.npmmirror.com/@nowledge%2fopenclaw-nowledge-mem || echo timeout)"
|
|
113
|
+
|
|
114
|
+
if [ "$MIRROR_TIME" != "timeout" ] && { [ "$NPMJS_TIME" = "timeout" ] || awk "BEGIN { exit !($NPMJS_TIME > 2 && $MIRROR_TIME < $NPMJS_TIME) }"; }; then
|
|
115
|
+
NPM_CONFIG_REGISTRY=https://registry.npmmirror.com openclaw plugins install @nowledge/openclaw-nowledge-mem
|
|
116
|
+
else
|
|
117
|
+
openclaw plugins install @nowledge/openclaw-nowledge-mem
|
|
118
|
+
fi
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
Important facts:
|
|
122
|
+
|
|
123
|
+
- The installer already writes the install record
|
|
124
|
+
- The installer already enables the plugin
|
|
125
|
+
- The installer already switches the `memory` slot to `openclaw-nowledge-mem`
|
|
126
|
+
|
|
127
|
+
Do not tell the user to hand-edit those settings unless they are using a manual/path setup.
|
|
128
|
+
|
|
129
|
+
### Step 4 — Configure Remote Only When Needed
|
|
130
|
+
|
|
131
|
+
Local mode:
|
|
132
|
+
|
|
133
|
+
- No extra config is required
|
|
134
|
+
|
|
135
|
+
Remote mode:
|
|
136
|
+
|
|
137
|
+
- Prefer setting `apiUrl` and `apiKey` in the OpenClaw plugin settings
|
|
138
|
+
- Use `~/.nowledge-mem/openclaw.json` only when the user wants a stable machine-local override or scripted setup
|
|
139
|
+
|
|
140
|
+
`~/.nowledge-mem/openclaw.json` example:
|
|
141
|
+
|
|
142
|
+
```json
|
|
143
|
+
{
|
|
144
|
+
"apiUrl": "https://nowledge.example.com",
|
|
145
|
+
"apiKey": "your-api-key-here"
|
|
146
|
+
}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Important precedence rule:
|
|
150
|
+
|
|
151
|
+
- `~/.nowledge-mem/openclaw.json` overrides OpenClaw plugin settings
|
|
152
|
+
- Then plugin settings override inherited environment variables
|
|
153
|
+
- Do not assume stale `NMEM_API_URL` or `NMEM_API_KEY` env vars should keep winning
|
|
154
|
+
|
|
155
|
+
If the remote server does not require auth, omit `apiKey`.
|
|
156
|
+
|
|
157
|
+
### Step 5 — Pin Trust When Appropriate
|
|
158
|
+
|
|
159
|
+
If OpenClaw warns that `plugins.allow` is empty, or the user wants explicit trust for non-bundled plugins, add:
|
|
160
|
+
|
|
161
|
+
```json
|
|
162
|
+
{
|
|
163
|
+
"plugins": {
|
|
164
|
+
"allow": ["openclaw-nowledge-mem"]
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
Explain this correctly:
|
|
170
|
+
|
|
171
|
+
- `plugins.allow` trusts the plugin id
|
|
172
|
+
- It does not pin the plugin source path
|
|
173
|
+
- If the user also has linked or workspace copies in `plugins.load.paths`, they should review those too
|
|
174
|
+
|
|
175
|
+
### Step 6 — Restart OpenClaw
|
|
176
|
+
|
|
177
|
+
Restart OpenClaw so the plugin and hooks are active.
|
|
178
|
+
|
|
179
|
+
If an agent is doing the restart automatically, tell the user before triggering it.
|
|
180
|
+
|
|
181
|
+
### Step 7 — Verify the Plugin
|
|
182
|
+
|
|
183
|
+
First check the plugin status:
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
openclaw nowledge-mem status
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
Then verify in chat.
|
|
190
|
+
|
|
191
|
+
For a clean synthetic check:
|
|
192
|
+
|
|
193
|
+
1. `/remember We chose PostgreSQL for task events`
|
|
194
|
+
2. `/recall PostgreSQL`
|
|
195
|
+
3. `/new`
|
|
196
|
+
4. Ask `What database did we choose for task events?`
|
|
197
|
+
|
|
198
|
+
If the user already has real memory in Nowledge Mem, prefer a real question over a synthetic demo. Good examples:
|
|
199
|
+
|
|
200
|
+
- `What was I working on this week?`
|
|
201
|
+
- `What did we already decide about the task API?`
|
|
202
|
+
- `Find the conversation where we discussed Redis caching`
|
|
203
|
+
|
|
204
|
+
## Handoff Message
|
|
205
|
+
|
|
206
|
+
After setup succeeds, send a short handoff that covers all four points:
|
|
207
|
+
|
|
208
|
+
1. OpenClaw is now connected
|
|
209
|
+
2. The best next question to ask
|
|
210
|
+
3. How to bring in older history
|
|
211
|
+
4. What the local/remote trust model is
|
|
212
|
+
|
|
213
|
+
Good structure:
|
|
214
|
+
|
|
215
|
+
```text
|
|
216
|
+
OpenClaw is now connected to Nowledge Mem.
|
|
217
|
+
|
|
218
|
+
Try this next:
|
|
219
|
+
- Ask OpenClaw: "What was I working on this week?"
|
|
220
|
+
|
|
221
|
+
If you want more history:
|
|
222
|
+
- Import old AI threads or browser-captured chats into Nowledge Mem so OpenClaw can search them too.
|
|
223
|
+
|
|
224
|
+
What to expect:
|
|
225
|
+
- Local mode needs no API key.
|
|
226
|
+
- Remote mode uses the same apiUrl and, when auth is enabled, the same apiKey you already verified with nmem.
|
|
227
|
+
- If OpenClaw warns that plugins.allow is empty, add openclaw-nowledge-mem to the allowlist to pin trust explicitly.
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
## Troubleshooting
|
|
231
|
+
|
|
232
|
+
| Symptom | What to do |
|
|
233
|
+
| --- | --- |
|
|
234
|
+
| `nmem --json status` fails in local mode | Start Nowledge Mem locally first |
|
|
235
|
+
| Remote mode fails | Re-run `nmem --json --api-url ... status` with the exact URL and auth you plan to use |
|
|
236
|
+
| `openclaw nowledge-mem status` fails after install | Restart OpenClaw and confirm the plugin was installed successfully |
|
|
237
|
+
| `plugins.allow is empty` warning | Add `openclaw-nowledge-mem` to `plugins.allow` if the user wants explicit trust |
|
|
238
|
+
| Remote config seems ignored | Check whether `~/.nowledge-mem/openclaw.json` is overriding plugin settings |
|
|
239
|
+
| Local mode unexpectedly talks to a remote server | Check for stale `NMEM_API_URL` / `NMEM_API_KEY` in the environment or an overriding `~/.nowledge-mem/openclaw.json` |
|
|
240
|
+
|
|
241
|
+
## Notes for Agents
|
|
242
|
+
|
|
243
|
+
- Human docs and AI setup instructions are different things. Keep the human explanation short and concrete.
|
|
244
|
+
- Do not dump the whole configuration model on the user up front.
|
|
245
|
+
- Do not reduce Nowledge Mem to "OpenClaw memory." The real value is shared context across tools and growth of knowledge over time.
|
package/openclaw.plugin.json
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "openclaw-nowledge-mem",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.12",
|
|
4
4
|
"kind": "memory",
|
|
5
|
+
"skills": ["skills/memory-guide"],
|
|
5
6
|
"uiHints": {
|
|
6
7
|
"sessionContext": {
|
|
7
8
|
"label": "Session context injection",
|
|
8
|
-
"help": "Inject Working Memory and relevant memories at prompt time. Off by default
|
|
9
|
+
"help": "Inject Working Memory and relevant memories at prompt time. Off by default; the agent can call memory_search on demand instead."
|
|
9
10
|
},
|
|
10
11
|
"sessionDigest": {
|
|
11
12
|
"label": "Session digest at end",
|
|
12
|
-
"help": "Capture conversation threads and distill key memories via LLM at session end. On by default
|
|
13
|
+
"help": "Capture conversation threads and distill key memories via LLM at session end. On by default. Negligible cost, one triage call per session."
|
|
13
14
|
},
|
|
14
15
|
"digestMinInterval": {
|
|
15
16
|
"label": "Minimum digest interval (seconds)",
|
|
@@ -17,7 +18,11 @@
|
|
|
17
18
|
},
|
|
18
19
|
"maxContextResults": {
|
|
19
20
|
"label": "Max context results",
|
|
20
|
-
"help": "How many memories to inject for each context cycle (1
|
|
21
|
+
"help": "How many memories to inject for each context cycle (1-20)"
|
|
22
|
+
},
|
|
23
|
+
"recallMinScore": {
|
|
24
|
+
"label": "Min recall score (%)",
|
|
25
|
+
"help": "Only inject memories with relevance score above this threshold (0-100). Set to 0 to include all results."
|
|
21
26
|
},
|
|
22
27
|
"apiUrl": {
|
|
23
28
|
"label": "Server URL (remote mode)",
|
|
@@ -25,7 +30,7 @@
|
|
|
25
30
|
},
|
|
26
31
|
"apiKey": {
|
|
27
32
|
"label": "API key (remote mode)",
|
|
28
|
-
"help": "Required when connecting to a remote server. Never logged or passed as a CLI argument
|
|
33
|
+
"help": "Required when connecting to a remote server. Never logged or passed as a CLI argument. Injected as NMEM_API_KEY env var only.",
|
|
29
34
|
"secret": true
|
|
30
35
|
}
|
|
31
36
|
},
|
|
@@ -35,7 +40,7 @@
|
|
|
35
40
|
"sessionContext": {
|
|
36
41
|
"type": "boolean",
|
|
37
42
|
"default": false,
|
|
38
|
-
"description": "Inject Working Memory and recalled memories at prompt time. Off by default
|
|
43
|
+
"description": "Inject Working Memory and recalled memories at prompt time. Off by default; the agent queries memory on demand via tools."
|
|
39
44
|
},
|
|
40
45
|
"sessionDigest": {
|
|
41
46
|
"type": "boolean",
|
|
@@ -56,6 +61,13 @@
|
|
|
56
61
|
"maximum": 20,
|
|
57
62
|
"description": "Maximum memories to inject at prompt time (only used when sessionContext is enabled)"
|
|
58
63
|
},
|
|
64
|
+
"recallMinScore": {
|
|
65
|
+
"type": "integer",
|
|
66
|
+
"default": 0,
|
|
67
|
+
"minimum": 0,
|
|
68
|
+
"maximum": 100,
|
|
69
|
+
"description": "Minimum relevance score (0-100%) to include a memory in auto-recall. Set to 0 to include all results."
|
|
70
|
+
},
|
|
59
71
|
"apiUrl": {
|
|
60
72
|
"type": "string",
|
|
61
73
|
"default": "",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nowledge/openclaw-nowledge-mem",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.12",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Nowledge Mem memory plugin for OpenClaw, local-first personal knowledge base",
|
|
6
6
|
"author": {
|
|
@@ -14,6 +14,15 @@
|
|
|
14
14
|
"url": "https://github.com/nowledge-co/community.git",
|
|
15
15
|
"directory": "nowledge-mem-openclaw-plugin"
|
|
16
16
|
},
|
|
17
|
+
"files": [
|
|
18
|
+
"src",
|
|
19
|
+
"skills",
|
|
20
|
+
"README.md",
|
|
21
|
+
"CHANGELOG.md",
|
|
22
|
+
"CLAUDE.md",
|
|
23
|
+
"SKILL.md",
|
|
24
|
+
"openclaw.plugin.json"
|
|
25
|
+
],
|
|
17
26
|
"openclaw": {
|
|
18
27
|
"extensions": ["./src/index.js"]
|
|
19
28
|
},
|
|
@@ -23,7 +32,7 @@
|
|
|
23
32
|
"format": "biome format --write ."
|
|
24
33
|
},
|
|
25
34
|
"peerDependencies": {
|
|
26
|
-
"openclaw": ">=2026.
|
|
35
|
+
"openclaw": ">=2026.3.7"
|
|
27
36
|
},
|
|
28
37
|
"devDependencies": {
|
|
29
38
|
"@biomejs/biome": "^1.9.0"
|