@nowledge/openclaw-nowledge-mem 0.2.7
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 +211 -0
- package/README.md +191 -0
- package/openclaw.plugin.json +61 -0
- package/package.json +54 -0
- package/src/client.js +673 -0
- package/src/commands/cli.js +45 -0
- package/src/commands/slash.js +109 -0
- package/src/config.js +43 -0
- package/src/hooks/capture.js +337 -0
- package/src/hooks/recall.js +109 -0
- package/src/index.js +81 -0
- package/src/tools/connections.js +324 -0
- package/src/tools/context.js +126 -0
- package/src/tools/forget.js +154 -0
- package/src/tools/memory-get.js +168 -0
- package/src/tools/memory-search.js +183 -0
- package/src/tools/save.js +179 -0
- package/src/tools/timeline.js +208 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to the Nowledge Mem OpenClaw plugin will be documented in this file.
|
|
4
|
+
|
|
5
|
+
## [0.2.7] - 2026-02-18
|
|
6
|
+
|
|
7
|
+
### Added — Gap closures: date range, EVOLVES CLI, WM section edit
|
|
8
|
+
|
|
9
|
+
**Feed date range filtering**
|
|
10
|
+
|
|
11
|
+
- `nowledge_mem_timeline` now accepts `date_from` and `date_to` (YYYY-MM-DD) for exact temporal queries ("what was I doing last Tuesday?").
|
|
12
|
+
- `client.feedEvents()` passes `--from`/`--to` to `nmem f`; falls back to API `?date_from=&date_to=` params.
|
|
13
|
+
- Backend `GET /agent/feed/events` now accepts `date_from` / `date_to` query params alongside `last_n_days`.
|
|
14
|
+
- CLI: `nmem f --from 2026-02-17 --to 2026-02-17`
|
|
15
|
+
|
|
16
|
+
**EVOLVES version chain via CLI**
|
|
17
|
+
|
|
18
|
+
- `nmem g evolves <id>` — new CLI command showing the full EVOLVES chain for a memory (replaces/enriches/confirms/challenges relations).
|
|
19
|
+
- `client.graphEvolves()` — new client method using `nmem g evolves`; falls back to `GET /agent/evolves?memory_id=<id>`.
|
|
20
|
+
- `connections.js` now uses `client.graphEvolves()` instead of a raw API call. "Knowledge evolution" section now correctly shows direction (→ newer / ← older) relative to the queried memory.
|
|
21
|
+
- Backend `GET /agent/evolves` now accepts `memory_id` query param to filter edges for a specific memory.
|
|
22
|
+
|
|
23
|
+
**Working Memory section-level edit**
|
|
24
|
+
|
|
25
|
+
- `nmem wm patch --heading "## Notes" --content/--append` — new CLI subcommand. Does client-side read-modify-write: reads WM, patches just the target section, writes the full doc back.
|
|
26
|
+
- `client.patchWorkingMemory(heading, { content, append })` — new client method.
|
|
27
|
+
- `nowledge_mem_context` now supports optional `patch_section` + `patch_content`/`patch_append` parameters. An agent can now update one section of Working Memory without destroying the rest.
|
|
28
|
+
- Includes a JS `patchWmSection()` helper in `client.js` for the API fallback path (for CLI versions that predate `wm patch`).
|
|
29
|
+
|
|
30
|
+
## [0.2.6] - 2026-02-18
|
|
31
|
+
|
|
32
|
+
### Added — Rich save: labels, event_start, temporal_context, unit_type fixed
|
|
33
|
+
|
|
34
|
+
## [0.2.5] - 2026-02-18
|
|
35
|
+
|
|
36
|
+
### Added — Remote mode configuration
|
|
37
|
+
|
|
38
|
+
- `apiUrl` config option: set to your remote server URL to use Nowledge Mem across devices or in a team. Leave empty for local mode (default: `http://127.0.0.1:14242`).
|
|
39
|
+
- `apiKey` config option: API key for remote access. Marked `"secret": true` in uiHints so OpenClaw can mask it in the UI. **Never logged, never passed as a CLI argument** — injected as `NMEM_API_KEY` env var into child processes only.
|
|
40
|
+
- `NowledgeMemClient` now accepts `{ apiUrl, apiKey }` credentials at construction time. Both config values and `NMEM_API_URL` / `NMEM_API_KEY` env vars are supported; plugin config wins over env vars.
|
|
41
|
+
- Initialization log now shows `mode=remote → https://...` vs `mode=local` (key never appears in logs).
|
|
42
|
+
- `_spawnEnv()` helper: builds per-spawn env with credentials injected; `_apiUrlArgs()` adds `--api-url` flag only when not local.
|
|
43
|
+
|
|
44
|
+
## [0.2.4] - 2026-02-18
|
|
45
|
+
|
|
46
|
+
### Changed — CLI-first architecture
|
|
47
|
+
|
|
48
|
+
All operations now go through the `nmem` CLI instead of direct API calls.
|
|
49
|
+
This is a structural alignment that makes every feature work in remote mode
|
|
50
|
+
(`NMEM_API_URL` + `NMEM_API_KEY`) without any plugin changes.
|
|
51
|
+
|
|
52
|
+
- `client.graphExpand()` — uses `nmem g expand <id>`; falls back to API on older CLI
|
|
53
|
+
- `client.feedEvents()` — uses `nmem f`; falls back to API on older CLI
|
|
54
|
+
- `client.search()` — CLI now returns `relevance_reason`, `importance`, `labels`,
|
|
55
|
+
temporal fields natively; `searchRich()` is now an alias for `search()`
|
|
56
|
+
- `client.searchTemporal()` — uses `nmem m search --event-from/--recorded-from`
|
|
57
|
+
CLI args; falls back to API if CLI is pre-bi-temporal-update
|
|
58
|
+
- `client._normalizeMemory()` — canonical memory shape shared across all search paths
|
|
59
|
+
- Removed `client.apiJson()` usage in `connections.js` and `timeline.js`
|
|
60
|
+
- `connections.js`: `client.apiJson()` retained only for the `/agent/evolves` chain
|
|
61
|
+
(no CLI command for this yet — tracked as future improvement)
|
|
62
|
+
|
|
63
|
+
## [0.2.3] - 2026-02-18
|
|
64
|
+
|
|
65
|
+
### Changed — Graph Transparency & Scoring Visibility
|
|
66
|
+
|
|
67
|
+
- `nowledge_mem_connections`: completely rewritten output format
|
|
68
|
+
- Edges are now JOIN-ed to their target nodes — each connection shows its relationship type and strength
|
|
69
|
+
- Sections organized by edge type: "Synthesized from N source memories" (CRYSTALLIZED_FROM), "Knowledge evolution" (EVOLVES), "Sourced from document" (SOURCED_FROM), "Entities mentioned" (MENTIONS)
|
|
70
|
+
- EVOLVES sub-relations are labeled: supersedes, enriches, confirms, challenges
|
|
71
|
+
- Each connected memory includes its `id` for direct follow-up with `memory_get` or `nowledge_mem_connections`
|
|
72
|
+
- `memory_search`: now always uses API path (`searchRich`) — returns `matchedVia` with scoring breakdown
|
|
73
|
+
- e.g. `"matchedVia": "Text Match (100%) + Semantic Match (69%) | decay[imp:high]"`
|
|
74
|
+
- Also returns `importance` per result
|
|
75
|
+
- Response `mode` field updated to `"multi-signal"` to reflect actual behavior
|
|
76
|
+
- `nowledge_mem_timeline`: timeline entries now include `(id: <memoryId>)` hint for events with linked memories — enables immediate chaining to `nowledge_mem_connections`
|
|
77
|
+
- `nowledge_mem_timeline`: `event_type` filter values documented in tool description for model discoverability
|
|
78
|
+
- Auto-recall hook: uses `searchRich` instead of CLI search — shows scoring breakdown in recalled context
|
|
79
|
+
|
|
80
|
+
### Added
|
|
81
|
+
|
|
82
|
+
- `client.searchRich()` — convenience wrapper for `searchTemporal` without temporal filters; always returns `relevanceReason`
|
|
83
|
+
|
|
84
|
+
## [0.2.2] - 2026-02-18
|
|
85
|
+
|
|
86
|
+
### Added
|
|
87
|
+
|
|
88
|
+
- `memory_search` now supports bi-temporal filtering:
|
|
89
|
+
- `event_date_from` / `event_date_to` — when the fact/event happened (YYYY, YYYY-MM, YYYY-MM-DD)
|
|
90
|
+
- `recorded_date_from` / `recorded_date_to` — when the memory was saved to Nowledge Mem
|
|
91
|
+
- Uses API-direct path (`client.searchTemporal`) so it works regardless of installed CLI version
|
|
92
|
+
- Results include `eventStart`, `eventEnd`, `temporalContext` when available
|
|
93
|
+
- `client.searchTemporal()` — new method wrapping `/memories/search` bi-temporal API directly
|
|
94
|
+
|
|
95
|
+
## [0.2.1] - 2026-02-18
|
|
96
|
+
|
|
97
|
+
### Added
|
|
98
|
+
|
|
99
|
+
- `nowledge_mem_timeline` tool: temporal feed browser wrapping `/agent/feed/events`. Answers "what was I working on last week?" with a day-grouped activity timeline. Supports `last_n_days`, `event_type`, and `tier1_only` filters.
|
|
100
|
+
- `memory_search` description now surfaces the full scoring pipeline (embedding + BM25 + labels + graph + decay)
|
|
101
|
+
- Recall hook updated: explicit tool routing for temporal queries (`nowledge_mem_timeline`) vs topic queries (`memory_search`/`nowledge_mem_connections`)
|
|
102
|
+
|
|
103
|
+
## [0.2.0] - 2026-02-18
|
|
104
|
+
|
|
105
|
+
### Changed — Tool Set Redesign
|
|
106
|
+
|
|
107
|
+
Redesigned from first principles around Nowledge Mem's v0.6 architecture.
|
|
108
|
+
This version reflects our genuine strengths: knowledge graph, structured types,
|
|
109
|
+
Working Memory, and cross-AI continuity.
|
|
110
|
+
|
|
111
|
+
### Added
|
|
112
|
+
|
|
113
|
+
- `nowledge_mem_save` tool: structured knowledge capture with `unit_type` parameter (fact, preference, decision, plan, procedure, learning, context, event) — replaces generic `nowledge_mem_store`
|
|
114
|
+
- `nowledge_mem_context` tool: read today's Working Memory daily briefing — replaces `nowledge_mem_working_memory` with clearer naming
|
|
115
|
+
- `nowledge_mem_connections` tool: explore knowledge graph around a topic — returns connected memories, EVOLVES chains, related entities, and Source document provenance (SOURCED_FROM edges from Library). This is our graph-native differentiator.
|
|
116
|
+
- `nowledge_mem_forget` tool: delete memories by ID or search query with confirmation flow
|
|
117
|
+
- `/forget` slash command: quick memory deletion from chat
|
|
118
|
+
- Capture quality gate: prompt injection detection, question filtering, memory-trigger pattern matching
|
|
119
|
+
- Recall context now includes tool guidance for Nowledge Mem native tools
|
|
120
|
+
|
|
121
|
+
### Removed
|
|
122
|
+
|
|
123
|
+
- `nowledge_mem_search` tool: redundant with `memory_search`. One search tool, done right.
|
|
124
|
+
- `nowledge_mem_store` tool: replaced by `nowledge_mem_save` with richer `unit_type` model
|
|
125
|
+
- `nowledge_mem_working_memory` tool: replaced by `nowledge_mem_context`
|
|
126
|
+
|
|
127
|
+
### Fixed
|
|
128
|
+
|
|
129
|
+
- Capture hook no longer saves questions or prompt-injection payloads as memory notes
|
|
130
|
+
- Recall context properly escapes memory content for prompt safety
|
|
131
|
+
|
|
132
|
+
## [0.1.5] - 2026-02-17
|
|
133
|
+
|
|
134
|
+
### Fixed
|
|
135
|
+
|
|
136
|
+
- Aligned plugin ids with OpenClaw installer id derivation so `openclaw plugins install --link` and npm installs work without config validation failures:
|
|
137
|
+
- package id (`@nowledge/openclaw-nowledge-mem`) -> plugin id (`openclaw-nowledge-mem`)
|
|
138
|
+
- manifest/export ids now match installer-derived id
|
|
139
|
+
|
|
140
|
+
### Changed
|
|
141
|
+
|
|
142
|
+
- Updated docs/examples to use:
|
|
143
|
+
- `plugins.slots.memory = "openclaw-nowledge-mem"`
|
|
144
|
+
- `plugins.entries.openclaw-nowledge-mem`
|
|
145
|
+
|
|
146
|
+
## [0.1.4] - 2026-02-17
|
|
147
|
+
|
|
148
|
+
### Added
|
|
149
|
+
|
|
150
|
+
- OpenClaw memory-compatible tool aliases:
|
|
151
|
+
- `memory_search` (structured recall output with source paths)
|
|
152
|
+
- `memory_get` (fetch by `nowledgemem://memory/<id>` or raw memory ID)
|
|
153
|
+
- `after_compaction` capture hook to preserve thread continuity across compaction cycles
|
|
154
|
+
|
|
155
|
+
### Changed
|
|
156
|
+
|
|
157
|
+
- Auto-capture is now append-first with deterministic thread IDs:
|
|
158
|
+
- Attempts `append` with deduplication
|
|
159
|
+
- Falls back to `create` on first write
|
|
160
|
+
- Added CLI/API fallback in client for mixed nmem versions (append/create with explicit thread IDs)
|
|
161
|
+
- Added retry-safe append `idempotency_key` propagation for transcript batches
|
|
162
|
+
- Updated docs to require `plugins.slots.memory = "nowledge-mem"` for full memory-slot replacement behavior
|
|
163
|
+
|
|
164
|
+
## [0.1.3] - 2026-02-17
|
|
165
|
+
|
|
166
|
+
### Changed
|
|
167
|
+
|
|
168
|
+
- Replaced `autoCapture` no-op with real capture pipeline:
|
|
169
|
+
- `agent_end`: stores high-signal user memory via `nmem m add`
|
|
170
|
+
- `before_reset`: snapshots recent session messages via `nmem t create`
|
|
171
|
+
- Added resilient session snapshot fallback by reading `before_reset.sessionFile` JSONL when hook payload messages are not present
|
|
172
|
+
|
|
173
|
+
## [0.1.2] - 2026-02-17
|
|
174
|
+
|
|
175
|
+
### Fixed
|
|
176
|
+
|
|
177
|
+
- Aligned tool handler signature with OpenClaw runtime (`execute(toolCallId, params)`)
|
|
178
|
+
- Hardened `nmem` execution path to avoid shell interpolation/injection
|
|
179
|
+
- Updated package metadata to `openclaw.extensions` for plugin install/discovery compatibility
|
|
180
|
+
- Corrected manifest `uiHints` structure and `maxRecallResults` type (`integer`)
|
|
181
|
+
- Added prompt-safety escaping for recalled memory context
|
|
182
|
+
- Fixed store tool handling for `importance: 0`
|
|
183
|
+
- Updated docs for current OpenClaw install/config flow
|
|
184
|
+
|
|
185
|
+
### Changed
|
|
186
|
+
|
|
187
|
+
- `autoCapture` now logs a warning and skips capture because nmem-cli does not support OpenClaw thread/message persistence
|
|
188
|
+
|
|
189
|
+
## [0.1.1] - 2026-02-15
|
|
190
|
+
|
|
191
|
+
### Changed
|
|
192
|
+
|
|
193
|
+
- Removed unused `serverUrl` configuration from schema/docs (plugin is local `nmem` CLI based)
|
|
194
|
+
- Improved recall hook prompt to present injected context as central external memory
|
|
195
|
+
- Added UI hint details for `maxRecallResults`
|
|
196
|
+
|
|
197
|
+
## [0.1.0] - 2026-02-14
|
|
198
|
+
|
|
199
|
+
### Added
|
|
200
|
+
|
|
201
|
+
- **Tools**: 3 agent tools
|
|
202
|
+
- `nowledge_mem_search` : semantic search across personal knowledge base
|
|
203
|
+
- `nowledge_mem_store` : save insights, decisions, and findings
|
|
204
|
+
- `nowledge_mem_working_memory` : read daily Working Memory briefing
|
|
205
|
+
- **Hooks**:
|
|
206
|
+
- `before_agent_start` : auto-recall Working Memory + relevant memories
|
|
207
|
+
- `agent_end` : auto-capture conversation thread
|
|
208
|
+
- **Slash commands**: `/remember`, `/recall`
|
|
209
|
+
- **CLI**: `openclaw nowledge-mem search`, `openclaw nowledge-mem status`
|
|
210
|
+
- **nmem CLI integration**: local-first, no API key required
|
|
211
|
+
- **Plain JavaScript** (ES modules): no build step, no TypeScript dependency
|
package/README.md
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
# Nowledge Mem OpenClaw Plugin
|
|
2
|
+
|
|
3
|
+
Local-first knowledge graph memory for [OpenClaw](https://openclaw.ai) agents, powered by [Nowledge Mem](https://mem.nowledge.co).
|
|
4
|
+
|
|
5
|
+
Your AI tools forget. We remember. Everywhere. This plugin gives your OpenClaw agents persistent, graph-connected memory across WhatsApp, Telegram, Discord, Slack, and every channel OpenClaw supports. All data stays on your machine.
|
|
6
|
+
|
|
7
|
+
## Requirements
|
|
8
|
+
|
|
9
|
+
- [Nowledge Mem](https://mem.nowledge.co) desktop app **or** `nmem` CLI
|
|
10
|
+
- [OpenClaw](https://openclaw.ai) >= 2026.1.29
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
openclaw plugins install @nowledge/openclaw-nowledge-mem
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### Local mode (default)
|
|
19
|
+
|
|
20
|
+
Start Nowledge Mem desktop app or run `nmem serve`, then configure:
|
|
21
|
+
|
|
22
|
+
```json
|
|
23
|
+
{
|
|
24
|
+
"plugins": {
|
|
25
|
+
"slots": { "memory": "openclaw-nowledge-mem" },
|
|
26
|
+
"entries": {
|
|
27
|
+
"openclaw-nowledge-mem": {
|
|
28
|
+
"enabled": true,
|
|
29
|
+
"config": {
|
|
30
|
+
"autoRecall": true,
|
|
31
|
+
"autoCapture": false,
|
|
32
|
+
"maxRecallResults": 5
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Remote mode
|
|
41
|
+
|
|
42
|
+
Connect to a Nowledge Mem server running elsewhere — on a VPS, a home server, or shared team instance. See [remote access guide](https://docs.nowledge.co/docs/remote-access) for server setup.
|
|
43
|
+
|
|
44
|
+
```json
|
|
45
|
+
{
|
|
46
|
+
"plugins": {
|
|
47
|
+
"slots": { "memory": "openclaw-nowledge-mem" },
|
|
48
|
+
"entries": {
|
|
49
|
+
"openclaw-nowledge-mem": {
|
|
50
|
+
"enabled": true,
|
|
51
|
+
"config": {
|
|
52
|
+
"autoRecall": true,
|
|
53
|
+
"autoCapture": false,
|
|
54
|
+
"apiUrl": "https://nowledge.example.com",
|
|
55
|
+
"apiKey": "your-api-key-here"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
The `apiKey` is injected as `NMEM_API_KEY` into the nmem CLI process — never passed as a CLI argument, never logged.
|
|
64
|
+
|
|
65
|
+
## Tools
|
|
66
|
+
|
|
67
|
+
### OpenClaw Memory Compatibility
|
|
68
|
+
|
|
69
|
+
These satisfy the OpenClaw memory slot contract and activate the "Memory Recall" section in OpenClaw's system prompt.
|
|
70
|
+
|
|
71
|
+
**memory_search** — Multi-signal recall using embedding, BM25, label match, graph signals, and recency decay. Returns structured source paths (`nowledgemem://memory/<id>`) for follow-up with `memory_get` or `nowledge_mem_connections`.
|
|
72
|
+
|
|
73
|
+
**memory_get** — Read a specific memory by ID or path. Supports `MEMORY.md` alias for Working Memory.
|
|
74
|
+
|
|
75
|
+
### Nowledge Mem Native
|
|
76
|
+
|
|
77
|
+
These reflect capabilities unique to Nowledge Mem's knowledge graph architecture.
|
|
78
|
+
|
|
79
|
+
**nowledge_mem_save** — Capture structured knowledge with type classification, labels, and temporal context.
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
text: "We decided to use PostgreSQL with JSONB for the task events table"
|
|
83
|
+
title: "Task events database choice"
|
|
84
|
+
unit_type: decision
|
|
85
|
+
importance: 0.8
|
|
86
|
+
labels: ["backend", "architecture"]
|
|
87
|
+
event_start: 2024-03
|
|
88
|
+
temporal_context: past
|
|
89
|
+
→ Saved: Task events database choice [decision] (id: mem_abc) · labels: backend, architecture · event: 2024-03
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Eight memory types: `fact`, `preference`, `decision`, `plan`, `procedure`, `learning`, `context`, `event` — each becomes a typed node in the knowledge graph. Labels enable filtering in `memory_search`. `event_start` records *when* something happened, not just when you saved it — powering bi-temporal search.
|
|
93
|
+
|
|
94
|
+
**nowledge_mem_context** — Read today's Working Memory: focus areas, priorities, unresolved flags, and recent activity. Generated by the Knowledge Agent each morning, updated throughout the day.
|
|
95
|
+
|
|
96
|
+
**nowledge_mem_connections** — Explore the knowledge graph around a topic or memory. Returns connected memories, EVOLVES version chains (how understanding has grown), related entities, and source document provenance (which files or URLs knowledge was extracted from).
|
|
97
|
+
|
|
98
|
+
```
|
|
99
|
+
memoryId: "mem_abc"
|
|
100
|
+
→ Connected memories:
|
|
101
|
+
- PostgreSQL optimization patterns: Use JSONB GIN indexes for...
|
|
102
|
+
- Redis caching layer decision: For frequently accessed task lists...
|
|
103
|
+
Source documents (provenance):
|
|
104
|
+
- api-spec.pdf (file): API specification for task management...
|
|
105
|
+
Related entities:
|
|
106
|
+
- PostgreSQL (Technology)
|
|
107
|
+
- Task Management API (Project)
|
|
108
|
+
Knowledge evolution:
|
|
109
|
+
- superseded by newer understanding (version chain)
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
**nowledge_mem_timeline** — Browse your knowledge history chronologically. Use for questions like "what was I working on last week?" or "what happened yesterday?". Groups activity by day: memories saved, documents ingested, insights generated, and more.
|
|
113
|
+
|
|
114
|
+
```
|
|
115
|
+
last_n_days: 7
|
|
116
|
+
→ 2026-02-18:
|
|
117
|
+
- [Memory saved] UV guide — Python toolchain setup
|
|
118
|
+
- [Knowledge extracted from document] api-spec.pdf
|
|
119
|
+
2026-02-17:
|
|
120
|
+
- [Daily briefing] Focus: NebulaGraph, AI biotech...
|
|
121
|
+
- [Insight] Connection between Redis caching and...
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
**nowledge_mem_forget** — Delete a memory by ID or search query. Supports user confirmation when multiple matches are found.
|
|
125
|
+
|
|
126
|
+
## Hooks
|
|
127
|
+
|
|
128
|
+
These run automatically at OpenClaw lifecycle events — no agent decision-making involved. The LLM never calls a hidden "save" tool; the plugin's code fires at the right moments.
|
|
129
|
+
|
|
130
|
+
### Auto-Recall (`autoRecall`, default: true)
|
|
131
|
+
|
|
132
|
+
Before each agent turn, the plugin:
|
|
133
|
+
|
|
134
|
+
1. Reads **Working Memory** (today's AI-generated briefing — focus areas, flags, recent activity)
|
|
135
|
+
2. Searches your knowledge graph for **relevant memories** matching the current prompt
|
|
136
|
+
3. Prepends both as context to the system prompt, along with **tool guidance** for Nowledge Mem tools
|
|
137
|
+
|
|
138
|
+
The agent receives richer context automatically. No tool call is made; no agent action is required.
|
|
139
|
+
|
|
140
|
+
### Auto-Capture (`autoCapture`, default: false)
|
|
141
|
+
|
|
142
|
+
At three lifecycle points — `agent_end`, `after_compaction`, `before_reset` — the plugin does two independent things:
|
|
143
|
+
|
|
144
|
+
**1. Thread transcript (always)**
|
|
145
|
+
The full conversation is appended to a persistent thread in Nowledge Mem, keyed by a stable session ID. This happens unconditionally on every successful session end, regardless of what was said. The thread is searchable via `nowledge_mem_timeline` and `nmem t` commands.
|
|
146
|
+
|
|
147
|
+
**2. Memory note (conditional)**
|
|
148
|
+
If the last user message matches a memory-trigger pattern (decision, preference, fact, entity — e.g. "I prefer TypeScript", "we chose Postgres"), a separate structured memory is also created. Questions, slash commands, and injected-context blocks are skipped. The memory note is independent of the thread — both can happen, either, or neither.
|
|
149
|
+
|
|
150
|
+
**Compaction captures**: when OpenClaw compresses a long conversation to fit the model's context window, the plugin fires `after_compaction` and appends the pre-compaction transcript to the thread. Messages that get compressed away are not lost.
|
|
151
|
+
|
|
152
|
+
**Deduplication**: thread appends are idempotent by `external_id`. If the same hook fires twice (e.g. both `agent_end` and `before_reset`), messages are deduplicated — no duplicates in Nowledge Mem.
|
|
153
|
+
|
|
154
|
+
**Quality gates** (memory note only): skips messages shorter than 24 characters, fewer than 5 words, questions, slash commands, prompt-injection patterns, and LLM-generated context blocks.
|
|
155
|
+
|
|
156
|
+
## Slash Commands
|
|
157
|
+
|
|
158
|
+
| Command | Description |
|
|
159
|
+
|---------|-------------|
|
|
160
|
+
| `/remember <text>` | Save a quick memory |
|
|
161
|
+
| `/recall <query>` | Search your knowledge base |
|
|
162
|
+
| `/forget <id or query>` | Delete a memory |
|
|
163
|
+
|
|
164
|
+
## CLI Commands
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
openclaw nowledge-mem search "database optimization"
|
|
168
|
+
openclaw nowledge-mem status
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
## Configuration
|
|
172
|
+
|
|
173
|
+
| Key | Type | Default | Description |
|
|
174
|
+
|-----|------|---------|-------------|
|
|
175
|
+
| `autoRecall` | boolean | `true` | Inject Working Memory + relevant memories at session start |
|
|
176
|
+
| `autoCapture` | boolean | `false` | Capture knowledge notes and thread transcripts across lifecycle hooks |
|
|
177
|
+
| `maxRecallResults` | integer | `5` | Max memories to recall (1-20) |
|
|
178
|
+
|
|
179
|
+
## What Makes This Different
|
|
180
|
+
|
|
181
|
+
- **Local-first**: no API key, no cloud account. Your knowledge stays on your machine.
|
|
182
|
+
- **Knowledge graph**: memories are connected nodes, not isolated vectors. EVOLVES edges track how understanding grows over time.
|
|
183
|
+
- **Source provenance**: the Library ingests PDFs, DOCX, URLs — extracted knowledge links back to the exact document section it came from.
|
|
184
|
+
- **Working Memory**: an AI-generated daily briefing that evolves — not a static user profile.
|
|
185
|
+
- **Cross-AI continuity**: knowledge captured in any tool (Cursor, Claude, ChatGPT) flows to OpenClaw and back.
|
|
186
|
+
- **Typed memories**: 8 knowledge types mapped to graph node properties — structured understanding, not text blobs.
|
|
187
|
+
- **Multi-signal search**: not just semantic similarity — combines embedding, BM25 keyword, label match, graph & community signals, and recency/importance decay. See [Search & Relevance](https://mem.nowledge.co/docs/search-relevance).
|
|
188
|
+
|
|
189
|
+
## License
|
|
190
|
+
|
|
191
|
+
MIT
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "openclaw-nowledge-mem",
|
|
3
|
+
"version": "0.2.7",
|
|
4
|
+
"kind": "memory",
|
|
5
|
+
"uiHints": {
|
|
6
|
+
"autoRecall": {
|
|
7
|
+
"label": "Auto-recall at session start",
|
|
8
|
+
"help": "Inject Working Memory briefing and relevant memories when a new session begins"
|
|
9
|
+
},
|
|
10
|
+
"autoCapture": {
|
|
11
|
+
"label": "Auto-capture at session end",
|
|
12
|
+
"help": "Store high-value notes on agent_end / after_compaction / before_reset"
|
|
13
|
+
},
|
|
14
|
+
"maxRecallResults": {
|
|
15
|
+
"label": "Max recall results",
|
|
16
|
+
"help": "How many memories to inject for each recall cycle (1–20)"
|
|
17
|
+
},
|
|
18
|
+
"apiUrl": {
|
|
19
|
+
"label": "Server URL (remote mode)",
|
|
20
|
+
"help": "Leave empty for local mode (default: http://127.0.0.1:14242). Set to your remote server URL for cross-device or team access. See: https://docs.nowledge.co/docs/remote-access"
|
|
21
|
+
},
|
|
22
|
+
"apiKey": {
|
|
23
|
+
"label": "API key (remote mode)",
|
|
24
|
+
"help": "Required when connecting to a remote server. Never logged or passed as a CLI argument — injected as NMEM_API_KEY env var only.",
|
|
25
|
+
"secret": true
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"configSchema": {
|
|
29
|
+
"type": "object",
|
|
30
|
+
"properties": {
|
|
31
|
+
"autoRecall": {
|
|
32
|
+
"type": "boolean",
|
|
33
|
+
"default": true,
|
|
34
|
+
"description": "Inject Working Memory and recalled memories at session start"
|
|
35
|
+
},
|
|
36
|
+
"autoCapture": {
|
|
37
|
+
"type": "boolean",
|
|
38
|
+
"default": false,
|
|
39
|
+
"description": "Enable memory note capture across session lifecycle hooks"
|
|
40
|
+
},
|
|
41
|
+
"maxRecallResults": {
|
|
42
|
+
"type": "integer",
|
|
43
|
+
"default": 5,
|
|
44
|
+
"minimum": 1,
|
|
45
|
+
"maximum": 20,
|
|
46
|
+
"description": "Maximum memories to recall at session start"
|
|
47
|
+
},
|
|
48
|
+
"apiUrl": {
|
|
49
|
+
"type": "string",
|
|
50
|
+
"default": "",
|
|
51
|
+
"description": "Remote server URL. Empty = local (http://127.0.0.1:14242). Example: https://nowledge.example.com"
|
|
52
|
+
},
|
|
53
|
+
"apiKey": {
|
|
54
|
+
"type": "string",
|
|
55
|
+
"default": "",
|
|
56
|
+
"description": "API key for remote access. Stored in plugin config, injected as NMEM_API_KEY env var — never logged."
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"additionalProperties": false
|
|
60
|
+
}
|
|
61
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nowledge/openclaw-nowledge-mem",
|
|
3
|
+
"version": "0.2.7",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Nowledge Mem memory plugin for OpenClaw — local-first knowledge graph memory across all your AI tools",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"openclaw",
|
|
8
|
+
"openclaw-plugin",
|
|
9
|
+
"memory",
|
|
10
|
+
"knowledge-graph",
|
|
11
|
+
"nowledge",
|
|
12
|
+
"nowledge-mem",
|
|
13
|
+
"ai-memory",
|
|
14
|
+
"local-first"
|
|
15
|
+
],
|
|
16
|
+
"author": {
|
|
17
|
+
"name": "Nowledge Labs",
|
|
18
|
+
"email": "hello@nowledge-labs.ai",
|
|
19
|
+
"url": "https://nowledge-labs.ai"
|
|
20
|
+
},
|
|
21
|
+
"license": "MIT",
|
|
22
|
+
"homepage": "https://mem.nowledge.co/docs/integrations/openclaw",
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "https://github.com/nowledge-co/community.git",
|
|
26
|
+
"directory": "nowledge-mem-openclaw-plugin"
|
|
27
|
+
},
|
|
28
|
+
"bugs": {
|
|
29
|
+
"url": "https://github.com/nowledge-co/community/issues"
|
|
30
|
+
},
|
|
31
|
+
"engines": {
|
|
32
|
+
"node": ">=18.0.0"
|
|
33
|
+
},
|
|
34
|
+
"files": [
|
|
35
|
+
"src/",
|
|
36
|
+
"openclaw.plugin.json",
|
|
37
|
+
"README.md",
|
|
38
|
+
"CHANGELOG.md"
|
|
39
|
+
],
|
|
40
|
+
"openclaw": {
|
|
41
|
+
"extensions": ["./src/index.js"]
|
|
42
|
+
},
|
|
43
|
+
"main": "src/index.js",
|
|
44
|
+
"scripts": {
|
|
45
|
+
"lint": "biome check .",
|
|
46
|
+
"format": "biome format --write ."
|
|
47
|
+
},
|
|
48
|
+
"peerDependencies": {
|
|
49
|
+
"openclaw": ">=2026.1.29"
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@biomejs/biome": "^1.9.0"
|
|
53
|
+
}
|
|
54
|
+
}
|