@pyxmate/memory 0.1.8-beta → 0.2.0-beta
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.
|
@@ -48,6 +48,8 @@ var MemoryClient = class {
|
|
|
48
48
|
searchParams.set("eventTimeEnd", params.eventTimeRange[1]);
|
|
49
49
|
}
|
|
50
50
|
if (params.asOf) searchParams.set("asOf", params.asOf);
|
|
51
|
+
if (params.abstentionThreshold != null)
|
|
52
|
+
searchParams.set("abstentionThreshold", String(params.abstentionThreshold));
|
|
51
53
|
return this.fetchApi(`/api/memory/search?${searchParams}`);
|
|
52
54
|
}
|
|
53
55
|
async get(id) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MemoryClient
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-265LTIGS.mjs";
|
|
4
4
|
|
|
5
5
|
// ../dashboard/src/aggregations/consolidation-analytics.ts
|
|
6
6
|
function analyzeConsolidationLog(entries) {
|
|
@@ -172,11 +172,12 @@ var DashboardClient = class extends MemoryClient {
|
|
|
172
172
|
);
|
|
173
173
|
}
|
|
174
174
|
async graphFull(limit = 50) {
|
|
175
|
+
const relationshipLimit = limit * 4;
|
|
175
176
|
const [nodesResponse, relsResponse] = await Promise.all([
|
|
176
177
|
this.fetchApi(
|
|
177
178
|
`/api/memory/graph/nodes?limit=${limit}`
|
|
178
179
|
),
|
|
179
|
-
this.graphRelationships(
|
|
180
|
+
this.graphRelationships(relationshipLimit).catch(() => ({
|
|
180
181
|
relationships: [],
|
|
181
182
|
totalCount: 0
|
|
182
183
|
}))
|
package/dist/dashboard.mjs
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -207,6 +207,8 @@ interface MemorySearchParams {
|
|
|
207
207
|
eventTimeRange?: [string, string];
|
|
208
208
|
/** Filter results to entries ingested before this cutoff (ISO 8601). Falls back to createdAt when ingestTime is null. */
|
|
209
209
|
asOf?: string;
|
|
210
|
+
/** Confidence threshold below which the system recommends abstention (0.0–1.0). Default: 0.3. */
|
|
211
|
+
abstentionThreshold?: number;
|
|
210
212
|
}
|
|
211
213
|
interface MemorySearchResult {
|
|
212
214
|
entries: MemoryEntry[];
|
|
@@ -217,6 +219,22 @@ interface MemorySearchResult {
|
|
|
217
219
|
entry: MemoryEntry;
|
|
218
220
|
score: number;
|
|
219
221
|
}>;
|
|
222
|
+
/** Confidence assessment for abstention. Present when search produces scored entries. */
|
|
223
|
+
confidence?: {
|
|
224
|
+
/** Overall confidence 0.0–1.0. */
|
|
225
|
+
confidence: number;
|
|
226
|
+
/** Whether the system recommends abstaining (confidence below threshold). */
|
|
227
|
+
shouldAbstain: boolean;
|
|
228
|
+
/** Raw signals used to compute confidence. */
|
|
229
|
+
signals: {
|
|
230
|
+
topScore: number;
|
|
231
|
+
scoreGap: number;
|
|
232
|
+
scoreStdDev: number;
|
|
233
|
+
resultCount: number;
|
|
234
|
+
aboveThresholdRatio: number;
|
|
235
|
+
scoreSeparation: number;
|
|
236
|
+
};
|
|
237
|
+
};
|
|
220
238
|
}
|
|
221
239
|
declare const StoreTarget: {
|
|
222
240
|
readonly SQLITE: "sqlite";
|
package/dist/index.mjs
CHANGED
package/dist/react.mjs
CHANGED
|
@@ -11,12 +11,15 @@ import {
|
|
|
11
11
|
toGraphologyFormat,
|
|
12
12
|
transformGraphData,
|
|
13
13
|
unreachableHealth
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-TUTB4CH5.mjs";
|
|
15
|
+
import "./chunk-265LTIGS.mjs";
|
|
16
16
|
|
|
17
17
|
// ../dashboard/src/hooks/use-consolidation-log.ts
|
|
18
18
|
import { useCallback as useCallback2, useMemo } from "react";
|
|
19
19
|
|
|
20
|
+
// ../dashboard/src/constants.ts
|
|
21
|
+
var DEFAULT_POLL_INTERVAL_MS = 3e4;
|
|
22
|
+
|
|
20
23
|
// ../dashboard/src/hooks/use-polling.ts
|
|
21
24
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
22
25
|
function usePolling(fetcher, options) {
|
|
@@ -59,7 +62,7 @@ function usePolling(fetcher, options) {
|
|
|
59
62
|
}
|
|
60
63
|
|
|
61
64
|
// ../dashboard/src/hooks/use-consolidation-log.ts
|
|
62
|
-
function useConsolidationLog(serverUrl, limit = 20, intervalMs =
|
|
65
|
+
function useConsolidationLog(serverUrl, limit = 20, intervalMs = DEFAULT_POLL_INTERVAL_MS) {
|
|
63
66
|
const client = useMemo(() => new DashboardClient(serverUrl), [serverUrl]);
|
|
64
67
|
const fetcher = useCallback2(async () => {
|
|
65
68
|
const entries = await client.consolidationLog(limit);
|
|
@@ -71,7 +74,7 @@ function useConsolidationLog(serverUrl, limit = 20, intervalMs = 3e4) {
|
|
|
71
74
|
// ../dashboard/src/hooks/use-knowledge-graph.ts
|
|
72
75
|
import { useCallback as useCallback3, useMemo as useMemo2 } from "react";
|
|
73
76
|
function useKnowledgeGraph(serverUrl, opts = {}) {
|
|
74
|
-
const { intervalMs =
|
|
77
|
+
const { intervalMs = DEFAULT_POLL_INTERVAL_MS, limit = 50, minWeight, maxNodes } = opts;
|
|
75
78
|
const client = useMemo2(() => new DashboardClient(serverUrl), [serverUrl]);
|
|
76
79
|
const stableTransformOpts = useMemo2(
|
|
77
80
|
() => ({ minWeight, maxNodes }),
|
|
@@ -94,7 +97,7 @@ function useMemoryEntries(serverUrl, filters = {}, intervalMs = 0) {
|
|
|
94
97
|
[client, page, limit, type, agentId, query]
|
|
95
98
|
);
|
|
96
99
|
return usePolling(fetcher, {
|
|
97
|
-
intervalMs: intervalMs ??
|
|
100
|
+
intervalMs: intervalMs ?? DEFAULT_POLL_INTERVAL_MS
|
|
98
101
|
});
|
|
99
102
|
}
|
|
100
103
|
|