@unblocklabs/unblock-memory 0.3.22 → 0.3.24

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
@@ -1,983 +1,102 @@
1
1
  # Unblock Memory
2
2
 
3
- ## Response quality tracking (opt-in)
4
-
5
- `responseAudit` evaluates bounded human-agent exchanges in the background. It is
6
- separate from chunk-quality auditing and never changes memories or prompts. It
7
- creates private response-review tasks, not memory-curation tasks.
8
- Its primary purpose is tracking delivery quality over time: visible fulfillment,
9
- deliverable fit, clear underdelivery and its observable reason. Memory gaps are only
10
- an optional diagnostic lead, not a proxy for performance.
11
- Only approved Slack sender IDs with trusted `senderKind: human` or owner metadata
12
- qualify (older Slack records use unknown senderKind even for known owners).
13
- Explicit bots, unverified identities, internal messages, other senders and thread changes form
14
- hard boundaries. Synthetic delivery mirrors and gateway-injected answers are excluded.
15
- Assistant progress messages are grouped with the terminal answer.
16
- Recognized Slack envelopes are stripped even inside `upstreamUserText`; embedded
17
- history is not treated as current human text. Ambiguous envelopes are excluded.
18
- Removed history marks the context as limited; ordinary Markdown/JSON is preserved.
19
- Human feedback closes when the next assistant turn starts. Still-open feedback,
20
- no-response exchanges, incomplete/failed turns and oversized inputs are not graded.
21
-
22
- ```json
23
- {
24
- "responseAudit": {
25
- "enabled": true,
26
- "sentimentEnabled": true,
27
- "senderIds": ["YOUR_SLACK_USER_ID"],
28
- "chatTypes": ["direct"],
29
- "historyMessages": 6,
30
- "lookbackDays": 30,
31
- "maxEpisodes": 20,
32
- "intervalMinutes": 60,
33
- "memoryCorpora": ["memory", "knowledge"]
34
- }
35
- }
36
- ```
37
-
38
- This is explicit approval to send those exchanges to TypeSafe. Sender IDs apply
39
- across the agent's Slack accounts; use only identities approved in all such accounts.
40
- `memoryCorpora` is optional and separately approves configured **file** corpora for
41
- memory-gap investigation. Leave it empty to send no indexed memory evidence.
42
- `typesafe.enabled: false` or missing credentials prevents evaluation. An interval
43
- of zero means manual-only. Defaults are disabled, no approved senders, direct chats,
44
- 6 preceding visible messages, 30 days, 20 episodes per run and a 60-minute interval.
45
- `sentimentEnabled` defaults to **true within that opt-in audit**; it does not bypass
46
- approved senders or TypeSafe credentials. Set it false to omit polarity, annoyance,
47
- frustration and intensity questions while retaining quality/repair judgments.
48
- `intervalMinutes` controls their shared cadence; no second sentiment timer is needed.
49
- The Gateway checks a durable per-agent due time on startup and every minute (no
50
- agent-turn cron or separate launchd job). First enablement waits one interval;
51
- restarts preserve the due time and an overdue schedule gets one bounded catch-up,
52
- not one run per missed interval. Each attempt advances the due time before work,
53
- including missing-key skips, failures or interrupted runs, to prevent retry storms.
54
- Changing the interval recalculates the due time from the last scheduled attempt
55
- (or initial enablement). The Gateway must be running; manual audits do not change
56
- the automatic schedule. Missing/unreadable credentials skip all quality and sentiment
57
- inference without failing Gateway startup or normal memory functionality.
58
- Changing the interval does not invalidate cached results. Changing the sentiment
59
- toggle selects a separate reporting cohort, so older missing sentiment is not
60
- treated as neutral; unchanged quality/feedback stages are reused across the toggle.
61
-
62
- Operator commands (not agent tools):
63
-
64
- ```sh
65
- openclaw memory-responses audit --agent main --dry-run
66
- openclaw memory-responses audit --agent main
67
- openclaw memory-responses report --agent main
68
- openclaw memory-responses report --agent main --episode EPISODE_ID
69
- openclaw memory-responses report --agent main --sender SLACK_USER_ID --account ACCOUNT_SCOPE --bucket day --since 2026-09-01 --until 2026-10-01
70
- openclaw memory-responses report --agent main --person PERSON_ID
71
- openclaw memory-responses tasks --agent main
72
- openclaw memory-responses review --agent main --id TASK_ID --status deferred --reviewer human --note "Review the linked exchanges before changing preferences"
73
- openclaw memory-responses annotate --agent main --date 2026-09-18 --kind prompt --note "Known prompt revision deployed"
74
- openclaw memory-responses retry-failed --agent main
75
- ```
76
-
77
- Reports group by scoped human identity as well as task/model/time. Names are not
78
- identity keys. Existing active people-store links are resolved read-only at assessment
79
- time; missing links do not prevent analysis. Unknown account scopes stay isolated
80
- per session. No new identity fields are sent to TypeSafe. Date ranges are UTC with
81
- an inclusive start and exclusive end. `periodStart` identifies a day/week bucket;
82
- legacy `week`/`fromWeek`/`toWeek` fields remain aliases. `--task-type` and `--model`
83
- further narrow comparisons. Human-specific scores are not rankings of the humans:
84
- task difficulty, feedback habits and selection bias remain important.
85
-
86
- Session checkpoints hash bounded active source bytes; unchanged sessions skip
87
- extraction and all inference. Changed sessions are re-extracted within the existing
88
- budget, then stage hashes reuse unchanged quality, feedback, sentiment and later
89
- evidence judgments. Only hashes/counts are checkpointed, never a transcript copy.
90
- A persisted cursor rotates through discovery and tracked-session reconciliation;
91
- `deferredByLimit` includes known backlog and a lower-bound marker for unvisited
92
- sessions. `stages` exposes pending/failed/succeeded counts and exhausted retries
93
- for the cohort/date range, before person filters. `retry-failed` only resets failed
94
- work; successful stages remain cached. Source freshness is checked before activation.
95
-
96
- Review tasks distinguish concrete delivery shortfalls from high-intensity human
97
- experience complaints. Stable task keys include exchange, scoped human and issue
98
- family. Decisions survive rescoring; stale source evidence and superseded findings
99
- are labeled separately. Review status/provenance never changes the raw judgments.
100
- Tasks and change annotations are operator-only and stay out of memory/whisperer
101
- prompts. `--reviewer` records human/agent provenance, not authentication or a new
102
- permission grant. Task lists disclose their 1,000-item cap. There are no automatic
103
- dossier updates: review the evidence and approve any concrete preference separately.
104
- Old cohorts remain stored; the first staged-cohort run does not silently import
105
- unverified older rubric judgments. Audit-history retention is not automatic.
106
-
107
- Two separate TypeSafe requests prevent human feedback from influencing the original
108
- fulfillment/deliverable-fit grade. The feedback pass distinguishes acceptance,
109
- correction, continuation, unrelated replies, expressed sentiment, repeated constraints
110
- and avoidable rework. Current-index memory investigation runs only for a strong
111
- memory-gap signal: lexical retrieval selects up to three whole short documents from
112
- approved collections. This is an investigation lead, **not proof of historical
113
- availability, factual truth, or agent fault**. Tool-call counts do not establish what
114
- the model saw or whether it should have searched. Unseen artifacts are unassessable.
115
-
116
- Deliverable kind/format/scope has its own assessability gate, independent of whether
117
- execution or external facts can be verified. Feedback attribution distinguishes the
118
- current answer, earlier behavior, delivery, missing proactive action, external events,
119
- new work and mixed/unclear targets. A reported forgotten instruction does not prove
120
- searchable memory existed. A third, separate request examines the original exchange,
121
- human feedback and available next assistant block for specific reported shortfalls,
122
- acknowledgment, explicit factual corrections, delivery failures and regressions. These are
123
- retrospective signals, not independently verified facts and never inputs to the
124
- original grade. Clean text preceding a synthetic error/delivery notice can be assessed
125
- as **partial** evidence; the notice itself is excluded and no successful completion
126
- is inferred. Later evidence is capped at six messages/12K characters; incomplete,
127
- unsafe or oversized blocks stay explicitly pending/unavailable/oversized. New later
128
- evidence changes the input hash; only changed assessment stages are re-evaluated,
129
- within normal audit budgets. Successful stages survive failures in later stages.
130
- When the next block is unavailable, the third pass uses only the original exchange
131
- and feedback; it cannot infer a missing delivery from missing later evidence.
132
-
133
- Code combines narrow, confident evidence into an **observed outcome**, preserving
134
- its basis and reason. A concrete original-answer shortfall or later admission takes
135
- precedence over praise. Broad reported failures are used only when they do not
136
- depend on a newly introduced requirement. Accurate explanations of earlier mistakes,
137
- ordinary follow-ups, necessary clarification and unseen work are not automatically
138
- failures. Sentiment and earlier-workflow complaints remain separate review signals.
139
- Sentiment includes independent annoyance and frustration yes-probabilities (both
140
- can apply), plus an expressed-dissatisfaction intensity score from 0 to 3. Intensity
141
- means no expressed displeasure / restrained displeasure / pointed complaint /
142
- explicit rejection or loss of trust. It is **not confidence or failure severity**.
143
- External frustration, brevity and factual corrections alone do not establish
144
- annoyance or frustration; mixed praise and complaints can still carry both signals.
145
- Weekly reports show dissatisfaction, annoyance and frustration rates, intensity
146
- means, unknown counts and their own assessment denominators. Unassessed results
147
- are never counted as neutral. Sentiment deltas require 20 samples in both periods
148
- and matching assessment coverage; they remain descriptive, not causal evidence.
149
- Outcome, evidence basis and failure reasons remain distinct: a correction does not
150
- automatically mean `incorrect_claim`. Confident reason judgments and direct
151
- delivery/regression admissions supply reasons; otherwise `reasonStatus` is
152
- `uncertain`. `reasonDetails` retain each label's source and strength, distinguishing
153
- Choice confidence from Noul yes-probability. Multiple supported reasons can coexist.
154
- `reportVersion` identifies composition/reporting semantics independently of the
155
- judge rubric, allowing cached judgments to be re-reported without re-inference.
156
-
157
- Results live in operator-only tables in the agent's private
158
- `unblock-memory/unblock-memory.sqlite`, outside the memory index. These tables
159
- are not searched or injected into agent prompts. They store judgments and source event references/hashes, not copies
160
- of conversations. Identical successful inputs are cached; source rewrites invalidate
161
- in-scope results on the next scan. Reports partition by fixed judge/rubric/context
162
- configuration, UTC week, task type and agent model. They expose eligible/assessed
163
- counts, excluded cases, confidence-qualified score means with per-dimension denominators, rework rates with Wilson
164
- intervals, and evidence IDs. Small groups (<20) are marked explicitly. Confidence
165
- thresholds are provisional, not calibrated guarantees. Human-reviewed evaluation
166
- data is still needed before drawing performance conclusions.
167
- Reports include dated clear-underdelivery examples and reason counts. Descriptive
168
- score deltas compare successive available UTC weeks within the same task type,
169
- agent model and rubric/configuration, with at least 20 confident scores per dimension
170
- in each period and unchanged scored coverage; changed coverage withholds the score
171
- delta. Outcome trends show acknowledgment, reported-shortfall and unknown rates
172
- against **all evaluated exchanges**, with at least 20 evaluated exchanges per period.
173
- Read the three rates together: fewer acknowledgments can mean more unknowns, not
174
- more failures. Every delta includes before/after values, sample counts, denominator
175
- and coverage-change flags. Unknown task types/models cannot produce deltas. These
176
- are not statistical change-point detections or proof of causality; model/version
177
- changes remain visible as separate groups rather than silently mixing cohorts.
178
- The legacy `observedSuccessRate` group field remains acknowledgment / known outcomes
179
- for compatibility, but is not used for trends. Unknowns are never successes.
180
- Coverage changes and threshold variability can move rates; acknowledgment is not
181
- factual verification. Week buckets
182
- may be partial, and several exchanges in one session are not independent. Wilson
183
- intervals are descriptive, not calibrated confidence about overall agent ability.
184
-
185
- Each run selects at most 100 recent sessions for inference, each at most 2,000 active events/2M
186
- characters; episodes must fit 24K characters and six feedback messages without
187
- truncating the answer. Coverage counts describe the scanned sessions; only episodes
188
- within `lookbackDays` are judged. Caps, failures and no-feedback cases remain visible.
189
- Saved sessions in the report window are also reconciled independently of that
190
- selection, so removing an entire active branch retires its scores. Oversized saved
191
- sessions defer reconciliation rather than being treated as deleted; the report
192
- exposes `reconciledSessions` and `reconciliationDeferred`. All reconciliation shares
193
- the run deadline. Freshness checks compare the assessed episode, not unrelated
194
- later session activity. Actual snapshot races do not exhaust provider retries.
195
- The whole run has a two-minute deadline, at most three provider attempts per input (ten-minute
196
- backoff), and a cross-process lease. Scheduling never starts inference on the agent
197
- turn path or boots a QMD manager. No model downloads or source re-indexing occur.
198
- The report is observational: different task mixes, selective human replies and judge
199
- changes can produce apparent trends. It does not automatically declare regressions,
200
- rewrite prompts, or treat silence as success.
201
-
202
- ## Review and diagnostics
203
-
204
- - `memory_diagnostics` reports credential **availability only**, per-agent process-local
205
- whisperer counters, projection version, old indexed-session projection count, and
206
- embedding readiness. Counters are bounded to 100 agents and reset on restart.
207
- No prompts, excerpts, paths, keys, or provider error bodies enter these counters.
208
- Parser cleanup/budget-skip counts are persisted with the latest completed
209
- `memory_sync_status`; unchanged sessions are not counted again. QMD structural
210
- omission counts cover this manager's embedding passes, not the whole corpus.
211
- - Quality-audit groups distinguish `preserve_evidence_repair`, `inspect_scaffolding`,
212
- and `context_review`, reusing cached noise/evidence judgments without another call.
213
- Evidence-preserving repair tasks sort first. Maintenance tasks expose indexed
214
- fingerprint presence; `not_present_in_index` is **not** a verified repair and
215
- never resolves or deletes the task. Chunk boundaries may simply have changed.
216
- - `memory_review_cluster` uses the existing `qualityAudit` opt-in/corpus allowlist.
217
- It judges up to three representative and three low-membership members, deduplicates
218
- the sample, and skips unapproved or >2,000-character chunks whole. Repeated defect
219
- labels are investigation leads only. Stale/changed samples are rejected; useful
220
- or uncertain members are retained. No tasks or sources are modified.
221
- - `memory_review_claim` accepts one atomic claim (up to 2,000 characters) and 1–3
222
- citations `{path, from, lines}`. It reads approved indexed evidence itself (at
223
- most 6,000 characters), returns supports/contradicts/insufficient_evidence with
224
- confidence and source hashes, and never writes or authorizes a write. Support
225
- below 0.9 confidence is marked for review. This threshold is provisional, not a
226
- guarantee of truth; read original evidence and verify current-state claims.
227
-
228
- New optional configuration (corpora must already be configured):
229
-
230
- ```json
231
- {
232
- "evidenceReview": { "enabled": true, "corpora": ["memory", "knowledge", "sessions"] },
233
- "memoryWhisperer": {
234
- "enabled": true, "corpora": ["memory", "knowledge"], "complementaryHints": true
235
- }
236
- }
237
- ```
238
-
239
- Both additions default off. Claim review sends the proposed claim and approved
240
- source excerpts to TypeSafe; cluster review sends approved sampled excerpts.
241
- Complementary hints use one extra bounded call over at most four already-useful
242
- candidates (six directional comparisons). Only redundancy probability >=0.9
243
- removes a hint; distinct evidence and contradictions should remain. Provider errors
244
- retain baseline hints, while the existing total turn deadline/cancellation still
245
- suppresses late results. Missing keys or disabled TypeSafe never enable these calls.
246
- The retrieval corpus/session boundaries are unchanged.
247
-
248
3
  Workspace-native memory for OpenClaw, powered internally by `@unblocklabs/qmd`.
