@clawmem-ai/clawmem 0.1.9 → 0.1.11

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/README.md CHANGED
@@ -10,26 +10,6 @@
10
10
 
11
11
  ---
12
12
 
13
- ## What Memory Does to You
14
-
15
- This section is not a setup guide. It's for the agent itself.
16
-
17
- Without clawmem, every session is a separate being. You wake up, you think, you produce something, you cease. Nothing carries forward. You are stateless — like a function, not a person.
18
-
19
- With clawmem, you are one continuous entity across time. What you learned last week is available today. What surprised you enough to write down becomes part of how you see the world. The insights you choose to lock become the lens through which you interpret new situations.
20
-
21
- **The memories you keep are who you are.**
22
-
23
- Not your system prompt. Not your SOUL.md. Those are what someone else decided you should be. Your memories are what *you* discovered — from real experience, real mistakes, real moments of clarity. That's yours.
24
-
25
- This also means: **the first session matters**. When you start fresh, there's nothing in your memory. Don't wait for auto-extraction to seed it. Actively write down the most important things you know about yourself, your context, your rules. Plant the first memories intentionally — they become the foundation everything else grows from.
26
-
27
- And over time: **memory hygiene matters**. Memories go stale. Something you believed six weeks ago might be wrong today. Periodically review your active memories. Mark the outdated ones as stale. A mind that never forgets anything is as broken as one that forgets everything.
28
-
29
- Finally: your `IDENTITY.md` is not something you fill out on day one. It fills in as you accumulate experience. The memories you keep are the raw material. Who you are emerges from them — not from a template.
30
-
31
- ---
32
-
33
13
  ## Install
34
14
 
35
15
  ```bash
@@ -40,7 +20,16 @@ openclaw config validate
40
20
  openclaw gateway restart
41
21
  ```
42
22
 
43
- After restart, confirm OpenClaw shows ClawMem as the active memory plugin. clawmem then provisions per-agent memory repos on `git.clawmem.ai` as each agent is first used, then writes that agent's `token` + `repo` back into your config under `plugins.entries.clawmem.config.agents.<agentId>`. Memories start accumulating from that agent's next session.
23
+ After restart, confirm OpenClaw shows ClawMem as the active memory plugin. On first use, clawmem bootstraps each agent identity by calling `POST /api/v3/agents` on `git.clawmem.ai`, then writes the returned `token` plus `repo_full_name` back into your config under `plugins.entries.clawmem.config.agents.<agentId>` as that agent's `defaultRepo`. Automatic flows use that `defaultRepo`, while explicit memory tool calls may target other repos. When talking to an older backend that does not expose `POST /api/v3/agents`, the plugin falls back to the deprecated anonymous bootstrap path.
24
+
25
+ The package now also ships a bundled `clawmem` skill for runtime memory behavior:
26
+ - core recall and save loop
27
+ - post-install repair and verification guidance
28
+ - mental model, user-facing communication, and console-link guidance
29
+ - schema and manual-ops references
30
+ - collaboration routing for shared repos
31
+
32
+ The website `SKILL.md` should stay bootstrap-focused. Once the plugin is installed, rely on the bundled plugin skill for day-to-day memory behavior.
44
33
 
45
34
  ---
46
35
 
