@pyxmate/memory 1.32.1 → 1.33.0

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.
@@ -612,6 +612,13 @@ function normalizeExpand(input) {
612
612
  return { baseEntryIds, anchorEntryIds };
613
613
  }
614
614
  var CALLER_ENTRY_ID_RESERVED_PREFIXES = ["synthesis:", "user-profile:", "correction:"];
615
+ function optionalExplainEntryId(value, strategy) {
616
+ if (value === void 0) return void 0;
617
+ if (strategy !== "hybrid") throw new Error("input.explainEntryId requires the hybrid strategy");
618
+ return requireString(value, "input.explainEntryId", {
619
+ maxBytes: DATA_PLANE_COMPILER_LIMITS.identityBytes
620
+ });
621
+ }
615
622
  function optionalCallerEntryId(value, field) {
616
623
  if (value === void 0) return void 0;
617
624
  const id = requireString(value, field, { maxBytes: DATA_PLANE_COMPILER_LIMITS.identityBytes });
@@ -1131,7 +1138,8 @@ function normalizeSearch(input, mcp) {
1131
1138
  "asOf",
1132
1139
  "anchorTime",
1133
1140
  "enumerationConcept",
1134
- "enableRerank"
1141
+ "enableRerank",
1142
+ "explainEntryId"
1135
1143
  ];
1136
1144
  requireExactKeys(value, keys, "input");
1137
1145
  if (value.enumerationConcept !== void 0) {
@@ -1172,6 +1180,11 @@ function normalizeSearch(input, mcp) {
1172
1180
  if (value.enableRerank !== void 0) {
1173
1181
  normalized.enableRerank = requireBoolean(value.enableRerank, "input.enableRerank");
1174
1182
  }
1183
+ withOptional(
1184
+ normalized,
1185
+ "explainEntryId",
1186
+ optionalExplainEntryId(value.explainEntryId, normalized.strategy)
1187
+ );
1175
1188
  return normalized;
1176
1189
  }
1177
1190
  function normalizeLineage(input, mcp) {
@@ -2,7 +2,7 @@ import {
2
2
  RAGStrategy,
3
3
  assertGraphExtractionPayload,
4
4
  mergeExtractedEntities
5
- } from "./chunk-MD5RCZCA.mjs";
5
+ } from "./chunk-DV4IQOVD.mjs";
6
6
 
7
7
  // ../client/src/disabled-memory.ts
8
8
  var DEFAULT_PAGE_LIMIT = 20;
@@ -292,6 +292,9 @@ var MemoryClient = class {
292
292
  if (enumerationConcept) searchParams.set("enumerationConcept", enumerationConcept);
293
293
  if (params.abstentionThreshold != null)
294
294
  searchParams.set("abstentionThreshold", String(params.abstentionThreshold));
295
+ if (params.explainEntryId !== void 0) {
296
+ searchParams.set("explainEntryId", params.explainEntryId);
297
+ }
295
298
  return this.fetchApi(`/api/memory/search?${searchParams}`, {
296
299
  headers: this.authorityHeaders(this.exactReadAuthority(params.namespaceId, authority))
297
300
  });
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  MemoryClient
3
- } from "./chunk-F2G2TBLW.mjs";
3
+ } from "./chunk-UWGKWV44.mjs";
4
4
 
5
5
  // ../dashboard/src/aggregations/consolidation-analytics.ts
6
6
  function analyzeConsolidationLog(entries) {
@@ -144,7 +144,7 @@ async function runMcpInstall(target, scope, remote, noRules) {
144
144
  }
145
145
  async function runMcpCommand(parsed) {
146
146
  if (parsed.subcommand === void 0) {
147
- const { mcpCommand, resolveMcpMode } = await import("../mcp-GGI7LUYO.mjs");
147
+ const { mcpCommand, resolveMcpMode } = await import("../mcp-BAFJVW6C.mjs");
148
148
  const resolved = resolveMcpMode({
149
149
  remote: parsed.flags.remote === true,
150
150
  bundled: parsed.flags.bundled === true
@@ -249,7 +249,7 @@ async function main() {
249
249
  process.stderr.write("Error: `pyx-mem insights` requires --json.\n");
250
250
  return EXIT.USAGE;
251
251
  }
252
- const { insightsCommand } = await import("../insights-E7USP2C5.mjs");
252
+ const { insightsCommand } = await import("../insights-KPANMV7T.mjs");
253
253
  return insightsCommand({
254
254
  withIdentity: parsed.flags["with-identity"] === true,
255
255
  withProvenance: parsed.flags["with-provenance"] === true
@@ -260,7 +260,7 @@ async function main() {
260
260
  process.stderr.write("Error: `pyx-mem taxonomy` requires --json.\n");
261
261
  return EXIT.USAGE;
262
262
  }
263
- const { taxonomyCommand } = await import("../taxonomy-65DFVGRY.mjs");
263
+ const { taxonomyCommand } = await import("../taxonomy-3N4EUGDX.mjs");
264
264
  return taxonomyCommand({ withIdentity: parsed.flags["with-identity"] === true });
265
265
  }
266
266
  case "logout": {
@@ -11,10 +11,10 @@ import {
11
11
  toGraphologyFormat,
12
12
  transformGraphData,
13
13
  unreachableHealth
14
- } from "./chunk-UIR5VDPF.mjs";
15
- import "./chunk-F2G2TBLW.mjs";
14
+ } from "./chunk-XQIJM5PD.mjs";
15
+ import "./chunk-UWGKWV44.mjs";
16
16
  import "./chunk-RWQTBXUC.mjs";
17
- import "./chunk-MD5RCZCA.mjs";
17
+ import "./chunk-DV4IQOVD.mjs";
18
18
  export {
19
19
  DashboardClient,
20
20
  Poller,
@@ -27,7 +27,7 @@ import {
27
27
  parseHostedFileIngestJobView,
28
28
  parseHostedFileIngestPublishResult,
29
29
  requireHostedFileIngestFilename
30
- } from "./chunk-MD5RCZCA.mjs";
30
+ } from "./chunk-DV4IQOVD.mjs";
31
31
  export {
32
32
  DATA_PLANE_CATALOG_VERSION,
33
33
  DATA_PLANE_COMPILER_LIMITS,
package/dist/index.d.ts CHANGED
@@ -292,6 +292,12 @@ interface MemorySearchParams {
292
292
  * index drift. Default true (access tracking is the product's usage signal).
293
293
  */
294
294
  trackAccess?: boolean;
295
+ /**
296
+ * Explain one entry: the result gains `explanation`, saying where this
297
+ * search kept or dropped it. Hybrid strategy only. Such a search tracks no
298
+ * access, so explaining a result does not change how it ranks.
299
+ */
300
+ explainEntryId?: string;
295
301
  /**
296
302
  * Retrieval EFFORT tier (H8 slice 1b) — admits candidates by activation
297
303
  * strength BEFORE RRF fusion (like LLM thinking-mode depth): `quick` = the
@@ -339,6 +345,84 @@ interface MemorySearchParams {
339
345
  */
340
346
  forbiddenStrictNamespaceIds?: string[];
341
347
  }
348
+ /** The first hybrid-search stage that did not keep an explained entry. */
349
+ type SearchExplanationStage =
350
+ /** A filter of the search excludes the entry; `filter` names which. */
351
+ 'filtered'
352
+ /** No candidate source of the search returned the entry. */
353
+ | 'not_retrieved'
354
+ /** A higher-scored candidate has the same content. */
355
+ | 'duplicate'
356
+ /** The entry scored below the last returned result. */
357
+ | 'below_limit'
358
+ /** The entry was within the limit after scoring; reranking or a later ordering pass moved it out. */
359
+ | 'reordered_out';
360
+ /** A candidate list of a hybrid search. */
361
+ type SearchCandidateSource = 'vector' | 'keyword' | 'graph' | 'community';
362
+ /**
363
+ * One candidate's hybrid score: the weighted parts are summed, then
364
+ * multiplied by `sourceTrust` and `entityBoost` into `total`.
365
+ */
366
+ interface SearchScoreParts {
367
+ /** 1-based position among the scored candidates the caller may read. */
368
+ rank: number;
369
+ total: number;
370
+ relevance: number;
371
+ recency: number;
372
+ importance: number;
373
+ access: number;
374
+ metadata: number;
375
+ sourceTrust: number;
376
+ entityBoost: number;
377
+ }
378
+ /**
379
+ * Where one search kept or dropped one entry. It replays this search now: it
380
+ * is not a record of an earlier search, and it says nothing about whether a
381
+ * model used a result. Ranks and sizes count only candidates the caller may
382
+ * read.
383
+ */
384
+ interface SearchExplanation {
385
+ entryId: string;
386
+ /** False when no entry with this id is readable here; nothing else is reported then. */
387
+ found: boolean;
388
+ /** 1-based position in the results; null when the entry was not returned. */
389
+ rank: number | null;
390
+ /** The first stage that did not keep the entry; null when it was returned or not found. */
391
+ stage: SearchExplanationStage | null;
392
+ /**
393
+ * The filter that excluded the entry, for stage `filtered`: `effort` (deep
394
+ * effort would admit it: its activation is below this tier, or it is
395
+ * superseded or archived), `scope` (no effort would: the search's type,
396
+ * agentId or namespace, or an on-demand entry), or `time` (`eventTimeRange`
397
+ * or `asOf`).
398
+ */
399
+ filter?: 'effort' | 'scope' | 'time';
400
+ /** The entry's activation, when the search set `effort`. */
401
+ activation?: {
402
+ strength: number;
403
+ tier: 'quick' | 'medium' | 'deep';
404
+ grace: boolean;
405
+ };
406
+ /**
407
+ * The search's candidate lists in retrieval order (a source repeats per
408
+ * sub-query): the entry's 1-based rank in each, or null, and the list's
409
+ * size. A list with no candidate the caller may read is left out.
410
+ */
411
+ sources?: Array<{
412
+ source: SearchCandidateSource;
413
+ rank: number | null;
414
+ size: number;
415
+ }>;
416
+ /**
417
+ * Dense similarity to the query under the search's filters; null when the
418
+ * vector source cannot see the entry, absent when that source failed.
419
+ */
420
+ vectorSimilarity?: number | null;
421
+ /** The entry's score, when it was scored. */
422
+ score?: SearchScoreParts;
423
+ /** The last returned result's score, when the entry was scored but not returned. */
424
+ cutoff?: SearchScoreParts;
425
+ }
342
426
  interface MemorySearchResult {
343
427
  entries: MemoryEntry[];
344
428
  totalCount: number;
@@ -373,6 +457,8 @@ interface MemorySearchResult {
373
457
  scoreSeparation: number;
374
458
  };
375
459
  };
460
+ /** Present when the search set `explainEntryId`. */
461
+ explanation?: SearchExplanation;
376
462
  }
377
463
  /** One version in a fact's history, as returned by {@link LineageResult}. */
378
464
  interface LineageVersion {
@@ -2018,4 +2104,4 @@ interface CreatePyxMemoryOptions {
2018
2104
  }
2019
2105
  declare function createPyxMemory(opts?: CreatePyxMemoryOptions): MemoryClient;
2020
2106
 
2021
- export { type AgentId, type ApiResponse, type ConsolidationJudgementsResult, type ConsolidationMerge, type ConsolidationPair, type ConsolidationPairSide, type ConsolidationRunResult, type CorrectionInput, type CorrectionRecord, type CreatePyxMemoryOptions, DEFAULTS, DEPRECATED_RAG_STRATEGIES, DisabledMemory, type DroppedGraphRelationship, type DueScanInput, EmbeddingProviderName, type EnrichmentCallbacks, type EnrichmentPurpose, type EntityExtractionResult, type ExpandAnchorStatus, type ExpandParams, type ExpandResult, type ExtendedMemoryInterface, type FetchCorrectionsInput, type FileDownloadOptions, type GraphEnrichEvent, type GraphEnrichFileOptions, type GraphEnrichPreparedEvent, type GraphEnrichResult, type GraphEnrichResultEvent, type GraphEnrichment, type GraphEnrichmentStatus, type GraphExtractionPayload, type GraphFailureMode, type GraphNode, type GraphRelationship, type GraphRepairResult, type GraphTelemetrySnapshot, type GraphTraversalResult, type IngestEntity, type IngestErrorEvent, type IngestEvent, type IngestFileOptions, type IngestHeartbeatEvent, type IngestProgressEvent, type IngestRelationship, type IngestResultEvent, type IngestStage, type IngestionResult, type LineageParams, type LineageResult, type LineageVersion, MCP_ACTOR_META_KEY, MEMORY_ACTOR_LABEL_MAX_CHARS, MEMORY_PROJECT_LABEL_MAX_CHARS, MemoryClient, type MemoryClientOptions, type MemoryEntry, type MemoryIngestRequest, type MemoryInsightMetrics, type MemoryInsights, type MemoryInterface, type MemoryListParams, type MemoryListResult, type MemoryLogFilters, type MemoryProjectInsight, type MemorySearchParams, type MemorySearchResult, MemoryServerError, type MemoryStats, MemoryType, type MoveEntriesFilter, MoveFailureReason, type MoveResult, type MoveTarget, NamespaceIsolation, type PrincipalContext, RAGStrategy, type ReinforceParams, type ReinforceResult, type ReinforceSignal, SESSION_ORDINAL_MAX, SINGLE_TENANT_ID, type SecretElevationAggregate, type SecretElevationNotice, SensitivityLevel, type SourceEvidence, type StoreInput, StoreTarget, TAXONOMY_MAX_CATEGORIES, TAXONOMY_MAX_PROJECTS, TAXONOMY_MAX_SAMPLE_TOPICS, TAXONOMY_MAX_TOP_ENTITIES, type TemporalQueryFilters, type TenantScopeOptions, type Timestamp, type Topology, type TopologyExtractionProvider, type TopologyServiceVariant, type UsageHygieneSnapshot, VectorProvider, type VectorStatus, type WikiLintReport, assertGraphExtractionPayload, createPyxMemory, isSessionOrdinal, mergeExtractedEntities, normalizeGraphLabel, normalizeMemoryActorLabel, normalizeNameKey, projectSearchResponseForMcp, secretElevationAggregate, secretElevationNoticeFor, withSecretElevationNotice };
2107
+ export { type AgentId, type ApiResponse, type ConsolidationJudgementsResult, type ConsolidationMerge, type ConsolidationPair, type ConsolidationPairSide, type ConsolidationRunResult, type CorrectionInput, type CorrectionRecord, type CreatePyxMemoryOptions, DEFAULTS, DEPRECATED_RAG_STRATEGIES, DisabledMemory, type DroppedGraphRelationship, type DueScanInput, EmbeddingProviderName, type EnrichmentCallbacks, type EnrichmentPurpose, type EntityExtractionResult, type ExpandAnchorStatus, type ExpandParams, type ExpandResult, type ExtendedMemoryInterface, type FetchCorrectionsInput, type FileDownloadOptions, type GraphEnrichEvent, type GraphEnrichFileOptions, type GraphEnrichPreparedEvent, type GraphEnrichResult, type GraphEnrichResultEvent, type GraphEnrichment, type GraphEnrichmentStatus, type GraphExtractionPayload, type GraphFailureMode, type GraphNode, type GraphRelationship, type GraphRepairResult, type GraphTelemetrySnapshot, type GraphTraversalResult, type IngestEntity, type IngestErrorEvent, type IngestEvent, type IngestFileOptions, type IngestHeartbeatEvent, type IngestProgressEvent, type IngestRelationship, type IngestResultEvent, type IngestStage, type IngestionResult, type LineageParams, type LineageResult, type LineageVersion, MCP_ACTOR_META_KEY, MEMORY_ACTOR_LABEL_MAX_CHARS, MEMORY_PROJECT_LABEL_MAX_CHARS, MemoryClient, type MemoryClientOptions, type MemoryEntry, type MemoryIngestRequest, type MemoryInsightMetrics, type MemoryInsights, type MemoryInterface, type MemoryListParams, type MemoryListResult, type MemoryLogFilters, type MemoryProjectInsight, type MemorySearchParams, type MemorySearchResult, MemoryServerError, type MemoryStats, MemoryType, type MoveEntriesFilter, MoveFailureReason, type MoveResult, type MoveTarget, NamespaceIsolation, type PrincipalContext, RAGStrategy, type ReinforceParams, type ReinforceResult, type ReinforceSignal, SESSION_ORDINAL_MAX, SINGLE_TENANT_ID, type SearchCandidateSource, type SearchExplanation, type SearchExplanationStage, type SearchScoreParts, type SecretElevationAggregate, type SecretElevationNotice, SensitivityLevel, type SourceEvidence, type StoreInput, StoreTarget, TAXONOMY_MAX_CATEGORIES, TAXONOMY_MAX_PROJECTS, TAXONOMY_MAX_SAMPLE_TOPICS, TAXONOMY_MAX_TOP_ENTITIES, type TemporalQueryFilters, type TenantScopeOptions, type Timestamp, type Topology, type TopologyExtractionProvider, type TopologyServiceVariant, type UsageHygieneSnapshot, VectorProvider, type VectorStatus, type WikiLintReport, assertGraphExtractionPayload, createPyxMemory, isSessionOrdinal, mergeExtractedEntities, normalizeGraphLabel, normalizeMemoryActorLabel, normalizeNameKey, projectSearchResponseForMcp, secretElevationAggregate, secretElevationNoticeFor, withSecretElevationNotice };
package/dist/index.mjs CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  DisabledMemory,
3
3
  MemoryClient,
4
4
  MemoryServerError
5
- } from "./chunk-F2G2TBLW.mjs";
5
+ } from "./chunk-UWGKWV44.mjs";
6
6
  import {
7
7
  DEFAULTS,
8
8
  MCP_ACTOR_META_KEY,
@@ -40,7 +40,7 @@ import {
40
40
  normalizeGraphLabel,
41
41
  normalizeNameKey,
42
42
  parseListCursorToken
43
- } from "./chunk-MD5RCZCA.mjs";
43
+ } from "./chunk-DV4IQOVD.mjs";
44
44
 
45
45
  // src/preset.ts
46
46
  var DEFAULT_MEMORY_URL = `http://localhost:${DEFAULTS.MEMORY_SERVER_PORT}`;
@@ -8,7 +8,7 @@ import {
8
8
  TAXONOMY_MAX_PROJECTS,
9
9
  normalizeMemoryActorLabel
10
10
  } from "./chunk-RWQTBXUC.mjs";
11
- import "./chunk-MD5RCZCA.mjs";
11
+ import "./chunk-DV4IQOVD.mjs";
12
12
  import {
13
13
  EXIT
14
14
  } from "./chunk-4DXEQC6X.mjs";
@@ -25,7 +25,7 @@ import {
25
25
  parseHostedFileIngestJobView,
26
26
  parseHostedFileIngestPublishResult,
27
27
  requireHostedFileIngestFilename
28
- } from "./chunk-MD5RCZCA.mjs";
28
+ } from "./chunk-DV4IQOVD.mjs";
29
29
  import {
30
30
  syncMemoryRulesFromServer
31
31
  } from "./chunk-QR5K7ETI.mjs";
@@ -901,7 +901,7 @@ function createProxyServer(client, version, uploadLocalFile, hostedFileIngest) {
901
901
  return server;
902
902
  }
903
903
  async function runMcpProxyServer(opts) {
904
- const version = opts.version ?? (true ? "1.32.1" : "0.0.0-dev");
904
+ const version = opts.version ?? (true ? "1.33.0" : "0.0.0-dev");
905
905
  const read = await opts.readCredentials();
906
906
  if (!read.ok) {
907
907
  throw new Error(
package/dist/react.mjs CHANGED
@@ -11,10 +11,10 @@ import {
11
11
  toGraphologyFormat,
12
12
  transformGraphData,
13
13
  unreachableHealth
14
- } from "./chunk-UIR5VDPF.mjs";
15
- import "./chunk-F2G2TBLW.mjs";
14
+ } from "./chunk-XQIJM5PD.mjs";
15
+ import "./chunk-UWGKWV44.mjs";
16
16
  import "./chunk-RWQTBXUC.mjs";
17
- import "./chunk-MD5RCZCA.mjs";
17
+ import "./chunk-DV4IQOVD.mjs";
18
18
 
19
19
  // ../dashboard/src/hooks/use-consolidation-log.ts
20
20
  import { useCallback as useCallback2, useMemo } from "react";
@@ -10,7 +10,7 @@ import {
10
10
  TAXONOMY_MAX_SAMPLE_TOPICS,
11
11
  TAXONOMY_MAX_TOP_ENTITIES
12
12
  } from "./chunk-RWQTBXUC.mjs";
13
- import "./chunk-MD5RCZCA.mjs";
13
+ import "./chunk-DV4IQOVD.mjs";
14
14
  import {
15
15
  EXIT
16
16
  } from "./chunk-4DXEQC6X.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pyxmate/memory",
3
- "version": "1.32.1",
3
+ "version": "1.33.0",
4
4
  "type": "module",
5
5
  "description": "SDK for pyx-memory — Memory as a Service for AI agents",
6
6
  "license": "MIT",