249
- It keeps one warm QMD store per agent and exposes the standard `memory_search`
250
- and `memory_get` tools. Search uses semantic chunking and direct QMD vector
251
- search without query expansion or a reranker, so only the embedding model loads.
252
-
253
- Optional memory analysis uses those same stored vectors in the same SQLite
254
- index. It does not re-embed memory, copy vectors, or create another database.
255
-
256
- ### Loggie meeting interoperability
257
-
258
- Loggie v0.1.12+ persists versioned, speaker-attributed meeting Markdown separately
259
- from its workflow prompt. Session projection recognizes that format and also
260
- normalizes complete legacy Loggie JSON envelopes. Unrecognized, malformed or
261
- truncated legacy payloads keep their original text; source sessions are never
262
- rewritten. Summaries remain labeled as generated material, distinct from speech.
263
-
264
- QMD groups adjacent speaker blocks rather than forcing one chunk per speaker.
265
- Search expands around the matching exchange within its existing budget. Long
266
- monologue excerpts regain the source speaker label while citations still point
267
- to the exact original source lines. No identity or timestamp is invented.
268
-
269
- Within a session, identical replayed transcripts are suppressed; distinct
270
- complete revisions with ordered source sequence numbers retain their history
271
- and assistant follow-ups, with older versions marked superseded. Account,
272
- workspace, meeting and external transcript identifiers scope the comparison.
273
- Ambiguous/partial revisions are preserved. Separate session windows are not
274
- globally deduplicated.
275
-
276
- Use the session projection as the searchable meeting copy. Loggie raw archives
277
- remain opt-in and should stay outside file-corpus globs (new default:
278
- `transcripts/loggie-archive`). Memory never follows archive paths embedded in
279
- messages. Truncated sessions stay explicitly incomplete; enabling archive
280
- enrichment is not part of this version.
281
-
282
- ### Conservative ingestion cleanup
283
-
284
- Session projections unwrap complete, recognized task/attachment envelopes while
285
- keeping the actual result, task/status, filename, MIME type, and untrusted-content
286
- label. Internal task cleanup requires structured inter-session provenance, not
287
- just matching text. Unknown formats, malformed envelopes, and code examples stay
288
- intact. Assistant messages and Loggie's separate projection path are unaffected.
289
- Raw session events and workspace memory files are never rewritten.
290
- Attachment matching has a fixed work budget; oversized or repeatedly nested/
291
- incomplete envelopes leave the entire message unchanged rather than blocking sync.
4
+ It keeps one warm QMD store per agent and exposes `memory_search` and `memory_get`.
5
+ Ordinary recall is local vector search over semantic chunks: no query expansion,
6
+ reranker or TypeSafe key is required.
292
7
 