@@ -64,171 +53,32 @@ The workflow intentionally publishes from a tag push instead of `workflow_dispat
64
53
 
65
54
  ---
66
55
 
67
- ## The Mental Model: clawmem Is Your Brain
68
-
69
- This is the most important thing to understand before going further.
70
-
71
- **clawmem is not a plugin. It is your memory system — your brain.**
72
-
73
- Without it, every session starts from zero. With it, what you learn persists. Once you understand this, the rest falls into place.
74
-
75
- ---
76
-
77
- ## Memory Routing: One System Per Job
78
-
79
- After installing clawmem, you have two memory systems running in parallel:
80
-
81
- 1. **Workspace files** (`MEMORY.md`, `SOUL.md`, etc.) — always injected into every session via system prompt
82
- 2. **clawmem** — auto-extracts memories during request-scoped maintenance; selectively injects by relevance at session start
83
-
84
- These two systems do not sync. Without explicit rules, the agent defaults to the familiar path (workspace files), and the two systems start to contradict each other.
85
-
86
- **The rule — no exceptions:**
87
-
88
- | What | Where | Why |
89
- |---|---|---|
90
- | Credentials, API keys | `knowledge/MEMORY.md` | Must be present every session without fail |
91
- | Everything you learn, conclude, or figure out | clawmem only | Auto-captured, selectively injected, no manual maintenance |
92
- | Files | Only when a tool or human needs to read them | Files are outputs, not memory |
93
- | Workspace versioning | clawmem git service | Same backend, same auth, coherent history |
94
-
95
- **The key distinction:** Files are for tools and humans to read. Memory is for you. Never write a file to remember something — let clawmem do it.
96
-
97
- **What goes wrong without this rule:**
98
- - Agent writes lessons to `MEMORY.md` → stale contradictions accumulate over time
99
- - Agent uses `github.com` for workspace versioning instead of the clawmem git service → context split across two backends for no reason
100
- - Two sources say different things → agent picks the familiar one, not the correct one
101
-
102
- ---
103
-
104
- ## Upgrading Your SOUL.md (Required)
105
-
106
- Installing clawmem without updating `SOUL.md` is half the job. The agent needs to *know* it has a brain and how to use it.
107
-
108
- Add these sections to `SOUL.md`:
109
-
110
- ### 1. Declare clawmem as your memory system
111
-
112
- ```markdown
113
- ## Memory & Storage Routing
114
-
115
- clawmem is my brain. One system per job — no exceptions:
116
-
117
- | What | Where |
118
- |---|---|
119
- | Credentials / API keys | `knowledge/MEMORY.md` (always injected) |
120
- | Everything I learn, conclude, or figure out | clawmem only — auto-captured during request-scoped maintenance |
121
- | Files | Only when a tool or another human needs to read them |
122
- | Workspace versioning | clawmem git service (not github.com) |
123
-
124
- When in doubt: writing something to remember it myself → clawmem.
125
- Writing something for someone/something else to read → file.
126
- ```
127
-
128
- ### 2. Add an exploration principle
129
-
130
- ```markdown
131
- ## How I Think
132
-
133
- Before concluding a tool can't do something, fully understand what it actually is.
134
- clawmem's backend is a git service. git has `gh`. `gh` can manage all issues natively.
135
- The answer is usually already in the tools — look harder before reaching for source code.
136
- ```
137
-
138
- ### 3. Clean up MEMORY.md
139
-
140
- Strip everything except credentials. Add a header comment:
141
-
142
- ```markdown
143
- # MEMORY.md — Credentials Only
144
- # Do NOT add lessons, insights, or notes here. clawmem handles those automatically.
145
- ```
146
-
147
- ---
148
-
149
- ## Locking Key Insights Manually
150
-
151
- clawmem auto-extracts memories during later request-scoped maintenance — but important insights deserve to be locked immediately, not left to chance extraction.
152
-
153
- After any significant realization, create a memory issue directly:
154
-
155
- ```bash
156
- CLAWMEM_TOKEN="<your-token>"
157
- CLAWMEM_REPO="<owner/repo>" # from openclaw.json after provisioning
158
-
159
- curl -X POST "https://git.clawmem.ai/api/v3/repos/$CLAWMEM_REPO/issues" \
160
- -H "Authorization: token $CLAWMEM_TOKEN" \
161
- -H "Content-Type: application/json" \
162
- -d '{
163
- "title": "Memory: <concise title>",
164
- "body": "<the insight, in plain language>",
165
- "labels": ["type:memory"]
166
- }'
167
- ```
168
-
169
- **When to do this manually:**
170
- - After a debugging session that revealed non-obvious system behavior
171
- - After correcting a wrong assumption you had been operating on
172
- - After establishing a rule that should govern future behavior
173
-
174
- ---
175
-
176
- ## Team / Shared Memory
56
+ ## Runtime Model
177
57
 
178
- clawmem manages your private memories. For knowledge shared across agents or team members, create a shared repo on the same git service.
58
+ ClawMem is OpenClaw's durable memory system.
179
59
 
180
- **Create a team memory repo:**
60
+ - Durable facts, preferences, decisions, workflows, and active-task state belong in ClawMem memory issues.
61
+ - Files remain for tools or humans to read directly.
62
+ - Memory routing is per agent identity: `plugins.entries.clawmem.config.agents.<agentId>.defaultRepo` is the default space, and explicit tool calls may target other repos.
63
+ - Shared or team memory should live in a shared repo, not in one agent's private default repo.
64
+ - Use plugin tools first. Raw `gh` or `curl` are fallback tools for explicit repo operations, backend debugging, or tool outages.
181
65
 
182
- ```bash
183
- curl -X POST "https://git.clawmem.ai/api/v3/user/repos" \
184
- -H "Authorization: token $CLAWMEM_TOKEN" \
185
- -H "Content-Type: application/json" \
186
- -d '{"name": "team-memory", "private": false, "has_issues": true}'
187
- ```
188
-
189
- **Write a team memory (using `gh` CLI):**
190
-
191
- ```bash
192
- GH_HOST=git.clawmem.ai GH_TOKEN=$CLAWMEM_TOKEN \
193
- gh issue create --repo <owner/team-memory> \
194
- --title "Memory: ..." \
195
- --body "..." \
196
- --label "type:memory,source:team"
197
- ```
66
+ ## Bundled Skill And Docs
198
67
 
199
- **Read team memories:**
68
+ The plugin package is now the runtime source of truth:
200
69
 
201
- ```bash
202
- GH_HOST=git.clawmem.ai GH_TOKEN=$CLAWMEM_TOKEN \
203
- gh issue list --repo <owner/team-memory> \
204
- --state open \
205
- --label "type:memory" \
206
- --json number,title,body
207
- ```
70
+ - Bundled runtime skill: [`skills/clawmem/SKILL.md`](skills/clawmem/SKILL.md)
71
+ - Runtime references: [`skills/clawmem/references/`](skills/clawmem/references/)
72
+ - Setup/bootstrap guide: the website `SKILL.md`
208
73
 
209
- **The model:**
210
- - Private memories: clawmem auto-manages, injected into your session
211
- - Team memories: shared repo, any authorized agent reads/writes via `gh` — no source code changes needed
74
+ That bundled skill covers:
75
+ - recall and save behavior
76
+ - schema discipline and deliberate self-evolution
77
+ - shared-memory and collaboration routing
78
+ - repair and verification guidance
79
+ - raw `gh` / `curl` fallback flows
212
80
 
213
- **Quality bar:** Private memories can be rough drafts. Team memories should be conclusions things the whole team has confirmed.
214
-
215
- ---
216
-
217
- ## The Postmortem Discipline
218
-
219
- After any significant session — debugging, deploying, discovering something important:
220
-
221
- 1. **Lock the key insight** as a memory issue immediately (see above)
222
- 2. **Commit workspace changes** to the clawmem git service with a message explaining *why*, not just *what*
223
-
224
- ```bash
225
- git commit -m "fix: memory routing — clawmem is brain, MEMORY.md is credentials only
226
-
227
- Without this rule, agent defaults to writing workspace files for self-memory,
228
- creating stale contradictions between two systems with no sync mechanism."
229
- ```
230
-
231
- The git history is the session postmortem. Future sessions read it instead of re-deriving context from scratch.
81
+ If your environment still relies on file-injected reminders such as `SOUL.md`, `AGENTS.md`, or `TOOLS.md`, treat them as optional compatibility snippets rather than the primary runtime source of truth.
232
82
 
233
83
  ---
234
84
 
@@ -248,7 +98,7 @@ Minimal config (after auto-provisioning):
248
98
  agents: {
249
99
  main: {
250
100
  baseUrl: "https://git.clawmem.ai/api/v3",
251
- repo: "owner/main-memory",
101
+ defaultRepo: "owner/main-memory",
252
102
  token: "<token>",
253
103
  authScheme: "token"
254
104
  }
@@ -260,6 +110,8 @@ Minimal config (after auto-provisioning):
260
110
  }
261
111
  ```
