@unblocklabs/unblock-memory 0.10.2 → 0.10.3
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 +10 -7
- package/dist/src/diagnostics.d.ts +6 -1
- package/dist/src/diagnostics.js +1 -1
- package/dist/src/manager.d.ts +6 -1
- package/dist/src/memory-search.d.ts +8 -2
- package/dist/src/memory-search.js +18 -2
- package/dist/src/plugin.js +21 -14
- package/dist/src/retrieval-telemetry.d.ts +7 -2
- package/dist/src/retrieval-telemetry.js +3 -2
- package/docs/configuration.md +1 -1
- package/docs/retrieval.md +34 -7
- package/openclaw.plugin.json +1 -1
- package/package.json +6 -2
package/README.md
CHANGED
|
@@ -8,8 +8,9 @@ keyword or vector similarity.
|
|
|
8
8
|
|
|
9
9
|
## Quick start
|
|
10
10
|
|
|
11
|
-
**Requirements:** Node.js 22
|
|
12
|
-
[TypeSafe](https://docs.typesafe.ai) API key
|
|
11
|
+
**Requirements:** Node.js 22+ and OpenClaw 2026.8.1-beta.3 or later.
|
|
12
|
+
A [TypeSafe](https://docs.typesafe.ai) API key enables usefulness ranking; without
|
|
13
|
+
it, explicit search returns labeled local search leads.
|
|
13
14
|
|
|
14
15
|
1. Install once per OpenClaw host, not once per agent:
|
|
15
16
|
|
|
@@ -17,7 +18,7 @@ keyword or vector similarity.
|
|
|
17
18
|
openclaw plugins install npm:@unblocklabs/unblock-memory
|
|
18
19
|
```
|
|
19
20
|
|
|
20
|
-
2.
|
|
21
|
+
2. For usefulness ranking, save your TypeSafe key in a private file (`chmod 600`), for example
|
|
21
22
|
`~/.openclaw/secrets/unblock-memory-typesafe.env`:
|
|
22
23
|
|
|
23
24
|
```dotenv
|
|
@@ -88,13 +89,15 @@ come back with their source location.
|
|
|
88
89
|
|
|
89
90
|
The agent then calls `memory_get` with that `path` to read the surrounding
|
|
90
91
|
context, attribution and dates. Search defaults to 5 results with a usefulness
|
|
91
|
-
score of at least 0.7.
|
|
92
|
-
|
|
92
|
+
score of at least 0.7 when TypeSafe is available. If ranking is unavailable,
|
|
93
|
+
search returns unjudged local leads with a warning; the usefulness threshold
|
|
94
|
+
is not applied. Automatic Memory Whisperer hints still require TypeSafe.
|
|
95
|
+
See [search and read](docs/retrieval.md#search-and-read) for every parameter.
|
|
93
96
|
|
|
94
97
|
**What leaves your machine:** indexing, embeddings, storage and `memory_get` run
|
|
95
98
|
locally. `memory_search` sends the search question and candidate passages, with
|
|
96
|
-
their paths and dates, to TypeSafe for scoring. Optional TypeSafe
|
|
97
|
-
only what their own settings approve; see
|
|
99
|
+
their paths and dates, to TypeSafe for scoring when available. Optional TypeSafe
|
|
100
|
+
features send only what their own settings approve; see
|
|
98
101
|
[TypeSafe data scope](docs/configuration.md#typesafe-data-scope).
|
|
99
102
|
|
|
100
103
|
**On by default:** search and read over the `memory` corpus, and a
|
|
@@ -102,9 +102,10 @@ export declare class WhispererDiagnostics {
|
|
|
102
102
|
failed?: number | undefined;
|
|
103
103
|
empty?: number | undefined;
|
|
104
104
|
timed_out?: number | undefined;
|
|
105
|
+
degraded?: number | undefined;
|
|
105
106
|
};
|
|
106
107
|
slowestRecent: {
|
|
107
|
-
outcome: "cancelled" | "ok" | "partial" | "skipped" | "failed" | "empty" | "timed_out";
|
|
108
|
+
outcome: "cancelled" | "ok" | "partial" | "skipped" | "failed" | "empty" | "timed_out" | "degraded";
|
|
108
109
|
setupMs?: number | undefined;
|
|
109
110
|
queueWaitMs?: number | undefined;
|
|
110
111
|
metadataMs?: number | undefined;
|
|
@@ -133,6 +134,10 @@ export declare class WhispererDiagnostics {
|
|
|
133
134
|
eligible?: number | undefined;
|
|
134
135
|
results?: number | undefined;
|
|
135
136
|
contextChars?: number | undefined;
|
|
137
|
+
requestsSucceeded?: number | undefined;
|
|
138
|
+
requestsFailed?: number | undefined;
|
|
139
|
+
fallbackKeyUnavailable?: number | undefined;
|
|
140
|
+
fallbackAllJudgmentsFailed?: number | undefined;
|
|
136
141
|
}[];
|
|
137
142
|
measurements: {
|
|
138
143
|
[k: string]: {
|
package/dist/src/diagnostics.js
CHANGED
|
@@ -4,7 +4,7 @@ export class WhispererDiagnostics {
|
|
|
4
4
|
static shared() {
|
|
5
5
|
const scope = globalThis;
|
|
6
6
|
// Bump the version whenever the shape changes so an older loaded copy is never reused.
|
|
7
|
-
const symbol = Symbol.for("unblock-memory.whisperer-diagnostics.
|
|
7
|
+
const symbol = Symbol.for("unblock-memory.whisperer-diagnostics.v3");
|
|
8
8
|
return (scope[symbol] ??= new WhispererDiagnostics());
|
|
9
9
|
}
|
|
10
10
|
#agents = new Map();
|
package/dist/src/manager.d.ts
CHANGED
|
@@ -61,9 +61,10 @@ export declare class QmdMemoryManager implements MemorySearchManagerContract {
|
|
|
61
61
|
failed?: number | undefined;
|
|
62
62
|
empty?: number | undefined;
|
|
63
63
|
timed_out?: number | undefined;
|
|
64
|
+
degraded?: number | undefined;
|
|
64
65
|
};
|
|
65
66
|
slowestRecent: {
|
|
66
|
-
outcome: "cancelled" | "ok" | "partial" | "skipped" | "failed" | "empty" | "timed_out";
|
|
67
|
+
outcome: "cancelled" | "ok" | "partial" | "skipped" | "failed" | "empty" | "timed_out" | "degraded";
|
|
67
68
|
setupMs?: number | undefined;
|
|
68
69
|
queueWaitMs?: number | undefined;
|
|
69
70
|
metadataMs?: number | undefined;
|
|
@@ -92,6 +93,10 @@ export declare class QmdMemoryManager implements MemorySearchManagerContract {
|
|
|
92
93
|
eligible?: number | undefined;
|
|
93
94
|
results?: number | undefined;
|
|
94
95
|
contextChars?: number | undefined;
|
|
96
|
+
requestsSucceeded?: number | undefined;
|
|
97
|
+
requestsFailed?: number | undefined;
|
|
98
|
+
fallbackKeyUnavailable?: number | undefined;
|
|
99
|
+
fallbackAllJudgmentsFailed?: number | undefined;
|
|
95
100
|
}[];
|
|
96
101
|
measurements: {
|
|
97
102
|
[k: string]: {
|
|
@@ -13,12 +13,18 @@ export type MemorySearchObservation = RetrievalTimings & {
|
|
|
13
13
|
requestsSucceeded: number;
|
|
14
14
|
requestsFailed: number;
|
|
15
15
|
};
|
|
16
|
+
export type MemoryRanking = {
|
|
17
|
+
rankingMode: "typesafe_usefulness" | "retrieval";
|
|
18
|
+
fallbackReason?: "key_unavailable" | "all_judgments_failed";
|
|
19
|
+
};
|
|
16
20
|
/** Both entry points use the same complete passages and independent usefulness judgments. */
|
|
17
21
|
export declare function searchMemory(manager: MemoryCandidateManager, queries: QueryPair, options: CorpusSearchOptions & {
|
|
18
|
-
apiKey
|
|
22
|
+
apiKey?: string;
|
|
19
23
|
timeoutMs: number;
|
|
20
24
|
conversation: QueryConversation;
|
|
21
25
|
asOf?: string;
|
|
26
|
+
/** Only explicit, agent-requested search opts in. Automatic injection stays strict. */
|
|
27
|
+
allowRetrievalFallback?: boolean;
|
|
22
28
|
minUsefulness?: number;
|
|
23
29
|
excludedPassages?: ReadonlyMap<string, number>;
|
|
24
30
|
onCandidates?: (observation: MemorySearchObservation) => void;
|
|
@@ -27,6 +33,6 @@ export declare function searchMemory(manager: MemoryCandidateManager, queries: Q
|
|
|
27
33
|
elapsedMs: number;
|
|
28
34
|
error?: unknown;
|
|
29
35
|
}) => void;
|
|
30
|
-
}): Promise<MemorySearchObservation & {
|
|
36
|
+
}): Promise<MemorySearchObservation & MemoryRanking & {
|
|
31
37
|
results: CorpusMemorySearchResult[];
|
|
32
38
|
}>;
|
|
@@ -46,6 +46,20 @@ export async function searchMemory(manager, queries, options) {
|
|
|
46
46
|
}
|
|
47
47
|
observation.eligible = candidates.length;
|
|
48
48
|
options.onCandidates?.(observation);
|
|
49
|
+
const fallback = (reason) => ({
|
|
50
|
+
...timings, ...observation, rankingMode: "retrieval", fallbackReason: reason,
|
|
51
|
+
// Discovery is a lexical-first union, not a ranking. Stable reciprocal-rank
|
|
52
|
+
// ordering lets strong vector-only hits compete before maxResults truncation.
|
|
53
|
+
// These original lane scores are not fused ranks or usefulness probabilities.
|
|
54
|
+
results: [...candidates].sort((a, b) => b.score - a.score).slice(0, options.maxResults ?? 5),
|
|
55
|
+
});
|
|
56
|
+
if (!options.apiKey) {
|
|
57
|
+
signal?.throwIfAborted();
|
|
58
|
+
if (options.allowRetrievalFallback)
|
|
59
|
+
return fallback("key_unavailable");
|
|
60
|
+
return { ...timings, ...observation, rankingMode: "typesafe_usefulness", results: [] };
|
|
61
|
+
}
|
|
62
|
+
const apiKey = options.apiKey;
|
|
49
63
|
const endJudge = startTiming("judgeMs", timings, signal);
|
|
50
64
|
let judged;
|
|
51
65
|
try {
|
|
@@ -56,7 +70,7 @@ export async function searchMemory(manager, queries, options) {
|
|
|
56
70
|
excerpt: hit.snippet, corpus: hit.corpus, sourcePath: hit.path,
|
|
57
71
|
dates: [...new Set(hit.sessionMessages?.flatMap(message => message.timestamp ? [message.timestamp] : [])
|
|
58
72
|
?? (hit.messageTimestamp ? [hit.messageTimestamp] : []))],
|
|
59
|
-
}, asOf), options);
|
|
73
|
+
}, asOf), { ...options, apiKey });
|
|
60
74
|
signal?.throwIfAborted();
|
|
61
75
|
observation.requestsSucceeded++;
|
|
62
76
|
options.onJudgment?.({ candidateIndex, elapsedMs: performance.now() - requestStarted });
|
|
@@ -78,6 +92,8 @@ export async function searchMemory(manager, queries, options) {
|
|
|
78
92
|
}
|
|
79
93
|
signal?.throwIfAborted();
|
|
80
94
|
observation.judgeMs = timings.judgeMs ?? 0;
|
|
81
|
-
|
|
95
|
+
if (options.allowRetrievalFallback && candidates.length && !observation.requestsSucceeded)
|
|
96
|
+
return fallback("all_judgments_failed");
|
|
97
|
+
return { ...timings, ...observation, rankingMode: "typesafe_usefulness", results: judged.filter(hit => hit.score >= (options.minUsefulness ?? 0.7))
|
|
82
98
|
.sort((a, b) => b.score - a.score).slice(0, options.maxResults ?? 5) };
|
|
83
99
|
}
|
package/dist/src/plugin.js
CHANGED
|
@@ -48,7 +48,7 @@ const searchParameters = Type.Object({
|
|
|
48
48
|
conversationId: Type.Optional(Type.String({ pattern: "\\S" })),
|
|
49
49
|
}, { additionalProperties: false, description: "Restricts session documents only; selected file corpora remain eligible. Not an audience access control." })),
|
|
50
50
|
maxResults: Type.Optional(Type.Integer({ minimum: 1, maximum: 20, description: "Maximum hits; default 5." })),
|
|
51
|
-
minUsefulness: Type.Optional(Type.Number({ minimum: 0, maximum: 1, description: "Minimum TypeSafe usefulness probability; default 0.7. Not confidence in factual truth." })),
|
|
51
|
+
minUsefulness: Type.Optional(Type.Number({ minimum: 0, maximum: 1, description: "Minimum TypeSafe usefulness probability; default 0.7. Not confidence in factual truth. Not applied to unjudged retrieval fallback." })),
|
|
52
52
|
}, { additionalProperties: false });
|
|
53
53
|
const getParameters = Type.Object({
|
|
54
54
|
path: Type.String({ pattern: "\\S" }),
|
|
@@ -66,7 +66,7 @@ function createSearchTool(runtime, ctx, typesafe, diagnostics) {
|
|
|
66
66
|
return {
|
|
67
67
|
name: "memory_search",
|
|
68
68
|
label: "Memory Search",
|
|
69
|
-
description: "Search this agent's configured memory corpora with BM25 and vector queries, then TypeSafe usefulness ranking. Supply keywords in bm25Query and the information needed in vectorQuery; no query generation or recall gate runs. Queries and candidate passages are sent to TypeSafe. Skills are excluded. Session snippets are message arrays; file snippets are strings. Inspect source context with memory_get. Empty results or errors do not prove absence of a fact.",
|
|
69
|
+
description: "Search this agent's configured memory corpora with BM25 and vector queries, then TypeSafe usefulness ranking. If TypeSafe is unavailable, returns retrieval-ranked leads with a warning; retrieval scores are not usefulness probabilities and minUsefulness is not applied. Supply keywords in bm25Query and the information needed in vectorQuery; no query generation or recall gate runs. Queries and candidate passages are sent to TypeSafe when available. Skills are excluded. Session snippets are message arrays; file snippets are strings. Inspect source context with memory_get. Empty results or errors do not prove absence of a fact.",
|
|
70
70
|
parameters: searchParameters,
|
|
71
71
|
async execute(_toolCallId, params, signal) {
|
|
72
72
|
const started = performance.now();
|
|
@@ -78,11 +78,12 @@ function createSearchTool(runtime, ctx, typesafe, diagnostics) {
|
|
|
78
78
|
// Reject oversized explicit inputs before credential resolution or any service call.
|
|
79
79
|
prepareQueryConversation([], queries.lex);
|
|
80
80
|
const { conversation } = prepareQueryConversation([], queries.vec);
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
return jsonResult({ results: [], error: "TypeSafe API key not configured or TypeSafe disabled" });
|
|
81
|
+
let apiKey;
|
|
82
|
+
try {
|
|
83
|
+
apiKey = await resolveTypeSafeApiKey(typesafe);
|
|
85
84
|
}
|
|
85
|
+
catch { /* Explicit search can still return local evidence; never expose credential errors. */ }
|
|
86
|
+
signal?.throwIfAborted();
|
|
86
87
|
const { manager, error } = await runtime.getMemorySearchManager(active);
|
|
87
88
|
measurement.setupMs = performance.now() - started;
|
|
88
89
|
if (!manager)
|
|
@@ -92,27 +93,33 @@ function createSearchTool(runtime, ctx, typesafe, diagnostics) {
|
|
|
92
93
|
sessionFilter,
|
|
93
94
|
maxResults,
|
|
94
95
|
minUsefulness,
|
|
95
|
-
apiKey, timeoutMs: typesafe.timeoutMs, conversation,
|
|
96
|
+
apiKey, timeoutMs: typesafe.timeoutMs, conversation, allowRetrievalFallback: true,
|
|
96
97
|
signal, timings: measurement,
|
|
97
98
|
requestContext: active.requestContext,
|
|
98
99
|
onCandidates: ({ retrievalMs, candidates, eligible }) => {
|
|
99
100
|
Object.assign(measurement, { retrievalMs, candidates, eligible });
|
|
100
101
|
},
|
|
101
102
|
});
|
|
102
|
-
measurement.
|
|
103
|
+
measurement.requestsSucceeded = search.requestsSucceeded;
|
|
104
|
+
measurement.requestsFailed = search.requestsFailed;
|
|
105
|
+
measurement.fallbackKeyUnavailable = Number(search.fallbackReason === "key_unavailable");
|
|
106
|
+
measurement.fallbackAllJudgmentsFailed = Number(search.fallbackReason === "all_judgments_failed");
|
|
103
107
|
measurement.results = search.results.length;
|
|
104
108
|
measurement.contextChars = search.results.reduce((sum, hit) => sum + hit.snippet.length, 0);
|
|
105
|
-
|
|
106
|
-
return jsonResult({ results: [], error: "All memory usefulness judgments failed" });
|
|
107
|
-
measurement.outcome = search.requestsFailed ? "partial" : search.results.length ? "ok" : "empty";
|
|
109
|
+
measurement.outcome = search.rankingMode === "retrieval" ? "degraded" : search.requestsFailed ? "partial" : search.results.length ? "ok" : "empty";
|
|
108
110
|
// Compact only the public tool response; internal ranking and consumers keep
|
|
109
111
|
// full-precision scores and the host's source/citation compatibility fields.
|
|
110
112
|
const payload = {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
+
rankingMode: search.rankingMode,
|
|
114
|
+
scoreMeaning: search.rankingMode === "retrieval" ? "retrieval_rank" : "usefulness_probability",
|
|
115
|
+
minUsefulnessApplied: search.rankingMode !== "retrieval",
|
|
116
|
+
...(search.fallbackReason ? { fallbackReason: search.fallbackReason,
|
|
117
|
+
warning: "TypeSafe usefulness ranking unavailable; returning unjudged retrieval-ranked leads. Scores are retrieval ranks, not usefulness probabilities; minUsefulness was not applied. Verify evidence with memory_get." }
|
|
118
|
+
: search.requestsFailed ? { warning: `${search.requestsFailed} candidate usefulness judgments failed; results are partial` } : {}),
|
|
119
|
+
results: search.results.map(({ source: _source, citation: _citation, vectorScore: _vectorScore, textScore: _textScore, session, sessionMessages, ...result }) => ({
|
|
113
120
|
...result,
|
|
114
121
|
snippet: result.corpus === "sessions" ? sessionMessages ?? [{ body: result.snippet, partial: true }] : result.snippet,
|
|
115
|
-
score: Number(result.score.toFixed(2)),
|
|
122
|
+
score: search.rankingMode === "retrieval" ? result.score : Number(result.score.toFixed(2)),
|
|
116
123
|
...(session ? { session: { ...session, startedAt: new Date(session.startedAt).toISOString() } } : {}),
|
|
117
124
|
})),
|
|
118
125
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type RetrievalTimings } from "./retrieval-timing.js";
|
|
2
2
|
type RetrievalOperation = "vector" | "memoryWhisperer" | "memorySearch";
|
|
3
|
-
type RetrievalOutcome = "ok" | "partial" | "empty" | "failed" | "cancelled" | "timed_out" | "skipped";
|
|
4
|
-
declare const fields: readonly ["elapsedMs", "retrievalMs", "judgeMs", "gateMs", "generationMs", "setupMs", "queueWaitMs", "metadataMs", "storeSetupMs", "bm25Ms", "vectorMs", "vectorIndexCheckMs", "vectorScopeMs", "embeddingMs", "vectorScanMs", "hydrationMs", "vectorMappingMs", "vectorOtherMs", "passageMs", "candidatePrepMs", "retrievalOtherMs", "otherMs", "metadataReloads", "vectorScanAttempts", "candidates", "eligible", "results", "contextChars"];
|
|
3
|
+
type RetrievalOutcome = "ok" | "partial" | "empty" | "failed" | "cancelled" | "timed_out" | "skipped" | "degraded";
|
|
4
|
+
declare const fields: readonly ["elapsedMs", "retrievalMs", "judgeMs", "gateMs", "generationMs", "setupMs", "queueWaitMs", "metadataMs", "storeSetupMs", "bm25Ms", "vectorMs", "vectorIndexCheckMs", "vectorScopeMs", "embeddingMs", "vectorScanMs", "hydrationMs", "vectorMappingMs", "vectorOtherMs", "passageMs", "candidatePrepMs", "retrievalOtherMs", "otherMs", "metadataReloads", "vectorScanAttempts", "candidates", "eligible", "results", "contextChars", "requestsSucceeded", "requestsFailed", "fallbackKeyUnavailable", "fallbackAllJudgmentsFailed"];
|
|
5
5
|
type Field = typeof fields[number];
|
|
6
6
|
export type RetrievalObservation = {
|
|
7
7
|
outcome: RetrievalOutcome;
|
|
@@ -24,6 +24,7 @@ export declare class RetrievalTelemetry {
|
|
|
24
24
|
failed?: number | undefined;
|
|
25
25
|
empty?: number | undefined;
|
|
26
26
|
timed_out?: number | undefined;
|
|
27
|
+
degraded?: number | undefined;
|
|
27
28
|
};
|
|
28
29
|
slowestRecent: {
|
|
29
30
|
outcome: RetrievalOutcome;
|
|
@@ -55,6 +56,10 @@ export declare class RetrievalTelemetry {
|
|
|
55
56
|
eligible?: number | undefined;
|
|
56
57
|
results?: number | undefined;
|
|
57
58
|
contextChars?: number | undefined;
|
|
59
|
+
requestsSucceeded?: number | undefined;
|
|
60
|
+
requestsFailed?: number | undefined;
|
|
61
|
+
fallbackKeyUnavailable?: number | undefined;
|
|
62
|
+
fallbackAllJudgmentsFailed?: number | undefined;
|
|
58
63
|
}[];
|
|
59
64
|
measurements: {
|
|
60
65
|
[k: string]: {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { timingFields } from "./retrieval-timing.js";
|
|
2
2
|
const fields = ["elapsedMs", "retrievalMs", "judgeMs", "gateMs", "generationMs", ...timingFields,
|
|
3
|
-
"metadataReloads", "vectorScanAttempts", "candidates", "eligible", "results", "contextChars"
|
|
3
|
+
"metadataReloads", "vectorScanAttempts", "candidates", "eligible", "results", "contextChars",
|
|
4
|
+
"requestsSucceeded", "requestsFailed", "fallbackKeyUnavailable", "fallbackAllJudgmentsFailed"];
|
|
4
5
|
const recentLimit = 256;
|
|
5
|
-
const outcomes = ["ok", "partial", "empty", "failed", "cancelled", "timed_out", "skipped"];
|
|
6
|
+
const outcomes = ["ok", "partial", "empty", "failed", "cancelled", "timed_out", "skipped", "degraded"];
|
|
6
7
|
const boundedAdd = (left, right) => Math.min(Number.MAX_SAFE_INTEGER, left + right);
|
|
7
8
|
/** Only fixed operation/outcome names and nonnegative numbers enter this store. */
|
|
8
9
|
export class RetrievalTelemetry {
|
package/docs/configuration.md
CHANGED
|
@@ -11,7 +11,7 @@ settings; a rotated credential file is reread without a restart.
|
|
|
11
11
|
|
|
12
12
|
| Feature | Required settings/dependencies | TypeSafe disabled / no key | Provider or unreadable-key failure |
|
|
13
13
|
| --- | --- | --- | --- |
|
|
14
|
-
| `memory_search` | Installed/enabled memory slot; configured corpora
|
|
14
|
+
| `memory_search` | Installed/enabled memory slot; configured corpora | Local retrieval-ranked leads with degraded warning | Successful judged siblings returned with a partial warning; total judging failure or unreadable key uses local retrieval fallback |
|
|
15
15
|
| `memory_get` | Installed/enabled memory slot; configured corpora | Unchanged local indexed reads | Unchanged; its own indexing errors still matter |
|
|
16
16
|
| Skill Whisperer | `skillWhisperer.enabled`, skills corpus, host hooks | Best local vector candidate meeting `minScore` | Exclude failed candidates; successful siblings may qualify; no vector fallback |
|
|
17
17
|
| Memory Whisperer | `memoryWhisperer.enabled`, explicit approved corpora, host hooks | No hints | Exclude failed candidates; recall/deadline failures still suppress the turn |
|
package/docs/retrieval.md
CHANGED
|
@@ -21,8 +21,16 @@ Example tool input (the `memory` corpus exists by default):
|
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
Results use compact JSON and carry `path`, `startLine`, `endLine`, `snippet`,
|
|
24
|
-
`corpus`, and a
|
|
25
|
-
|
|
24
|
+
`corpus`, and a `score`. With `rankingMode: "typesafe_usefulness"`, this is a
|
|
25
|
+
usefulness probability rounded to hundredths; ranking and threshold filtering
|
|
26
|
+
still use full precision. With `rankingMode: "retrieval"`, the original QMD
|
|
27
|
+
per-lane reciprocal-rank score is preserved without rounding, then sorted highest
|
|
28
|
+
first (discovery order breaks ties); this is not a probability or fused RRF score.
|
|
29
|
+
Discovery is a lexical-first union, so sorting prevents vector-only top matches
|
|
30
|
+
from being buried below the lexical lane before `maxResults` truncation. A hit
|
|
31
|
+
found in both lanes retains its first-discovered score; lane scores are not summed.
|
|
32
|
+
`scoreMeaning` and `minUsefulnessApplied` identify the score contract explicitly.
|
|
33
|
+
The constant `source` and top-level `provider`
|
|
26
34
|
fields are omitted; `path` plus line numbers replace the redundant `citation`.
|
|
27
35
|
Session hits also carry session metadata and, when available,
|
|
28
36
|
`messageTimestamp`: the original timestamp text (including timezone) of the message
|
|
@@ -66,17 +74,36 @@ Search snippets are leads. Inspect attribution, qualifications, dates and adjace
|
|
|
66
74
|
context before relying on a factual claim. An old plan is not proof it happened,
|
|
67
75
|
and memory does not grant permission to act. No results may mean the wrong corpus,
|
|
68
76
|
a high threshold, an unsynced session or an unavailable index—not absence of the fact.
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
77
|
+
When enabled and configured, TypeSafe receives the semantic query, candidate
|
|
78
|
+
excerpts, dates, corpus and source paths. If disabled, missing/unreadable credentials,
|
|
79
|
+
or **all** eligible usefulness requests fail (including billing HTTP 402, timeouts,
|
|
80
|
+
network or invalid responses), explicit search returns local retrieval-ranked leads.
|
|
81
|
+
The response includes `rankingMode: "retrieval"`, `scoreMeaning: "retrieval_rank"`,
|
|
82
|
+
`minUsefulnessApplied: false`, `fallbackReason` (`key_unavailable` or
|
|
83
|
+
`all_judgments_failed`), and a degraded warning. The requested `minUsefulness` is
|
|
84
|
+
not applied to unjudged scores. Corpus/session restrictions, complete passage
|
|
85
|
+
limits, deduplication, original source links, cancellation and `maxResults` remain
|
|
86
|
+
in force. Read sources with `memory_get` before drawing conclusions.
|
|
87
|
+
|
|
88
|
+
Partial judging failure returns **only** successfully judged results with a
|
|
89
|
+
warning; retrieval scores are never mixed with usefulness probabilities. Valid
|
|
90
|
+
judgments below `minUsefulness` still return no results, not fallback evidence.
|
|
91
|
+
An empty eligible set is an ordinary empty search when judging is available.
|
|
92
|
+
Automatic Memory Whisperer/People review policies remain strict: this fallback
|
|
93
|
+
is opt-in only for explicit `memory_search`, not automatic context injection.
|
|
73
94
|
Oversized queries are rejected before credentials, retrieval or provider calls.
|
|
74
95
|
Search initialization errors include an `error` alongside empty `results`;
|
|
75
96
|
other failures may surface as tool errors. Investigate them instead of reporting
|
|
76
97
|
“nothing is remembered.”
|
|
77
98
|
`memory_diagnostics` exposes content-free manual-search measurements under
|
|
78
99
|
`whisperers.telemetry.operations.memorySearch`: end-to-end latency, retrieval and
|
|
79
|
-
judging time, candidate/result counts and outcomes (including partial
|
|
100
|
+
judging time, candidate/result counts and outcomes (including `partial` and
|
|
101
|
+
`degraded`). `requestsSucceeded`/`requestsFailed` count individual usefulness
|
|
102
|
+
requests; `fallbackKeyUnavailable` and `fallbackAllJudgmentsFailed` count fallback
|
|
103
|
+
calls by cause. These are numeric, content-free measurements; disabled and missing
|
|
104
|
+
or unreadable keys intentionally share one reason without recording file paths.
|
|
105
|
+
Capture baseline and follow-up snapshots for weekly evaluation; counters reset on
|
|
106
|
+
process recreation and recent percentiles retain only 256 calls.
|
|
80
107
|
These counters are separate from automatic `memoryWhisperer` and internal `vector`
|
|
81
108
|
retrieval; no query or evidence text is recorded.
|
|
82
109
|
|
package/openclaw.plugin.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "unblock-memory",
|
|
3
3
|
"name": "Unblock Memory",
|
|
4
|
-
"version": "0.10.
|
|
4
|
+
"version": "0.10.3",
|
|
5
5
|
"description": "Indexes, retrieves, and analyzes configured workspace memory with existing QMD vectors.",
|
|
6
6
|
"kind": "memory",
|
|
7
7
|
"activation": { "onStartup": true },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unblocklabs/unblock-memory",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.3",
|
|
4
4
|
"description": "Workspace-native memory for OpenClaw, powered by QMD",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@huggingface/tokenizers": "0.2.0",
|
|
51
|
-
"@unblocklabs/qmd": "3.0.
|
|
51
|
+
"@unblocklabs/qmd": "3.0.2",
|
|
52
52
|
"chokidar": "5.0.0",
|
|
53
53
|
"js-tiktoken": "1.0.21",
|
|
54
54
|
"picomatch": "^4.0.5",
|
|
@@ -96,5 +96,9 @@
|
|
|
96
96
|
"publishToClawHub": false,
|
|
97
97
|
"publishToNpm": true
|
|
98
98
|
}
|
|
99
|
+
},
|
|
100
|
+
"overrides": {
|
|
101
|
+
"@modelcontextprotocol/sdk": "1.32.0",
|
|
102
|
+
"hono": "4.13.11"
|
|
99
103
|
}
|
|
100
104
|
}
|