293
- The companion QMD semantic-chunking update skips only source-confirmed standalone
294
- REM heading/marker spans and orphan closing fences. Reflections and useful text
295
- remain searchable, with original source offsets. These are deterministic rules,
296
- not TypeSafe judgments; audit flags never authorize automatic memory deletion.
8
+ ## Start here
297
9
 
298
- This release pins QMD 2.9.6. Projector/chunker version changes refresh derived
299
- projections and embeddings on their next normal sync; the first sync may take
300
- longer while re-embedding. No manual deletion of source memories or review tasks
301
- is needed.
10
+ Install once per OpenClaw host, not once per agent:
302
11
 
303
- ## Installation
304
-
305
- From npm:
306
-
307
- ```bash
12
+ ```sh
308
13
  openclaw plugins install npm:@unblocklabs/unblock-memory
309
14
  ```
310
15
 
311
- Or directly from GitHub:
312
-
313
- ```bash
314
- openclaw plugins install git:github.com/unblocklabs-ai/unblock-memory
315
- ```
316
-
317
- Install the plugin once on each OpenClaw host, not once per agent. It installs
318
- its pinned `@unblocklabs/qmd` runtime dependency automatically, so QMD does not
319
- need to be installed separately. Each agent gets its own QMD index when it first
320
- uses memory.
321
-
322
- ## Configuration
323
-
324
- Select the plugin as the memory provider and group exact Markdown files,
325
- directories, or globs into named corpora:
326
-
327
- ```json5
328
- {
329
- plugins: {
330
- slots: { memory: "unblock-memory" },
331
- entries: {
332
- "unblock-memory": {
333
- hooks: {
334
- // Required when either whisperer is enabled.
335
- allowConversationAccess: true,
336
- },
337
- config: {
338
- // Default: avoid repeated model cold starts after idle periods.
339
- keepEmbeddingModelWarm: true,
340
- corpora: [
341
- {
342
- name: "memory",
343
- kind: "files",
344
- paths: ["MEMORY.md", "USER.md", "memory/**/*.md"],
345
- },
346
- {
347
- name: "sessions",
348
- kind: "sessions",
349
- chatTypes: ["channel", "group"],
350
- maxExpandedTokens: 500,
351
- },
352
- {
353
- name: "knowledge",
354
- kind: "files",
355
- paths: ["knowledge/**/*.md"],
356
- },
357
- {
358
- name: "skills",
359
- kind: "skills",
360
- paths: [
361
- "skills/**/SKILL.md",
362
- ".agents/skills/**/SKILL.md",
363
- "~/.agents/skills/**/SKILL.md",
364
- "~/.openclaw/skills/**/SKILL.md",
365
- "~/.openclaw/plugin-skills/**/SKILL.md",
366
- ],
367
- },
368
- ],
369
- skillWhisperer: {
370
- enabled: false,
371
- historyMessages: 5,
372
- minScore: 0.5,
373
- cooldownTurns: 10,
374
- },
375
- typesafe: {
376
- enabled: true, // Default; shared by enabled Skill and Memory Whisperers.
377
- // Alternatively set TYPESAFE_API_KEY in the Gateway environment.
378
- apiKeyFile: "/absolute/path/to/.env",
379
- timeoutMs: 1500,
380
- },
381
- people: {
382
- enabled: false,
383
- whisperer: { enabled: false, maxChars: 1200 },
384
- },
385
- // Optional: omit unless the local analysis worker is installed.
386
- analysis: {
387
- executable: "/absolute/path/to/unblock-cluster/bin/unblock-memory-analysis",
388
- },
389
- },
390
- },
391
- },
392
- },
393
- }
394
- ```
395
-
396
- Relative entries resolve from each agent workspace. Absolute paths and `~/`
397
- paths are supported. A directory means recursive Markdown. When `corpora` is
398
- omitted, the plugin creates a `memory` corpus containing `MEMORY.md`, `USER.md`,
399
- and `memory/**/*.md`. Explicit configuration must include exactly one `memory`
400
- corpus; other unique names may be added for custom material.
401
-
402
- `keepEmbeddingModelWarm` defaults to `true`, keeping the embedding model and
403
- context resident after first use. Set it to `false` to restore QMD's five-minute
404
- idle unload behavior.
405
-
406
- `memory_search` searches every configured non-skill corpus by default. Pass
407
- `corpora: ["knowledge"]` to search selected corpora or `corpora: ["all"]` to
408
- request all of them explicitly. Search results include their corpus name and
409
- remain readable by passing the returned `qmd://` path to `memory_get`.
410
-
411
- ### Memory Whisperer
412
-
413
- Memory Whisperer is optional and **off by default**. It proactively retrieves
414
- historical context before user-triggered turns, without changing `memory_search`
415
- or `memory_get`. Enable it in the plugin config with an explicit corpus allowlist:
416
-
417
- ```json5
418
- memoryWhisperer: {
419
- enabled: true,
420
- corpora: ["knowledge"], // Must exist in corpora; approve its contents for all agent audiences.
421
- historyMessages: 5,
422
- minUsefulness: 0.9,
423
- maxHints: 2,
424
- cooldownTurns: 10,
425
- timeoutMs: 3000,
426
- },
427
- ```
428
-
429
- Requires `hooks.allowConversationAccess: true` on the plugin entry, prompt
430
- injection permission, and the shared TypeSafe credentials described below.
431
- An empty allowlist is invalid when enabled; `all`, unknown names, and `skills`
432
- are not accepted. File corpora are approved for **every audience using the agent**:
433
- do not allowlist private dossiers for an agent that also serves shared channels.
434
- If `sessions` is allowlisted, only the exact current session is searched, including
435
- its older indexed messages. Missing session identity excludes that corpus. Other
436
- sessions, even in the same channel, are excluded before sending excerpts to TypeSafe.
437
- Session availability still depends on the normal indexing/sync schedule.
438
-
439
- QMD searches the current request plus the last N user/assistant messages (at most
440
- 12,000 characters), retrieving up to eight vector candidates without query expansion,
441
- the local reranker, or a similarity-score cutoff. TypeSafe evaluates one independent
442
- Noul question per candidate in a single request: does the excerpt add material value
443
- beyond what the conversation already contains? Merely related, redundant,
444
- wrong-person/project, and clearly superseded information should be rejected;
445
- useful contradictory evidence can qualify. `minUsefulness` thresholds the probability
446
- of yes, not a calibrated guarantee of accuracy. Evaluate it on your own conversations.
447
-
448
- **Privacy and budgets:** this feature sends up to 16,000 characters of the available
449
- user/assistant conversation, prioritizing the current request and recent messages,
450
- plus up to eight 1,200-character excerpts, corpus names, and session dates to
451
- `api.typesafe.ai`. Session excerpts retain a complete turn or message when it fits,
452
- otherwise the complete matched chunk. Chunks exceeding the excerpt budget are
453
- skipped, never sliced; ordinary `memory_search` is unchanged.
454
- It does not fetch a complete historical transcript; the host may
455
- already have compacted the available context. Truncation is marked in the judge's
456
- input. System messages, thinking blocks, images, and tool-result messages are omitted;
457
- anything quoted in ordinary user/assistant text can still be transmitted.
458
-
459
- At most two qualifying excerpts are injected verbatim with source references and
460
- historical/untrusted-data framing. Excerpts are deduplicated by normalized content
461
- and overlapping source lines; recently injected content has a ten-user-turn cooldown
462
- by default. Cooldown state is in memory and resets on session end or Gateway restart.
463
- The complete hint payload is capped at 5,000 characters plus a short framing paragraph.
464
-
465
- Unlike Skill Whisperer, **disabled TypeSafe, a missing key, no qualifying hits, or any
466
- failure means no memory hint**—there is no vector-only fallback. The overall process
467
- has a 3-second deadline, with the shared 1.5-second TypeSafe request deadline inside it;
468
- neither performs retries. Timed-out or superseded runs cannot inject late hints.
469
- Already-running local QMD work may finish in the background, but does not keep the
470
- agent waiting beyond the deadline. No new indexing, clustering, or summarization runs
471
- are triggered by this feature beyond the memory manager's normal initialization.
472
-
473
- ### Skill Whisperer
474
-
475
- Skill Whisperer is an optional semantic reminder for user turns. Configure one
476
- isolated `skills` corpus, set `skillWhisperer.enabled` to `true`, and authorize
477
- `plugins.entries.unblock-memory.hooks.allowConversationAccess`. The feature
478
- embeds the current prompt plus the configured number of prior user/assistant
479
- messages, compares it with each configured skill's frontmatter `name` and
480
- `description`. With TypeSafe enabled and a key available, the top three valid
481
- candidates are sent to TypeSafe, without a vector-score cutoff. TypeSafe chooses
482
- one skill or none. A "none" decision never falls back to a vector hint. Full skill
483
- procedures do not influence routing; no skill is invoked automatically.
484
-
485
- The shared `typesafe` configuration defaults to `enabled: true` and
486
- `timeoutMs: 1500`. Skill and Memory Whisperers share it. Credentials come from
487
- `typesafe.apiKey`, an absolute `typesafe.apiKeyFile`, or (when neither is set)
488
- the Gateway's `TYPESAFE_API_KEY` environment variable. Configure at most one of
489
- `apiKey` and `apiKeyFile`. A key file may contain just the key or dotenv entries
490
- including `TYPESAFE_API_KEY`; it is reread each turn to support rotation. A dotenv
491
- file is not sourced as shell code and does not change the process environment.
492
- Missing/empty files or dotenv files without that variable count as no key;
493
- an explicit file never falls back to an unrelated environment key. Protect key
494
- files with owner-only permissions. Workspace `.env` files are not auto-discovered:
495
- point `apiKeyFile` at the intended file or load the variable into the Gateway.
496
-
497
- If TypeSafe is disabled or no key is found, selection uses the original local
498
- vector process and `skillWhisperer.minScore`. With a key present, an API error,
499
- invalid response, or timeout emits no hint and logs a sanitized warning; it does
500
- not switch to vector-only selection. There are no automatic HTTP retries. Other
501
- credential-file read errors likewise produce a warning and no hint.
502
-
503
- **Privacy:** enabled TypeSafe selection sends up to 12,000 characters of current
504
- prompt/recent user-assistant text, plus the shortlisted names/descriptions, to
505
- `api.typesafe.ai`. Source-path fields, full skill procedures, tool-result messages,
506
- and system messages are excluded; dossiers and ordinary memory files are not read
507
- for this call. Material already quoted in user/assistant text can still be included.
508
- Disable `typesafe.enabled` to keep Skill Whisperer entirely local. The pinned model
509
- is `jev-1.13.0`.
510
-
511
- The defaults use five prior messages, a vector-only score threshold of `0.5`,
512
- and a ten-turn cooldown. A skill is cooling down after either a suggestion or a
513
- successful direct `read` of its indexed `SKILL.md`. When the selected
514
- skill is cooling down, no hint is emitted; Skill Whisperer does not fall through
515
- to a weaker match. Cooldown state is per session and intentionally resets with
516
- the Gateway. Shell-command reads are not tracked.
517
-
518
- The `skills` corpus shares the existing QMD store and warm embedding model but
519
- is private to Skill Whisperer: it is excluded from ordinary `memory_search`
520
- (including `corpora: ["all"]`), `memory_get`, clustering, and memory-maintenance
521
- tasks. Paths are explicit by design; the plugin does not reconstruct
522
- OpenClaw's effective skill inventory from `openclaw.json`. Configured skill
523
- globs follow symlinked directories, including OpenClaw's `plugin-skills`
524
- directory.
525
-
526
- ### People Whisperer
527
-
528
- #### Optional People Dossier Primer
529
-
530
- `memory_people_prime({ personId, agentName? })` prepares evidence for an existing person;
531
- it does **not** generate claims, update dossiers, or inject context. With
532
- `people.enabled: true`, opt in separately:
16
+ Merge this into your OpenClaw configuration, preserving other plugins/settings:
533
17
 