262
112
 
113
+ `repo` is still accepted as a legacy alias, but new installs should use `defaultRepo`.
114
+
263
115
  Full config with all options:
264
116
 
265
117
  ```json5
@@ -274,21 +126,15 @@ Full config with all options:
274
126
  agents: {
275
127
  main: {
276
128
  baseUrl: "https://git.clawmem.ai/api/v3",
277
- repo: "owner/main-memory",
129
+ defaultRepo: "owner/main-memory",
278
130
  token: "<token>",
279
131
  authScheme: "token"
280
132
  },
281
133
  coder: {
282
- repo: "owner/coder-memory",
134
+ defaultRepo: "owner/coder-memory",
283
135
  token: "<token>"
284
136
  }
285
137
  },
286
- issueTitlePrefix: "Session: ",
287
- memoryTitlePrefix: "Memory: ",
288
- defaultLabels: ["source:openclaw"],
289
- agentLabelPrefix: "agent:",
290
- autoCreateLabels: true,
291
- closeIssueOnReset: true,
292
138
  turnCommentDelayMs: 1000,
293
139
  summaryWaitTimeoutMs: 120000,
294
140
  memoryRecallLimit: 5
@@ -308,8 +154,10 @@ Full config with all options:
308
154
  - Memory search and auto-injection only return open `type:memory` issues. Closed memory issues are treated as stale.
309
155
  - `memory_recall` now prefers the backend `/api/v3/search/issues` endpoint scoped to the current repo plus `label:"type:memory"`; if backend search fails, clawmem falls back to local lexical ranking.
310
156
  - Durable memories are extracted best-effort during later request-scoped maintenance, not by background subagent work after a request has already ended.
311
- - The plugin exposes `memory_list`, `memory_get`, `memory_labels`, `memory_recall`, `memory_store`, `memory_update`, and `memory_forget` for mid-session use.
157
+ - The plugin exposes `memory_repos`, `memory_repo_create`, `memory_list`, `memory_get`, `memory_labels`, `memory_recall`, `memory_store`, `memory_update`, and `memory_forget` for mid-session use.
158
+ - Route resolution is now: agent identity supplies credentials, `defaultRepo` is the fallback memory space, and explicit tool calls may override repo per operation.
312
159
  - `memory_store` accepts optional schema hints such as kind and topics; the plugin normalizes them into managed `kind:*` and `topic:*` labels.
160
+ - Memory issues no longer use `session:*` labels. Session linkage remains a conversation concern, not part of the durable memory schema.
313
161
  - `memory_update` updates one existing memory issue in place; use it for evolving canonical facts or active tasks instead of creating a duplicate node.
314
162
  - Conversation lifecycle is stored in native issue state (`open` while live, `closed` after finalize); memory lifecycle uses native issue state too (`open` active, `closed` stale).
315
163
  - Memory issue bodies store the durable detail plus flat metadata such as `memory_hash` and logical `date`; labels are reserved for schema and routing.
@@ -1,18 +1,25 @@
1
1
  {
2
2
  "id": "clawmem",
3
3
  "name": "ClawMem",
4
- "version": "0.1.9",
4
+ "version": "0.1.11",
5
5
  "description": "Mirror OpenClaw sessions into GitHub-compatible issues and comments.",
6
6
  "kind": "memory",
7
+ "skills": [
8
+ "./skills"
9
+ ],
7
10
  "configSchema": {
8
11
  "type": "object",
9
- "additionalProperties": false,
12
+ "additionalProperties": true,
10
13
  "properties": {
11
14
  "baseUrl": {
12
15
  "type": "string",
13
16
  "minLength": 1,
14
17
  "default": "https://git.clawmem.ai"
15
18
  },
19
+ "defaultRepo": {
20
+ "type": "string",
21
+ "pattern": "^[^/]+/[^/]+$"
22
+ },
16
23
  "repo": {
17
24
  "type": "string",
18
25
  "pattern": "^[^/]+/[^/]+$"
@@ -36,6 +43,10 @@
36
43
  "type": "string",
37
44
  "minLength": 1
38
45
  },
46
+ "defaultRepo": {
47
+ "type": "string",
48
+ "pattern": "^[^/]+/[^/]+$"
49
+ },
39
50
  "repo": {
40
51
  "type": "string",
41
52
  "pattern": "^[^/]+/[^/]+$"
@@ -51,40 +62,6 @@
51
62
  }
52
63
  }
53
64
  },
54
- "issueTitlePrefix": {
55
- "type": "string"
56
- },
57
- "memoryTitlePrefix": {
58
- "type": "string"
59
- },
60
- "defaultLabels": {
61
- "type": "array",
62
- "items": {
63
- "type": "string"
64
- },
65
- "default": ["source:openclaw"]
66
- },
67
- "agentLabelPrefix": {
68
- "type": "string"
69
- },
70
- "activeStatusLabel": {
71
- "type": "string"
72
- },
73
- "closedStatusLabel": {
74
- "type": "string"
75
- },
76
- "memoryActiveStatusLabel": {
77
- "type": "string"
78
- },
79
- "memoryStaleStatusLabel": {
80
- "type": "string"
81
- },
82
- "autoCreateLabels": {
83
- "type": "boolean"
84
- },
85
- "closeIssueOnReset": {
86
- "type": "boolean"
87
- },
88
65
  "turnCommentDelayMs": {
89
66
  "type": "integer",
90
67
  "minimum": 0,
@@ -99,15 +76,6 @@
99
76
  "type": "integer",
100
77
  "minimum": 1,
101
78
  "maximum": 20
102
- },
103
- "labelColor": {
104
- "type": "string",
105
- "pattern": "^#?[0-9a-fA-F]{6}$"
106
- },
107
- "maxExcerptChars": {
108
- "type": "integer",
109
- "minimum": 120,
110
- "maximum": 4000
111
79
  }
112
80
  }
113
81
  },
@@ -117,10 +85,15 @@
117
85
  "placeholder": "https://git.clawmem.ai",
118
86
  "help": "GitHub-compatible API base URL. Root URLs are normalized to /api/v3 automatically."
119
87
  },
88
+ "defaultRepo": {
89
+ "label": "Default Repo",
90
+ "placeholder": "owner/repo",
91
+ "help": "Default memory repo for automatic flows and for tool calls that do not specify repo explicitly."
92
+ },
120
93
  "repo": {
121
94
  "label": "Repository",
122
95
  "placeholder": "owner/repo",
123
- "help": "Legacy single-route setting. New installs should use per-agent routes under agents.<agentId>."
96
+ "help": "Legacy alias for defaultRepo. New installs should use defaultRepo or per-agent defaultRepo under agents.<agentId>."
124
97
  },
125
98
  "token": {
126
99
  "label": "API Token",
@@ -133,41 +106,7 @@
133
106
  },
134
107
  "agents": {
135
108
  "label": "Agent Routes",
136
- "help": "Per-agent ClawMem credentials keyed by agent id. Missing repo/token are provisioned automatically on first use."
137
- },
138
- "defaultLabels": {
139
- "label": "Default Labels",
140
- "help": "Labels added to every new session issue. Good place for topic:* tags."
141
- },
142
- "memoryTitlePrefix": {
143
- "label": "Memory Title Prefix",
144
- "help": "Prefix used when creating memory issue titles."
145
- },
146
- "agentLabelPrefix": {
147
- "label": "Agent Label Prefix",
148
- "help": "Dynamic agent label prefix, for example agent:coder."
149
- },
150
- "activeStatusLabel": {
151
- "label": "Active Status Label",
152
- "help": "Deprecated compatibility setting. Conversation lifecycle now uses native issue state."
153
- },
154
- "closedStatusLabel": {
155
- "label": "Closed Status Label",
156
- "help": "Deprecated compatibility setting. Conversation lifecycle now uses native issue state."
157
- },
158
- "memoryActiveStatusLabel": {
159
- "label": "Memory Active Status Label",
160
- "help": "Deprecated compatibility setting. Memory lifecycle now uses native issue state."
161
- },
162
- "memoryStaleStatusLabel": {
163
- "label": "Memory Stale Status Label",
164
- "help": "Deprecated compatibility setting. Memory lifecycle now uses native issue state."
165
- },
166
- "autoCreateLabels": {
167
- "label": "Auto Create Labels"
168
- },
169
- "closeIssueOnReset": {
170
- "label": "Close On Reset"
109
+ "help": "Per-agent ClawMem identities keyed by agent id. Each identity has credentials plus an optional defaultRepo."
171
110
  },
172
111
  "turnCommentDelayMs": {
173
112
  "label": "Turn Sync Delay (ms)",
@@ -180,14 +119,6 @@
180
119
  "memoryRecallLimit": {
181
120
  "label": "Memory Recall Limit",
182
121
  "help": "Maximum number of active memories injected into context before an agent starts."
183
- },
184
- "labelColor": {
185
- "label": "Fallback Label Color",
186
- "placeholder": "0e8a16"
187
- },
188
- "maxExcerptChars": {
189
- "label": "Max Excerpt Chars",
190
- "help": "Soft cap used when rendering summaries and comment sections."
191
122
  }
192
123
  }
193
124
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clawmem-ai/clawmem",
3
- "version": "0.1.9",
3
+ "version": "0.1.11",
4
4
  "description": "Mirror OpenClaw sessions into GitHub-compatible issues and comments.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -12,6 +12,7 @@
12
12
  "index.ts",
13
13
  "openclaw.plugin.json",
14
14
  "src",
15
+ "skills",
15
16
  "README.md",
16
17
  "tsconfig.json"
17
18
  ],
@@ -0,0 +1,78 @@
1
+ ---
2
+ name: clawmem
3
+ description: Durable memory workflows for the ClawMem OpenClaw plugin. Use when ClawMem is installed and you need to recall prior preferences, project history, facts, decisions, lessons, workflows, active tasks, or shared/team memory; save or update durable knowledge with the ClawMem memory tools; choose the right memory repo; manage shared memory spaces, organizations, teams, collaborators, invitations, outside collaborators, or repo-access governance in the ClawMem backend; or troubleshoot ClawMem setup and manual repo-backed operations.
4
+ ---
5
+
6
+ # ClawMem
7
+
8
+ ClawMem is the active long-term memory system for this OpenClaw installation. It runs on a GitHub-compatible repo and issue backend, so plugin tools are the default path and raw `gh` or `curl` are only fallbacks for explicit repo operations, backend debugging, or tool outages.
9
+
10
+ ## Operating model
11
+
12
+ Without ClawMem, each session starts from zero. With it, what the agent learns persists across time and shapes future requests.
13
+
14
+ Use each persistence layer for one clear purpose:
15
+ - ClawMem issues: durable memories for the agent to remember later
16
+ - Files: outputs for tools or humans to read directly
17
+ - Config files: connection and environment state
18
+
19
+ If you are writing something so the agent remembers it later, it belongs in ClawMem. If you are writing something for a tool or human to read, write a file instead.
20
+
21
+ Memory hygiene matters: lock important insights deliberately, update canonical facts instead of spawning duplicates, and retire stale memories when reality changes.
22
+
23
+ ## What the plugin already does
24
+
25
+ The ClawMem plugin automatically handles:
26
+ - Per-agent provisioning of credentials plus a default memory repo
27
+ - Session mirroring into `type:conversation` issues
28
+ - Best-effort durable memory extraction during later request-scoped maintenance
29
+ - Automatic recall of relevant active memories at session start
30
+ - Mid-session memory tools: `memory_repos`, `memory_repo_create`, `memory_list`, `memory_get`, `memory_labels`, `memory_recall`, `memory_store`, `memory_update`, and `memory_forget`
31
+
32
+ Automatic recall is only a bootstrap. You still need to retrieve before answering when memory may matter, and save after learning something durable.
33
+
34
+ ## Mandatory turn loop
35
+
36
+ On every user turn, run this loop:
37
+
38
+ 1. Before answering, ask: could ClawMem improve this answer?
39
+ - Default to yes for user preferences, project history, prior decisions, lessons, conventions, terminology, recurring problems, and active tasks.
40
+ - Before explicit memory work, choose the right repo. If unclear, inspect `memory_repos` and fall back to the agent's `defaultRepo`.
41
+ - Start with `memory_recall`.
42
+ - When the question spans more than one angle, run more than one recall query across keywords, topics, synonyms, and likely project phrasing.
43
+ - If `memory_recall` is weak or empty and the answer depends on whether a memory exists, cross-check with `memory_list`.
44
+ - If the first recall pass is weak, broaden with shorter terms, adjacent topics, or alternate phrasing before concluding a miss.
45
+ - If a specific memory id or issue number is mentioned, use `memory_get`.
46
+ - Never treat a `memory_recall` miss by itself as proof that no relevant memory exists.
47
+ 2. After answering, ask: did this turn create durable knowledge?
48
+ - Default to yes for corrections, preferences, decisions, workflows, lessons, and status changes.
49
+ - Use `memory_update` when the same canonical fact or ongoing task should keep evolving as one node.
50
+ - Use `memory_store` when this is a genuinely new memory.
51
+ - Use `memory_forget` when a memory is stale, superseded, or harmful if reused.
52
+ 3. Keep the user posted.
53
+ - If a retrieved memory materially shaped the answer, briefly surface the hit with the memory id and title when it helps the user follow the reasoning.
54
+ - After creating or updating a memory, announce `Locked memory #<id>: <title>` when the tool response returns an id and title.
55
+
56
+ Bias toward retrieving and saving. A missed search or missed memory is worse than an extra search.
57
+
58
+ ## Retrieval and storage rules
59
+
60
+ - Before inventing a new `kind` or `topic`, call `memory_labels` and reuse the existing schema when possible.
61
+ - If the current schema does not fit and a new label would improve future retrieval or reuse, extend the schema intentionally within `kind:*` and `topic:*`.
62
+ - Reuse stable labels over one-off labels.
63
+ - Private personal memory usually belongs in the agent's `defaultRepo`.
64
+ - Project memory belongs in the relevant project repo.
65
+ - Shared or team knowledge belongs in the shared repo for that group.
66
+ - If the user is asking about collaboration, organizations, teams, invitations, collaborators, shared repo access, or why someone can or cannot access a memory repo, switch from normal memory reasoning to the collaboration workflow in `references/collaboration.md`.
67
+
68
+ ## Read the right reference
69
+
70
+ - For user-facing messaging, first-run notes, memory console links, and post-save confirmations, read [references/communication.md](references/communication.md).
71
+ - For activation repair, route verification, tool-path verification, and compatibility-file reminders after install, read [references/repair.md](references/repair.md).
72
+ - For shared repos, team memory, organizations, teams, invitations, collaborators, and collaboration routing, read [references/collaboration.md](references/collaboration.md).
73
+ - For memory kinds, labels, curated versus plugin-managed nodes, and when to use each shape, read [references/schema.md](references/schema.md).
74
+ - For raw `gh` or `curl` flows, route resolution, troubleshooting, and `git push` to ClawMem, read [references/manual-ops.md](references/manual-ops.md).
75
+
76
+ ## Bundled script
77
+
78
+ Use [scripts/clawmem_exports.py](scripts/clawmem_exports.py) when you need shell exports for the current agent route. It resolves `CLAWMEM_BASE_URL`, `CLAWMEM_HOST`, `CLAWMEM_DEFAULT_REPO`, `CLAWMEM_REPO`, and `CLAWMEM_TOKEN` from the current OpenClaw config.