@pyxmate/memory 0.39.0 → 0.41.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.
- package/dist/{chunk-TDPGRIJW.mjs → chunk-J3HY44AP.mjs} +1 -1
- package/dist/{chunk-CK7VUON3.mjs → chunk-YT46GYB3.mjs} +4 -4
- package/dist/cli/pyx-mem.mjs +12 -8
- package/dist/dashboard.mjs +2 -2
- package/dist/index.d.ts +20 -4
- package/dist/index.mjs +1 -1
- package/dist/react.mjs +2 -2
- package/package.json +1 -1
|
@@ -107,6 +107,8 @@ var MemoryClient = class {
|
|
|
107
107
|
}
|
|
108
108
|
if (params.asOf) searchParams.set("asOf", params.asOf);
|
|
109
109
|
if (params.anchorTime) searchParams.set("anchorTime", params.anchorTime);
|
|
110
|
+
const enumerationConcept = params.enumerationConcept?.trim();
|
|
111
|
+
if (enumerationConcept) searchParams.set("enumerationConcept", enumerationConcept);
|
|
110
112
|
if (params.abstentionThreshold != null)
|
|
111
113
|
searchParams.set("abstentionThreshold", String(params.abstentionThreshold));
|
|
112
114
|
return this.fetchApi(`/api/memory/search?${searchParams}`);
|
|
@@ -733,10 +735,8 @@ var MemoryClient = class {
|
|
|
733
735
|
* positive overlap. pyx never auto-prepends — the agent owns inclusion.
|
|
734
736
|
*/
|
|
735
737
|
async fetchApplicableCorrections(input) {
|
|
736
|
-
const params = new URLSearchParams({
|
|
737
|
-
|
|
738
|
-
taskShape: input.taskShape
|
|
739
|
-
});
|
|
738
|
+
const params = new URLSearchParams({ taskShape: input.taskShape });
|
|
739
|
+
if (input.namespaceId) params.set("namespaceId", input.namespaceId);
|
|
740
740
|
if (input.project) params.set("project", input.project);
|
|
741
741
|
if (input.limit !== void 0) params.set("limit", String(input.limit));
|
|
742
742
|
return this.fetchApi(`/api/memory/corrections?${params}`);
|
package/dist/cli/pyx-mem.mjs
CHANGED
|
@@ -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) {
|
|
@@ -713,7 +713,7 @@ var scopeShape = {
|
|
|
713
713
|
|
|
714
714
|
// src/mcp/tools/corrections.ts
|
|
715
715
|
var recordInputShape = {
|
|
716
|
-
namespaceId: z2.string().min(1).describe("Namespace id to record
|
|
716
|
+
namespaceId: z2.string().min(1).optional().describe("Namespace id to record into. Omit in single-tenant deployments (namespace-free)."),
|
|
717
717
|
whatWasWrong: z2.string().min(1).describe("What the agent did wrong."),
|
|
718
718
|
whatToDoInstead: z2.string().min(1).describe("The corrective instruction to follow instead."),
|
|
719
719
|
appliesWhen: z2.string().min(1).describe("When this correction applies \u2014 the task context future tasks are matched against."),
|
|
@@ -738,7 +738,7 @@ var recordCorrectionTool = {
|
|
|
738
738
|
method: "POST",
|
|
739
739
|
path: "/api/memory/corrections",
|
|
740
740
|
body: {
|
|
741
|
-
namespaceId: args.namespaceId,
|
|
741
|
+
...args.namespaceId !== void 0 ? { namespaceId: args.namespaceId } : {},
|
|
742
742
|
whatWasWrong: args.whatWasWrong,
|
|
743
743
|
whatToDoInstead: args.whatToDoInstead,
|
|
744
744
|
appliesWhen: args.appliesWhen,
|
|
@@ -751,7 +751,7 @@ var recordCorrectionTool = {
|
|
|
751
751
|
}
|
|
752
752
|
};
|
|
753
753
|
var fetchInputShape = {
|
|
754
|
-
namespaceId: z2.string().min(1).describe("Namespace id whose corrections to fetch."),
|
|
754
|
+
namespaceId: z2.string().min(1).optional().describe("Namespace id whose corrections to fetch. Omit in single-tenant deployments."),
|
|
755
755
|
taskShape: z2.string().min(1).describe("Shape of the task about to run \u2014 scored against each correction."),
|
|
756
756
|
project: z2.string().optional().describe("Optional project filter."),
|
|
757
757
|
limit: z2.number().int().positive().optional().describe("Max corrections to return (cap 5)."),
|
|
@@ -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
|
-
|
|
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,9 @@ 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
|
+
),
|
|
1111
1114
|
...scopeShape
|
|
1112
1115
|
};
|
|
1113
1116
|
var searchMemoriesTool = {
|
|
@@ -1141,7 +1144,8 @@ var searchMemoriesTool = {
|
|
|
1141
1144
|
eventTimeStart: args.eventTimeStart,
|
|
1142
1145
|
eventTimeEnd: args.eventTimeEnd,
|
|
1143
1146
|
asOf: args.asOf,
|
|
1144
|
-
anchorTime: args.anchorTime
|
|
1147
|
+
anchorTime: args.anchorTime,
|
|
1148
|
+
enumerationConcept: args.enumerationConcept
|
|
1145
1149
|
},
|
|
1146
1150
|
scope: args
|
|
1147
1151
|
});
|
|
@@ -1283,7 +1287,7 @@ var inputShape9 = {
|
|
|
1283
1287
|
type: z12.enum(relationshipTypes).describe("Relationship type.")
|
|
1284
1288
|
})
|
|
1285
1289
|
).optional().describe(
|
|
1286
|
-
|
|
1290
|
+
'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
1291
|
),
|
|
1288
1292
|
extractEntities: z12.boolean().optional().describe(
|
|
1289
1293
|
"Override extraction: false skips caller-side extraction; true requires caller entities or MCP sampling and errors loudly if neither is available."
|
|
@@ -1420,7 +1424,7 @@ var ALL_TOOL_NAMES = ALL_TOOLS.map((t) => t.name);
|
|
|
1420
1424
|
// src/mcp/server.ts
|
|
1421
1425
|
async function runMcpServer(opts) {
|
|
1422
1426
|
const fetchImpl = opts.fetchImpl ?? fetch;
|
|
1423
|
-
const version = opts.version ?? (true ? "0.
|
|
1427
|
+
const version = opts.version ?? (true ? "0.41.0" : "0.0.0-dev");
|
|
1424
1428
|
const server = new McpServer(
|
|
1425
1429
|
{ name: "pyx-memory", version },
|
|
1426
1430
|
{ instructions: PYX_MEMORY_INSTRUCTIONS, capabilities: { tools: {} } }
|
package/dist/dashboard.mjs
CHANGED
|
@@ -11,8 +11,8 @@ import {
|
|
|
11
11
|
toGraphologyFormat,
|
|
12
12
|
transformGraphData,
|
|
13
13
|
unreachableHealth
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-J3HY44AP.mjs";
|
|
15
|
+
import "./chunk-YT46GYB3.mjs";
|
|
16
16
|
import "./chunk-KSTI4M52.mjs";
|
|
17
17
|
export {
|
|
18
18
|
DashboardClient,
|
package/dist/index.d.ts
CHANGED
|
@@ -394,7 +394,8 @@ declare class MemoryClient implements ExtendedMemoryInterface {
|
|
|
394
394
|
* the body carries only the correction fields. Returns `{ id, createdAt }`.
|
|
395
395
|
*/
|
|
396
396
|
recordCorrection(input: {
|
|
397
|
-
|
|
397
|
+
/** Omit in single-tenant deployments — corrections are stored namespace-free. */
|
|
398
|
+
namespaceId?: string;
|
|
398
399
|
whatWasWrong: string;
|
|
399
400
|
whatToDoInstead: string;
|
|
400
401
|
appliesWhen: string;
|
|
@@ -410,7 +411,8 @@ declare class MemoryClient implements ExtendedMemoryInterface {
|
|
|
410
411
|
* positive overlap. pyx never auto-prepends — the agent owns inclusion.
|
|
411
412
|
*/
|
|
412
413
|
fetchApplicableCorrections(input: {
|
|
413
|
-
|
|
414
|
+
/** Omit in single-tenant deployments — reads the namespace-free scope. */
|
|
415
|
+
namespaceId?: string;
|
|
414
416
|
taskShape: string;
|
|
415
417
|
project?: string;
|
|
416
418
|
limit?: number;
|
|
@@ -585,6 +587,14 @@ interface MemorySearchParams {
|
|
|
585
587
|
* over the query-text year parse (hybrid strategy).
|
|
586
588
|
*/
|
|
587
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;
|
|
588
598
|
/** Confidence threshold below which the system recommends abstention (0.0–1.0). Default: 0.3. */
|
|
589
599
|
abstentionThreshold?: number;
|
|
590
600
|
/**
|
|
@@ -878,7 +888,12 @@ interface MemoryIngestRequest {
|
|
|
878
888
|
*/
|
|
879
889
|
interface CorrectionInput {
|
|
880
890
|
tenantId: string;
|
|
881
|
-
|
|
891
|
+
/**
|
|
892
|
+
* Namespace partition. Required in multi-tenant mode (the isolation
|
|
893
|
+
* boundary). Optional in single-tenant mode, where corrections are stored
|
|
894
|
+
* namespace-free (`namespace_id IS NULL`) exactly like ordinary writes.
|
|
895
|
+
*/
|
|
896
|
+
namespaceId?: string;
|
|
882
897
|
/** What the agent did wrong (required free text). */
|
|
883
898
|
whatWasWrong: string;
|
|
884
899
|
/** The corrective instruction (required free text) — stored as `entry.content`. */
|
|
@@ -895,7 +910,8 @@ interface CorrectionInput {
|
|
|
895
910
|
/** Input to `Memory.fetchApplicableCorrections`. */
|
|
896
911
|
interface FetchCorrectionsInput {
|
|
897
912
|
tenantId: string;
|
|
898
|
-
|
|
913
|
+
/** Namespace partition; omit to read the namespace-free scope (single-tenant mode). */
|
|
914
|
+
namespaceId?: string;
|
|
899
915
|
/** Shape of the task about to run — scored against each correction's `appliesWhen`. */
|
|
900
916
|
taskShape: string;
|
|
901
917
|
/** Optional project filter — keeps only project-matching or project-absent rows. */
|
package/dist/index.mjs
CHANGED
package/dist/react.mjs
CHANGED
|
@@ -11,8 +11,8 @@ import {
|
|
|
11
11
|
toGraphologyFormat,
|
|
12
12
|
transformGraphData,
|
|
13
13
|
unreachableHealth
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-J3HY44AP.mjs";
|
|
15
|
+
import "./chunk-YT46GYB3.mjs";
|
|
16
16
|
import "./chunk-KSTI4M52.mjs";
|
|
17
17
|
|
|
18
18
|
// ../dashboard/src/hooks/use-consolidation-log.ts
|