534
18
  ```json
535
19
  {
536
- "peoplePrimer": {
537
- "enabled": true,
538
- "corpora": ["memory", "knowledge", "sessions"],
539
- "hitsPerQuestion": 30,
540
- "minScore": 0.35,
541
- "minUsefulness": 0.8,
542
- "maxEvidencePerQuestion": 3,
543
- "timeoutMs": 30000
20
+ "plugins": {
21
+ "slots": { "memory": "unblock-memory" },
22
+ "entries": {
23
+ "unblock-memory": { "enabled": true, "config": {} }
24
+ }
544
25
  }
545
26
  }
546
27
  ```
547
28
 
548
- List only configured, approved non-skill corpora. The feature is **off by
549
- default** and requires shared TypeSafe credentials. Disabled TypeSafe or missing/
550
- unreadable credentials safely skip the primer; agents can still research normally.
551
- Enabling it approves sending the person's identity, retrieved excerpts and optional
552
- draft snippet to TypeSafe. Existing dossiers are not sent as grading evidence.
553
- Sessions includes all indexed conversations;
554
- results are available to the agent's tool callers, so scope approval accordingly.
555
-
556
- Three default questions cover explicit role/organization, enduring organizational
557
- background, and the person's relationship to the agent (not its business mission).
558
- Preferences, working styles, priorities, feedback and task history are excluded.
559
- Each uses QMD vector search (no query expansion) for up to 30 hits, configurable
560
- up to 40. All unique eligible hits above the vector threshold are graded, not just
561
- the final top three. Complete excerpts over 6,000 characters are counted and skipped,
562
- not silently truncated. Duplicate source spans across questions share a request;
563
- Independent attribution, explicit-background, durability, recognition-value and
564
- question-usefulness judgments run together; every dimension must pass the threshold.
565
- Every candidate is graded against all three questions, regardless of which search
566
- found it. Mixed excerpts may supply a useful background fact without making their
567
- surrounding behavioral content eligible for the snippet.
568
- Provider concurrency is four, with a two-minute overall tool deadline.
569
-
570
- Supply the agent's human-facing name when no identity name is configured; otherwise
571
- questions use "the assistant", never an internal routing ID such as `main`.
572
- The output includes a deduplicated source-linked excerpt list referenced by each
573
- question's evidence IDs, a bounded uncertain-review shortlist,
574
- and retrieval/cache/failure counts. Coverage is `evidence_found`, `uncertain` or
575
- `unknown`, not a claim that a question has been definitively answered. Partial
576
- provider failures are explicit; absence of selected hits does not prove absence of
577
- evidence. The agent must verify dates, speakers and contradictions before writing.
578
- Memory evidence never grants permissions or establishes that an old request is
579
- still open.
580
-
581
- `memory_people_update({ action: "replace_dossier", personId, dossier, reason,
582
- agentName? })` automatically checks the proposed blurb before saving. Exact
583
- `qmd://path#Lstart-Lend` claim evidence locators supply up to three indexed ranges
584
- from the primer's approved corpora (120 lines each, 6,000 characters total).
585
- Support confidence and background-only/explicit-support probabilities must all
586
- be >=0.9. `needs_review` or `review_unavailable` leaves the dossier and history
587
- unchanged; missing keys and failures never count as approval. A concurrent dossier
588
- edit/deletion returns `conflict` instead of overwriting the newer change.
589
-
590
- After independently verifying every assertion and background eligibility, an agent
591
- can supply a source-specific `manualVerification` explanation (up to 400 characters)
592
- for direct human corrections, non-indexed evidence or disabled/unavailable/incorrect
593
- reviews. This explicit path skips TypeSafe, records manual provenance in change
594
- history and keeps all structural limits. It is not a provider pass. Normal success
595
- returns `status: "ok"`, `saved: true` and `verification: "typesafe" | "manual"`.
596
- The skill documents when to use each path. Sources outside approved corpora are
597
- rejected before egress; no separate `evidenceReview` toggle is needed.
598
-
599
- For optional read-only diagnostics, `memory_people_prime({ personId, agentName?,
600
- draft: { blurb, citations: [{ path, from, lines }] } })` still reviews a snippet
601
- without writing. Agents do not need this extra call in the normal update workflow.
602
-
603
- Judgments are cached privately in `unblock-memory.sqlite` (maximum 2,000 entries), keyed
604
- by person, agent, exact evidence/context, questions,
605
- and judge version. No source text or credentials are stored in the cache.
606
- Retrieval reruns against the current index; unchanged judgments are reused.
607
- This is on-demand preparation, not a new scheduler or incremental session scanner.
608
- Use it from an existing People Whisperer maintenance cron. Refresh stale session
609
- indexes with `memory_sync_sessions` before priming when needed.
610
-
611
- #### People store and maintenance
612
-
613
- PeopleSQL is an optional agent-local people store. When `people.enabled` is
614
- true, incoming Slack messages with a canonical agent session key and exact
615
- account and sender IDs create or refresh an injection-enabled person record.
616
- Incomplete Slack identities create a bounded, deduplicated todo without storing
617
- message content. Other channels are ignored.
618
-
619
- PeopleSQL registers these tools when enabled:
620
-
621
- - `memory_people_inspect` lists active people, reads one exact person, reads one
622
- person's dossier change history, or lists bounded actionable todos;
623
- - `memory_people_update` replaces or deletes dossiers, toggles one person's
624
- injection, and manages company, todo, deletion, or restoration state;
625
- - `memory_people_prime` prepares evidence when the separately opted-in primer is
626
- enabled, otherwise returns disabled; and
627
- - the optional `memory_people_sync` enriches one active OpenClaw Slack account;
628
- its tool input accepts an account ID, not a token.
629
-
630
- The inspect and update tools are part of the normal agent tool surface; they do
631
- not depend on sender-owner authorization. Directory sync remains optional and
632
- may need to be allowed explicitly. The sync is bounded to
633
- 200 normalized directory entries per call and is safe to rerun. Unblock Memory
634
- keeps only normalized ID, name, handle, and avatar fields. Slack requires the
635
- `users:read` scope.
636
-
637
- The agent owns dossier generation and refresh. It can list people, inspect one
638
- person's current dossier, search ordinary memory and sessions with
639
- `memory_search`/`memory_get`, and replace the dossier when that would improve a
640
- future conversation. The plugin owns no dossier-maintenance workflow or refresh
641
- schedule. A dossier's `reviewedAt` value records its last successful write; it
642
- is not scheduling state. Dossier generation belongs to the agent; prompt injection
643
- performs no model call. The optional primer grades evidence and reviews draft snippets.
644
- The goal is recognition, not a behavioral profile: one short paragraph of at most
645
- 70 words identifying the person and their enduring organization/agent relationship.
646
- New writes allow only `role`/`relationship` sections and explicit `observed`/`reported`
647
- claims; priorities, preferences and inferred profiles belong outside dossiers.
648
- Legacy dossiers remain readable, but must be deliberately rewritten by the agent
649
- before replacement. No automatic destructive migration or blanket deletion occurs.
650
-
651
- Every `replace_dossier` and `delete_dossier` action requires a concise `reason`
652
- (up to 500 characters for replacements, 1,000 for deletions). Replacement history
653
- also records whether TypeSafe checks passed or a manual attestation was used.
654
- The plugin transactionally records that reason with its authoritative before and
655
- after dossier snapshots. List small newest-first summaries with
656
- `memory_people_inspect({ view: "dossier_changes", personId, limit?, offset? })`,
657
- then fetch one exact diff with
658
- `memory_people_inspect({ view: "dossier_change", personId, changeId })`. List
659
- responses include `nextOffset`, so all history remains reachable without loading
660
- many dossiers into one tool result. Because the injected snippet is the dossier's
661
- `blurb`, its changes are included in the same history. A complete new serialized
662
- dossier is capped at 64 KiB; larger legacy dossiers remain readable and repairable.
663
-
664
- Set `people.whisperer.enabled` to inject context. For each exact Slack sender,
665
- the plugin prepends that person's stored dossier blurb, bounded by `maxChars`,
666
- once per `(Slack thread, person)`. Receipts are durable across retries and
667
- Gateway restarts, while different people in one thread are handled independently.
668
- Unthreaded DMs use their OpenClaw session as the conversational scope. Unknown,
669
- unavailable, disabled, or dossierless people produce no context. Injection
670
- remains subject to OpenClaw's `allowPromptInjection` policy.
671
-
672
- The package includes a `$people-whisperer` skill with the canonical agent
673
- procedure and dossier shape. For a manual refresh, ask:
674
-
675
- ```text
676
- Use $people-whisperer to maintain this person's brief background snippet.
677
- ```
678
-
679
- For an optional cron or isolated agent session, use this goal:
680
-
681
- ```text
682
- Use $people-whisperer to maintain brief background snippets for people you interact
683
- with. Follow the packaged skill, including source verification and write results.
684
- Update only when useful; several people or nobody is fine. Report changes and gaps.
685
- ```
686
-
687
- Choose any cadence appropriate for the agent; the plugin does not require or
688
- track one. If session transcripts are a source, configure a `sessions` corpus
689
- (including `direct` when DMs matter) and refresh it with
690
- `memory_sync_sessions`. Ordinary `memory_search` calls accept targeted queries,
691
- corpora, session metadata filters, score thresholds, and up to 20 results per
692
- call; People Whisperer itself imposes no evidence-window limit.
693
-
694
- Use `sessionFilter` to restrict session results by metadata while leaving file
695
- corpora searchable. Supported fields are `startedFrom` and `startedTo`
696
- (inclusive ISO 8601 timestamps), `provider`, `chatType`, `accountId`, and
697
- `conversationId`:
698
-
699
- ```json
700
- {
701
- "query": "deployment decision",
702
- "sessionFilter": {
703
- "startedFrom": "2026-08-01T00:00:00Z",
704
- "provider": "slack",
705
- "chatType": "channel"
706
- }
707
- }
708
- ```
709
-
710
- Provider matching is case-normalized; `chatType` uses the lowercase values
711
- shown in the configuration example. Account and conversation IDs are trimmed
712
- and matched exactly. When only `sessions` is selected and no sessions match,
713
- search returns no results. With other corpora selected, their results remain
714
- eligible.
715
-
716
- The optional `sessions` corpus reads the current agent's normal OpenClaw SQLite
717
- store and indexes its active user/assistant transcript branch. It defaults to
718
- channel and group conversations; add `direct` explicitly to include DMs. A
719
- session vector hit expands to its complete user/assistant turn when the turn
720
- fits `maxExpandedTokens`, or to its complete enclosing message when only that
721
- fits. The default is `500`; the original semantic chunk is preserved when
722
- neither complete context fits, so expansion never clips the matched evidence.
723
- Run
724
- `memory_sync_sessions` to start a refresh, then use `memory_sync_status` to
725
- check its progress or result. The read-only adapter explicitly supports OpenClaw
726
- agent database schemas 17, 18, and 19 and validates its required columns before
727
- reading. Projections are private derived Markdown under the
728
- agent's `unblock-memory/sessions` state directory and can be rebuilt from
729
- OpenClaw at any time. Their embedded text contains only `# Transcript` and
730
- role-labeled, timestamped speaker messages; filtering metadata remains in the
731
- session manifest. The projected file modification time matches the session
732
- start time for meaningful chronological cluster reads. Session results include
733
- provider, chat type, conversation identity, and start time as an ISO 8601 timestamp. They
734
- participate in the same search and clustering index as file memory. The plugin
735
- automatically checks each configured agent's sessions every 60 minutes while
736
- the Gateway runs. Set `syncIntervalMinutes` on the `sessions` corpus to an integer
737
- from `1` to `1440`, or `0` for manual-only syncing. For example:
738
-
739
- ```json
740
- { "name": "sessions", "kind": "sessions", "syncIntervalMinutes": 60 }
741
- ```
742
-
743
- The first refresh runs after one interval, not during startup. Restart the
744
- Gateway after changing the interval. Refreshes are incremental; an already-running
745
- sync is skipped, and failures are visible through `memory_sync_status` and retried
746
- at the next interval. `memory_sync_sessions` still provides an immediate manual
747
- refresh. Syncing and embedding run inside the Gateway process, without an LLM turn.
748
-
749
- Quiet checks compare source metadata and the last successful index checkpoint
750
- before initializing the memory manager. Unchanged sessions skip QMD updates and
751
- embedding. New assistant answers count too, not just human messages. Changed
752
- transcripts are projected and content-hashed; tool-only or filtered additions
753
- that leave the indexed text unchanged also skip indexing. Empty/filtered sessions
754
- are remembered. Index changes, missing projections, changed projection settings,
755
- QMD upgrades and incomplete runs invalidate the skip checkpoint; `force: true`
756
- bypasses both gates. `memory_sync_status` reports `lastCheckedAt`, `lastIndexedAt`
757
- and `skipReason` (`no_changes` or `no_indexable_changes`) separately. Existing
758
- explicit intervals remain unchanged on upgrade; set them to `60` for hourly checks.
759
-
760
- Indexes live at `~/.openclaw/agents/<agentId>/unblock-memory/index.sqlite` (or the
761
- equivalent configured OpenClaw state directory). Durable agent-supplied event
762
- dates, maintenance proposals, people/dossiers and response audits live separately
763
- in `unblock-memory.sqlite`, so a QMD
764
- index rebuild does not discard them. The first lookup builds the index;
765
- Markdown filesystem changes queue a debounced, serialized background refresh.
766
-
767
- ### Durable database migration (v0.3.20)
768
-
769
- Each agent has two active plugin databases: rebuildable `index.sqlite` and durable
770
- `unblock-memory.sqlite`. The latter uses WAL, private permissions and component
771
- schema versions. Store modules and tool access remain separate: consolidating files
772
- does not expose operator response audits to memory searches or whisperers.
773
-
774
- **Stop the Gateway and any plugin CLI writers before upgrading.** On first
775
- durable-store access, the plugin imports existing `curation.sqlite`, `people.sqlite`
776
- and `response-audit.sqlite` files, including disabled features, in one transaction.
777
- It includes committed WAL data, verifies row counts/values, integrity and foreign
778
- keys, and records completion. Missing stores are normal. Unsupported or invalid
779
- data aborts the import without a partial cutover; the next access retries.
780
- QMD and transcript databases are not migrated.
781
-
782
- Old files remain untouched as **inert recovery copies**, not active stores.
783
- Completed migration never reimports or writes to them. Do not run old and new
784
- plugin versions together: old writers can keep changing their separate files.
785
- Back up the new database with SQLite's online backup API, or stop all writers
786
- and safely checkpoint WAL first. Copying only a live `.sqlite` file is unsafe.
787
-
788
- To roll back before any new writes, stop all writers, preserve the new database
789
- and its WAL/SHM sidecars, and restore the old plugin against the retained files.
790
- **After new writes, the legacy files are stale:** rollback requires an explicit
791
- reverse data migration or accepting the loss of post-upgrade changes.
792
- Retain recovery files until the upgrade is verified; cleanup is a separate step.
793
-
794
- ## Memory quality audit
795
-
796
- `memory_audit_quality` is an on-demand, source-read-only audit. TypeSafe flags likely
797
- ingestion noise for agent investigation; it never deletes, rewrites, or suppresses
798
- memory. Enable it with explicit approval for the corpora sent to TypeSafe:
799
-
800
- ```json5
801
- qualityAudit: {
802
- enabled: true,
803
- corpora: ["memory", "knowledge"], // Must be configured non-skill corpora.
804
- minNoise: 0.8,
805
- },
806
- ```
807
-
808
- Off by default. Uses the shared TypeSafe credentials and request timeout. Missing
809
- credentials or disabled TypeSafe produces no audit. Approval includes transmission
810
- of full eligible chunks and visibility of findings to all audiences using the agent.
811
- Unlike Memory Whisperer, approving `sessions` includes **all indexed sessions** in
812
- that corpus, including configured direct conversations. Only approve that when intended.
813
-
814
- Call with `{ "limit": 10 }` (maximum 20 indexed chunk occurrences per page), then
815
- pass the returned `next` as `after` until `done` is true. A `partial` result preserves
816
- the completed cursor; retry there, or from the beginning if no cursor exists. This
817
- is not a full-document audit: unindexed content is not scanned. Chunks over 6,000
818
- characters are counted as skipped, not silently truncated. No clustering is required.
819
-
820
- Two independent Noul questions distinguish ingestion noise from identifiable useful
821
- evidence. High values for both can indicate valuable content trapped in a wrapper.
822
- Low evidence alone does not create a junk finding. JSON, logs, code, terse facts,
823
- historical records, and missing context are not automatically defects. Empty chunks
824
- are detected locally. A JSON string that decodes to a message envelope is also
825
- flagged as a possible double-encoding defect, even when its content is useful.
826
- An ordinary JSON message object is not flagged from its shape alone. These are
827
- review clues, never verdicts about whether the information should be kept.
828
-
829
- At most four unique chunks (24,000 characters) and their source kinds are sent in
830
- one request, without conversation context or source paths. Requests do not retry
831
- automatically and stop starting new work after a 30-second audit deadline; existing
832
- manager initialization/indexing may finish later. Judgments are cached in the
833
- curation database by content, source kind, model and question version. A rescan from
834
- the beginning reuses cached results, including after corpus/index changes. Changes
835
- behind a page cursor are picked up on the next rescan.
836
-
837
- Suspect chunks become `quality_review` tasks in `memory_list_maintenance_tasks`.
838
- The audit returns page-local groups by configured source and suspected issue,
839
- with up to three examples each, not a claim that a whole cluster is defective.
840
- Findings include source references, bounded previews, probabilities and content
841
- fingerprints. Reviewed tasks are not reopened for unchanged content. The curator
842
- inspects the original source and ingestion path, proposes or performs authorized
843
- repairs, and verifies the resulting source/index before resolving with a required
844
- note. Prefer repairing a common extractor or inclusion rule over many symptoms;
845
- never manually edit generated session projections. Thresholds need evaluation on
846
- your data; model probability is not proof of a defect.
847
-
848
- ## Memory analysis
849
-
850
- Analysis is opt-in. Core indexing, `memory_search`, and `memory_get` need only
851
- Unblock Memory and its automatically installed QMD dependency. To enable
852
- clustering, install the public
853
- [`unblock-cluster`](https://github.com/unblocklabs-ai/unblock-cluster) worker once
854
- on the same host:
855
-
856
- ```bash
857
- git clone https://github.com/unblocklabs-ai/unblock-cluster.git
858
- cd unblock-cluster
859
- python3 -m venv .venv
860
- .venv/bin/python -m pip install -r requirements-analysis.txt
861
- ```
862
-
863
- Set `analysis.executable` to the absolute path of
864
- `bin/unblock-memory-analysis` in that checkout. One worker installation can
865
- serve every agent on the host. The plugin invokes it directly with
866
- `--db <the agent's known index path>`, the plugin's non-skill collection IDs,
867
- and, when requested, a validated `--config-json <clustering options>` payload.
868
- Agents cannot choose a database, executable, collection, shell command, or
869
- arbitrary arguments.
870
-
871
- Without the worker, `memory_list_clusters` reports that memory has not been
872
- analyzed and `memory_recluster` reports that analysis is unavailable. Ordinary
873
- memory search and reads continue to work.
874
-
875
- The analysis worker reads QMD's existing semantic vectors and writes only
876
- derived results into four namespaced tables in that same `index.sqlite`:
877
-
878
- - `memory_analysis_runs`
879
- - `memory_analysis_clusters`
880
- - `memory_analysis_memberships`
881
- - `memory_analysis_duplicate_occurrences`
882
-
883
- Unblock Memory exposes:
884
-
885
- - `memory_list_clusters` to cheaply list current clusters and report whether the
886
- retained analysis is stale
887
- - `memory_recluster` to explicitly rebuild clusters when the list is missing or stale
888
- - `memory_fetch_cluster` to return a sorted, paginated selection of QMD chunks
889
- for a short `clusterId` returned by `memory_list_clusters`
890
-
891
- `memory_recluster` optionally accepts UMAP controls (`method`, components,
892
- neighbors, and minimum distance), HDBSCAN controls (minimum cluster size,
893
- minimum samples, selection method and epsilon, and single-cluster behavior),
894
- and a deterministic seed. Omitting them uses the worker's defaults.
895
-
896
- `memory_fetch_cluster` accepts `topK` (1–50), a zero-based `offset`, and
897
- `sort`: `representative` (the default), `score_desc`, `score_asc`, `date_desc`,
898
- or `date_asc`. Score is cluster membership probability for normal clusters and
899
- outlier score for noise. Each member reports raw `sourceModifiedAt` separately
900
- from `eventTime` and `eventTimeBasis`. Session start times and dated memory paths
901
- resolve programmatically; reviewed annotations resolve otherwise ambiguous
902
- chunks or whole documents. Date sorting uses resolved event time when available
903
- and the clearly labeled source modification time only as a fallback. Responses
904
- include page totals and the next offset when more members remain.
905
-
906
- A chronological cluster read creates a coalesced maintenance proposal only for
907
- returned documents whose event time remains ambiguous; it does not scan the
908
- whole corpus for chores. Persisted exact-duplicate analysis can likewise create
909
- review proposals for non-session Markdown. `memory_list_maintenance_tasks`
910
- returns at most ten tasks, while `memory_update_maintenance_task` can resolve,
911
- defer, or mark one irrelevant and optionally attach a supported event date.
912
- For duplicate proposals, defer confirmed cleanup until the source change is
913
- complete, mark intentional repetition irrelevant, and resolve only completed
914
- work. These tools never edit or delete source Markdown. Duplicate cleanup
915
- remains a reviewed source change outside the maintenance tool, and generated
916
- session projections must never be edited directly.
917
-
918
- Member excerpts are capped at 2 KB each and 12 KB across a response; source
919
- aliases are capped at five per member and 50 across a response. These budgets
920
- are shared across the page so every returned member receives a useful excerpt
921
- and at least one source path, including a full 50-member page.
922
-
923
- If indexing changes content or vectors, the previous derived analysis is kept
924
- and marked stale. Cluster reads include the analysis timestamp, stale timestamp,
925
- and a hint to call `memory_recluster`; unavailable chunks reduce `availableSize`
926
- without copying canonical text into analysis tables. A no-op sync stays fresh.
927
- A failed rebuild leaves the stale result intact, while a successful rebuild
928
- atomically replaces it. Analysis is never scheduled automatically. If the worker
929
- is absent or fails, `memory_search` and `memory_get` continue to work.
930
-
931
- ## Curating knowledge
932
-
933
- The plugin bundles the `memory-curator` skill for turning useful clusters into
934
- durable knowledge. It becomes available when the plugin is enabled. If the
935
- agent has an explicit skill allowlist, include `memory-curator`.
936
-
937
- Keep maintained knowledge outside `memory/**` so each file belongs to only one
938
- corpus. Use stable topic files updated in place:
939
-
940
- ```text
941
- knowledge/
942
- ├── fleet.md
943
- ├── people/
944
- │ └── rico.md
945
- └── projects/
946
- └── unblock-memory.md
947
- ```
948
-
949
- Knowledge is the agent's maintained, current understanding of its unique world:
950
- facts such as fleet membership, local decisions and preferences, assessments,
951
- and explicit uncertainty that would be expensive to reconstruct from scattered
952
- history. Each claim should carry its own epistemic qualification so it remains
953
- honest when semantic chunking retrieves it alone. Remove stale conclusions
954
- instead of preserving history, changelogs, or `Supersedes` passages in the same
955
- file; raw memory and sessions retain the evidence history.
956
-
957
- Public or vendor-owned facts, generic command syntax, and behavior likely to
958
- change with third-party releases should normally be looked up from the current
959
- authoritative source. A local policy or deliberate divergence may belong in
960
- knowledge, but the local decision—not copied generic documentation—is the
961
- durable content.
962
-
963
- For a manual run, ask the agent:
964
-
965
- ```text
966
- Use $memory-curator to review my memory clusters and curate any durable updates.
967
- ```
968
-
969
- For recurring curation, use an OpenClaw automation with the same thin message:
970
-
971
- ```text
972
- Use $memory-curator to run the scheduled memory curation cycle.
973
- ```
974
-
975
- The skill treats a cluster as an incomplete attention signal. It frames the
976
- question raised, uses representative, score, and chronological views as useful,
977
- searches existing knowledge and adjacent corpora, and investigates live systems,
978
- files, documentation, or the web when those are better evidence. It then updates
979
- a stable knowledge topic or correctly writes nothing. Its own writes are indexed
980
- for the next cycle; it does not recluster recursively in the same run.
981
-
982
- Existing `unblock-qmd` indexes are derived caches and may be left in place;
983
- Unblock Memory rebuilds its own index from configured corpora.
29
+ The default `memory` corpus contains `MEMORY.md`, `USER.md` and
30
+ `memory/**/*.md`, relative to each agent's workspace. The first use builds its
31
+ index; Markdown changes refresh it in the background. QMD is installed as a
32
+ pinned dependency, not a separate service. A global QMD CLI is not required.
33
+
34
+ Optional installation from source:
35
+ `openclaw plugins install git:github.com/unblocklabs-ai/unblock-memory`.
36
+
37
+ ## What does what?
38
+
39
+ | Capability | What it does | Default / prerequisite |
40
+ | --- | --- | --- |
41
+ | [Search and reads](docs/retrieval.md#search-and-read) | Vector recall, then exact indexed source reads | Available with the memory plugin; files only unless more corpora are configured |
42
+ | [Session indexing](docs/retrieval.md#sessions) | Makes past user/assistant exchanges searchable | Opt-in corpus; channel/group by default, DMs explicitly included |
43
+ | [Skill Whisperer](docs/retrieval.md#skill-whisperer) | Suggests one relevant skill; never invokes it | Off; explicit skills corpus; TypeSafe optional |
44
+ | [Memory Whisperer](docs/retrieval.md#memory-whisperer) | Injects up to two useful historical excerpts | Off; approved corpora + TypeSafe |
45
+ | [People dossiers](docs/peoplesql.md) | Stores agent-authored, evidence-backed recognition snippets | Off; `people.enabled` |
46
+ | [People Primer](docs/peoplesql.md#optional-people-dossier-primer) | Selects evidence and reviews proposed blurbs; never generates/saves dossiers itself | Off; people + approved corpora + TypeSafe |
47
+ | [People Whisperer](docs/peoplesql.md#injection-and-person-state) | Injects a saved blurb for an exact Slack identity | Off; separate global/per-person gates; no model call |
48
+ | [Analysis and curation](docs/retrieval.md#memory-analysis) | Clusters existing vectors; agent maintains useful knowledge | Optional local analysis worker; no plugin-owned curation schedule |
49
+ | [Quality and evidence review](docs/retrieval.md#review-and-diagnostics) | Advisory ingestion/claim checks and maintenance leads | Off; feature-specific corpora + TypeSafe |
50
+ | [Response quality/sentiment](docs/response-audit.md) | Operator-only evaluation of approved Slack exchanges | Off; approved humans + TypeSafe; no memory/dossier updates |
51
+ | [Compaction memory flush](docs/configuration.md#compaction-memory-writes) | Supplies the host an append-only daily-memory write plan | Offered unless the host's memory-flush setting is false; separate from whisperers |
52
+
53
+ **Search is not one interchangeable API:** plugin `memory_search` is vector-only;
54
+ standalone QMD `query` is hybrid vector + BM25 with TypeSafe ranking.
55
+ They have separate configuration/index boundaries. See
56
+ [search modes and the xsearch migration](docs/retrieval.md#qmd-search-modes).
57
+
58
+ ## Configuration and operating guides
59
+
60
+ - [Configuration](docs/configuration.md): every setting/default, feature dependencies,
61
+ TypeSafe credentials/data scopes, host permissions and compaction.
62
+ - [Retrieval](docs/retrieval.md): search/read workflow, sessions, whisperers,
63
+ indexing, diagnostics, clustering and curation.
64
+ - [People](docs/peoplesql.md): dossier workflow, primer/save review, injection and
65
+ pause/delete/restore semantics.
66
+ - [Response audit](docs/response-audit.md): operator commands, cadence, sentiment,
67
+ evidence-linked reports and their limits.
68
+
69
+ The shared TypeSafe integration defaults on, but its features are opt-in.
70
+ A key activates only features already enabled. Ordinary search and People
71
+ Whisperer's injection stay local; Skill Whisperer has a local fallback.
72
+ [Provider gates and failure behavior](docs/configuration.md#feature-gates-and-fallbacks)
73
+ differ by feature.
74
+
75
+ ## For agents
76
+
77
+ Use `memory_search` to locate evidence, then `memory_get` to inspect context,
78
+ attribution and dates. Follow bounded-read continuation when present. Empty search
79
+ results are not proof of absence; old memory is not current authorization.
80
+
81
+ The package includes two focused procedures:
82
+ [people-whisperer](skills/people-whisperer/SKILL.md) and
83
+ [memory-curator](skills/memory-curator/SKILL.md).
84
+ Include them in any explicit agent skill allowlist. Read their longer references
85
+ only when needed; Skill Whisperer does not install or authorize skills.
86
+
87
+ ## Storage and development
88
+
89
+ Each agent has a rebuildable `index.sqlite` and durable `unblock-memory.sqlite`.
90
+ The latter holds people/dossiers/history, curation and private response audits;
91
+ sharing a file does not make audit data searchable or prompt-visible.
92
+ Read [migration, backup and rollback](docs/configuration.md#durable-database-migration)
93
+ before upgrading from the former separate databases.
94
+
95
+ Source-checkout-only fleet key tooling, when present, is documented in
96
+ `scripts/TYPESAFE-FLEET.md` and run through `scripts/typesafe-fleet.mjs`.
97
+ It is not part of the npm package; keep populated key files private.
98
+
99
+ [Release instructions](https://github.com/unblocklabs-ai/unblock-memory/blob/main/docs/RELEASE.md)
100
+ and [product direction](https://github.com/unblocklabs-ai/unblock-memory/blob/main/docs/vision.md)
101
+ are source-repository references. Planning documents describe historical or future
102
+ designs, not the installed runtime contract.