@pyxmate/memory 0.40.0 → 0.43.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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  MemoryClient
3
- } from "./chunk-YHE5343S.mjs";
3
+ } from "./chunk-UV2DFSKR.mjs";
4
4
 
5
5
  // ../dashboard/src/aggregations/consolidation-analytics.ts
6
6
  function analyzeConsolidationLog(entries) {
@@ -85,11 +85,6 @@ var MemoryClient = class {
85
85
  });
86
86
  }
87
87
  async search(params) {
88
- if (params.enableRerank) {
89
- throw new Error(
90
- "enableRerank is embedded-only (the HTTP API does not forward it); use the embedded Memory class for cross-encoder reranking"
91
- );
92
- }
93
88
  if (params.enableMultiHop) {
94
89
  throw new Error(
95
90
  "enableMultiHop is embedded-only (the HTTP API does not forward it); use the embedded Memory class for iterative multi-hop retrieval"
@@ -101,12 +96,15 @@ var MemoryClient = class {
101
96
  if (params.agentId) searchParams.set("agentId", params.agentId);
102
97
  if (params.strategy) searchParams.set("strategy", params.strategy);
103
98
  if (params.effort) searchParams.set("effort", params.effort);
99
+ if (params.enableRerank) searchParams.set("enableRerank", "true");
104
100
  if (params.eventTimeRange) {
105
101
  searchParams.set("eventTimeStart", params.eventTimeRange[0]);
106
102
  searchParams.set("eventTimeEnd", params.eventTimeRange[1]);
107
103
  }
108
104
  if (params.asOf) searchParams.set("asOf", params.asOf);
109
105
  if (params.anchorTime) searchParams.set("anchorTime", params.anchorTime);
106
+ const enumerationConcept = params.enumerationConcept?.trim();
107
+ if (enumerationConcept) searchParams.set("enumerationConcept", enumerationConcept);
110
108
  if (params.abstentionThreshold != null)
111
109
  searchParams.set("abstentionThreshold", String(params.abstentionThreshold));
112
110
  return this.fetchApi(`/api/memory/search?${searchParams}`);
@@ -555,7 +555,7 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
555
555
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
556
556
 
557
557
  // src/mcp/instructions.ts
558
- var PYX_MEMORY_INSTRUCTIONS = `Use pyx-memory to search durable project/user memory before assuming prior decisions, and to store concise facts after corrections, bug fixes, design decisions, integration discoveries, gotchas, explicit preferences, or "remember this" requests. Store decisions, not deliberation. Include topic and project. Pass eventTime (ISO-8601, when the fact happened or took effect) for any fact that can change or go stale \u2014 job/status changes, decisions that supersede earlier ones, dated events; recency ordering, dated ("as of") queries, and stale-vs-current conflict resolution all key off it. Search effort is retrieval depth: quick=strongest, deep=everything including archived/superseded. Use reinforce after memories were actually used, so they surface in quick/medium effort tiers. Use lineage for the history of how a fact changed; pass subject+relation for graph lineage or entryId for a superseded chain. When a question names a time \u2014 explicit or relative ("last year", "\uB450 \uB2EC \uC804") \u2014 resolve it to an absolute ISO-8601 timestamp yourself and pass it as search anchorTime: results then rank by proximity to this time instead of now, without excluding anything. When content names people, organizations, tools, places, events, or key concepts, you (the caller) must extract and pass both entities and relationships \u2014 the server does not auto-extract them. Edges matter as much as nodes: without relationships the graph cannot connect related memories. Use file ingest for documents/images worth persisting; images require a description.`;
558
+ var PYX_MEMORY_INSTRUCTIONS = `Use pyx-memory to search durable project/user memory before assuming prior decisions, and to store concise facts after corrections, bug fixes, design decisions, integration discoveries, gotchas, explicit preferences, or "remember this" requests. Store decisions, not deliberation. Include topic and project. Pass eventTime (ISO-8601, when the fact happened or took effect) for any fact that can change or go stale \u2014 job/status changes, decisions that supersede earlier ones, dated events; recency ordering, dated ("as of") queries, and stale-vs-current conflict resolution all key off it. Search effort is retrieval depth: quick=strongest, deep=everything including archived/superseded. Use reinforce after memories were actually used, so they surface in quick/medium effort tiers. Use lineage for the history of how a fact changed; pass subject+relation for graph lineage or entryId for a superseded chain. Use record_correction when the user corrects a mistake you made (what was wrong, what to do instead, when it applies); call fetch_applicable_corrections before a task to retrieve the corrections that match it, then decide which to follow \u2014 pyx never auto-applies them. When a question names a time \u2014 explicit or relative ("last year", "\uB450 \uB2EC \uC804") \u2014 resolve it to an absolute ISO-8601 timestamp yourself and pass it as search anchorTime: results then rank by proximity to this time instead of now, without excluding anything. For count/list questions about a category, pass \`enumerationConcept\` = the language-agnostic/global category phrase (e.g. "fitness classes" / "\uC6B4\uB3D9 \uC218\uC5C5"); the caller-supplied hint is resolved by the embedding model, which covers a broad range of languages. pyx also auto-detects English/Korean count phrasing as a best-effort fallback when the hint is omitted. When content names people, organizations, tools, places, events, or key concepts, you (the caller) must extract and pass both entities and relationships \u2014 the server does not auto-extract them. Edges matter as much as nodes: without relationships the graph cannot connect related memories. For countable categories the user may later enumerate ("how many fitness classes / streaming services / pets do I have?"), add a canonical category CONCEPT node and an IS_A edge from each member to it. A language/synonym variant gives zero-cost exact-match resolution only when it is also a memberful CONCEPT node with member IS_A edges; there is no query-time alias\u2192canonical resolver. pyx resolves count/list category hints at query time via strict embedding over memberful CONCEPT nodes. Use file ingest for documents/images worth persisting; images require a description.`;
559
559
 
560
560
  // src/mcp/sampling.ts
561
561
  function createSamplingClient(server) {
@@ -1091,7 +1091,7 @@ import { z as z10 } from "zod";
1091
1091
  var inputShape7 = {
1092
1092
  query: z10.string().min(1).describe("Required natural-language search text."),
1093
1093
  limit: z10.number().int().min(1).max(100).optional().describe(
1094
- 'Target result count; server clamps to 1\u2013100. Default 10. The hybrid strategy may widen enumeration/count queries ("how many \u2026", "list all/every \u2026") up to 30 for set-completeness recall.'
1094
+ "Target result count; server clamps to 1\u2013100. Default 10. The hybrid strategy may widen count/list searches up to 30 for set-completeness recall when the caller passes `enumerationConcept`; English/Korean marker auto-detect is a best-effort fallback."
1095
1095
  ),
1096
1096
  strategy: z10.enum(["naive", "graph", "hybrid"]).optional().describe(
1097
1097
  "RAG strategy. Defaults to `hybrid` (cross-encoder reranking, multi-entity decomposition, confidence scoring) and is sent explicitly when omitted; pass `naive` for a lighter vector-only search or `graph` for graph-augmented retrieval."
@@ -1108,6 +1108,12 @@ var inputShape7 = {
1108
1108
  anchorTime: z10.string().optional().describe(
1109
1109
  'Soft recency ANCHOR (ISO-8601) \u2014 ranks results by proximity to this time instead of now; never excludes anything. When the question names a relative time ("two months ago", "last year", "3\uB144 \uC804"), resolve it against the current date yourself and pass the absolute timestamp here; prefer this over eventTimeStart/End unless a strict window is required, because hard filters drop last-known-before facts.'
1110
1110
  ),
1111
+ enumerationConcept: z10.string().trim().min(1).optional().describe(
1112
+ 'For count/list questions about a category, pass the language-agnostic/global category phrase here (for example, "fitness classes" or "\uC6B4\uB3D9 \uC218\uC5C5"). The embedding model resolves the caller-supplied hint across a broad range of languages.'
1113
+ ),
1114
+ enableRerank: z10.boolean().optional().describe(
1115
+ "Opt into multilingual cross-encoder reranking (hybrid strategy only). Sharply improves Korean/cross-lingual ordering at higher latency; leave off for the fast default path."
1116
+ ),
1111
1117
  ...scopeShape
1112
1118
  };
1113
1119
  var searchMemoriesTool = {
@@ -1141,7 +1147,9 @@ var searchMemoriesTool = {
1141
1147
  eventTimeStart: args.eventTimeStart,
1142
1148
  eventTimeEnd: args.eventTimeEnd,
1143
1149
  asOf: args.asOf,
1144
- anchorTime: args.anchorTime
1150
+ anchorTime: args.anchorTime,
1151
+ enumerationConcept: args.enumerationConcept,
1152
+ enableRerank: args.enableRerank ? "true" : void 0
1145
1153
  },
1146
1154
  scope: args
1147
1155
  });
@@ -1283,7 +1291,7 @@ var inputShape9 = {
1283
1291
  type: z12.enum(relationshipTypes).describe("Relationship type.")
1284
1292
  })
1285
1293
  ).optional().describe(
1286
- "Edges between entities; source and target must be entity names from this request. Relationships matter as much as entities because graph traversal needs edges to connect related memories."
1294
+ 'Edges between entities; source and target must be entity names from this request. Relationships matter as much as entities because graph traversal needs edges to connect related memories. For countable categories the user may later enumerate ("how many fitness classes / streaming services / pets do I have?"), add a canonical category CONCEPT node and an IS_A edge from each member to it. A language/synonym variant gives zero-cost exact-match resolution only when it is also a memberful CONCEPT node with member IS_A edges; there is no query-time alias\u2192canonical resolver. pyx resolves un-enumerated count-noun variants at query time via strict embedding over memberful CONCEPT nodes.'
1287
1295
  ),
1288
1296
  extractEntities: z12.boolean().optional().describe(
1289
1297
  "Override extraction: false skips caller-side extraction; true requires caller entities or MCP sampling and errors loudly if neither is available."
@@ -1420,7 +1428,7 @@ var ALL_TOOL_NAMES = ALL_TOOLS.map((t) => t.name);
1420
1428
  // src/mcp/server.ts
1421
1429
  async function runMcpServer(opts) {
1422
1430
  const fetchImpl = opts.fetchImpl ?? fetch;
1423
- const version = opts.version ?? (true ? "0.40.0" : "0.0.0-dev");
1431
+ const version = opts.version ?? (true ? "0.43.0" : "0.0.0-dev");
1424
1432
  const server = new McpServer(
1425
1433
  { name: "pyx-memory", version },
1426
1434
  { instructions: PYX_MEMORY_INSTRUCTIONS, capabilities: { tools: {} } }
@@ -11,8 +11,8 @@ import {
11
11
  toGraphologyFormat,
12
12
  transformGraphData,
13
13
  unreachableHealth
14
- } from "./chunk-OTNDFYEI.mjs";
15
- import "./chunk-YHE5343S.mjs";
14
+ } from "./chunk-DKNGLNN4.mjs";
15
+ import "./chunk-UV2DFSKR.mjs";
16
16
  import "./chunk-KSTI4M52.mjs";
17
17
  export {
18
18
  DashboardClient,
package/dist/index.d.ts CHANGED
@@ -587,6 +587,14 @@ interface MemorySearchParams {
587
587
  * over the query-text year parse (hybrid strategy).
588
588
  */
589
589
  anchorTime?: string;
590
+ /**
591
+ * The category the user is asking to count/list (e.g. "fitness classes",
592
+ * "운동 수업", any language). Presence signals enumeration intent and supplies
593
+ * the category for graph resolution; the caller (which understands the user's
594
+ * language) sets it. When omitted, pyx falls back to a deterministic EN/KO
595
+ * marker detector.
596
+ */
597
+ enumerationConcept?: string;
590
598
  /** Confidence threshold below which the system recommends abstention (0.0–1.0). Default: 0.3. */
591
599
  abstentionThreshold?: number;
592
600
  /**
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  MemoryClient,
3
3
  MemoryServerError
4
- } from "./chunk-YHE5343S.mjs";
4
+ } from "./chunk-UV2DFSKR.mjs";
5
5
  import {
6
6
  DEFAULTS,
7
7
  DEPRECATED_RAG_STRATEGIES,
package/dist/react.mjs CHANGED
@@ -11,8 +11,8 @@ import {
11
11
  toGraphologyFormat,
12
12
  transformGraphData,
13
13
  unreachableHealth
14
- } from "./chunk-OTNDFYEI.mjs";
15
- import "./chunk-YHE5343S.mjs";
14
+ } from "./chunk-DKNGLNN4.mjs";
15
+ import "./chunk-UV2DFSKR.mjs";
16
16
  import "./chunk-KSTI4M52.mjs";
17
17
 
18
18
  // ../dashboard/src/hooks/use-consolidation-log.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pyxmate/memory",
3
- "version": "0.40.0",
3
+ "version": "0.43.0",
4
4
  "type": "module",
5
5
  "description": "SDK for pyx-memory — Memory as a Service for AI agents",
6
6
  "license": "MIT",