@pyxmate/memory 1.9.0 → 1.11.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/agent-contract.mjs +1 -1
- package/dist/{chunk-BS6K64SA.mjs → chunk-5BLT7RSY.mjs} +2 -0
- package/dist/{chunk-MZF55IUR.mjs → chunk-HOBDPIHO.mjs} +1 -1
- package/dist/{chunk-AXH45N7T.mjs → chunk-LJ7OORIM.mjs} +6 -5
- package/dist/cli/pyx-mem.mjs +2 -2
- package/dist/dashboard.mjs +2 -2
- package/dist/index.d.ts +37 -1
- package/dist/index.mjs +3 -1
- package/dist/react.mjs +2 -2
- package/package.json +1 -1
package/dist/agent-contract.mjs
CHANGED
|
@@ -4,6 +4,7 @@ var DEFAULTS = {
|
|
|
4
4
|
VECTOR_PROVIDER: "lancedb",
|
|
5
5
|
MEMORY_SERVER_PORT: 7822
|
|
6
6
|
};
|
|
7
|
+
var TAXONOMY_MAX_CATEGORIES = 10;
|
|
7
8
|
|
|
8
9
|
// ../shared/src/graph/extraction.ts
|
|
9
10
|
function normalizeGraphLabel(value, fallback) {
|
|
@@ -973,6 +974,7 @@ var MemoryClient = class {
|
|
|
973
974
|
|
|
974
975
|
export {
|
|
975
976
|
DEFAULTS,
|
|
977
|
+
TAXONOMY_MAX_CATEGORIES,
|
|
976
978
|
normalizeGraphLabel,
|
|
977
979
|
normalizeNameKey,
|
|
978
980
|
mergeExtractedEntities,
|
|
@@ -11,7 +11,7 @@ var PERSISTENT_MEMORY_SECTION = [
|
|
|
11
11
|
"- Before suggesting an approach, search for prior decisions that might contradict it.",
|
|
12
12
|
"- When the user references prior work, search for it.",
|
|
13
13
|
"- When investigating a bug, search for prior occurrences and fixes.",
|
|
14
|
-
'- When a question names a time \u2014 explicit or relative ("last year"
|
|
14
|
+
'- When a question names a time \u2014 explicit or relative ("last year") \u2014 resolve it to an absolute ISO-8601 timestamp and pass it as search `anchorTime`: results rank by proximity to that time, without excluding other results.',
|
|
15
15
|
"- Match search `effort` to risk: use `quick` for routine recall; use `deep` when quick returns nothing, when prior state may be archived/superseded, or when full history matters.",
|
|
16
16
|
'- To trace how a fact changed ("what did X use before Y", how it evolved), call `lineage` with `subject` + `relation` or an `entryId` instead of stitching together searches.',
|
|
17
17
|
"- Recalled memories reflect what was true when written \u2014 if one names a file, function, flag, or version, verify it still exists before acting on it.",
|
|
@@ -34,11 +34,12 @@ var PERSISTENT_MEMORY_SECTION = [
|
|
|
34
34
|
"- Always include `topic` and `project`.",
|
|
35
35
|
"- Store concise facts and decisions, not deliberation.",
|
|
36
36
|
"- Keep one memory per concept; do not bundle unrelated facts.",
|
|
37
|
-
"- Do not store ephemeral file contents, raw logs, or step-by-step progress as it happens. High-frequency streams (wearable
|
|
38
|
-
'- Pass `eventTime` (ISO-8601, when the fact happened or took effect) for facts that can change or go stale
|
|
37
|
+
"- Do not store ephemeral file contents, raw logs, or step-by-step progress as it happens. High-frequency streams (sensor/wearable samples, metrics) must be aggregated into the dated fact or summary they support (with `eventTime`), never stored as one memory or graph node per sample.",
|
|
38
|
+
'- Pass `eventTime` (ISO-8601, when the fact happened or took effect) for facts that can change or go stale. Recency ordering, dated ("as of") queries, and stale-vs-current resolution key off it.',
|
|
39
39
|
"- Graph is a retrieval structure. When content names people, organizations, tools, places, events, or key concepts, pass `entities` and `relationships` when you can (caller-wins). On a multi-entity store, include at least one relationship connecting them, or use `triples` so edges are explicit. Relationships matter as much as entities for traversal. Entity-free memories are valid.",
|
|
40
|
-
'- Use specific durable entities
|
|
41
|
-
'- For countable categories the user may later enumerate
|
|
40
|
+
'- Use specific durable entities. Never create a catch-all hub node ("me", "health") linked to everything; mega-hubs degrade traversal. Bounded `IS_A` category nodes are the exception.',
|
|
41
|
+
'- For countable categories the user may later enumerate, add a canonical category `CONCEPT` node and an `IS_A` edge from each member to it (`"yoga"` IS_A `"fitness classes"`).',
|
|
42
|
+
"- Taxonomy: when a store response reports unnamed clusters, call get_taxonomy_state and name each cluster via name_cluster \u2014 short, domain-true names in the user's language; rename (previousName) only when composition clearly changed.",
|
|
42
43
|
"- Ingest documents/images only when they are worth persisting; images require a short description so they are searchable."
|
|
43
44
|
].join("\n");
|
|
44
45
|
function buildDesignGuide({ appName }) {
|
package/dist/cli/pyx-mem.mjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
PERSISTENT_MEMORY_SECTION,
|
|
4
4
|
buildDesignGuide
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-LJ7OORIM.mjs";
|
|
6
6
|
|
|
7
7
|
// src/cli/exit-codes.ts
|
|
8
8
|
var EXIT = {
|
|
@@ -798,7 +798,7 @@ function createProxyServer(client, version, uploadLocalFile) {
|
|
|
798
798
|
return server;
|
|
799
799
|
}
|
|
800
800
|
async function runMcpProxyServer(opts) {
|
|
801
|
-
const version = opts.version ?? (true ? "1.
|
|
801
|
+
const version = opts.version ?? (true ? "1.11.0" : "0.0.0-dev");
|
|
802
802
|
const read = await opts.readCredentials();
|
|
803
803
|
if (!read.ok) {
|
|
804
804
|
const text = read.result.content.map((c) => c.type === "text" ? c.text : "").join(" ").trim();
|
package/dist/dashboard.mjs
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -486,6 +486,7 @@ declare const DEFAULTS: {
|
|
|
486
486
|
readonly VECTOR_PROVIDER: "lancedb";
|
|
487
487
|
readonly MEMORY_SERVER_PORT: 7822;
|
|
488
488
|
};
|
|
489
|
+
declare const TAXONOMY_MAX_CATEGORIES = 10;
|
|
489
490
|
|
|
490
491
|
/** ISO 8601 timestamp string */
|
|
491
492
|
type Timestamp = string;
|
|
@@ -643,6 +644,8 @@ interface MemorySearchParams {
|
|
|
643
644
|
query: string;
|
|
644
645
|
type?: MemoryType;
|
|
645
646
|
agentId?: AgentId;
|
|
647
|
+
/** Optional caller session identifier used for in-process hygiene telemetry. */
|
|
648
|
+
sessionId?: string;
|
|
646
649
|
limit?: number;
|
|
647
650
|
strategy?: RAGStrategy;
|
|
648
651
|
/** Filter results to entries whose eventTime falls within [start, end] (ISO 8601). */
|
|
@@ -1024,6 +1027,37 @@ interface GraphTelemetrySnapshot {
|
|
|
1024
1027
|
/** Duration (ms) of the most recent getAllEdges call; null until one ran. */
|
|
1025
1028
|
allEdgesLastMs: number | null;
|
|
1026
1029
|
}
|
|
1030
|
+
/**
|
|
1031
|
+
* Since-boot usage-hygiene telemetry (in-process, serializable). Tracks whether
|
|
1032
|
+
* callers provide event-time/graph context on store, whether searches miss, how
|
|
1033
|
+
* reinforce is used, and whether sessions search before their first store.
|
|
1034
|
+
*/
|
|
1035
|
+
interface UsageHygieneSnapshot {
|
|
1036
|
+
/** Total Memory.store calls observed since boot. */
|
|
1037
|
+
storesTotal: number;
|
|
1038
|
+
/** Store calls whose input carried eventTime. */
|
|
1039
|
+
storesWithEventTime: number;
|
|
1040
|
+
/** Store calls whose input carried caller-supplied entities or relationships. */
|
|
1041
|
+
storesWithGraph: number;
|
|
1042
|
+
/** Store calls by input type; missing type is counted as "long-term". */
|
|
1043
|
+
storesByType: Record<string, number>;
|
|
1044
|
+
/** Total Memory.search calls observed since boot. */
|
|
1045
|
+
searchesTotal: number;
|
|
1046
|
+
/** Completed searches that returned zero entries. */
|
|
1047
|
+
searchesZeroResults: number;
|
|
1048
|
+
/** Total Memory.reinforce calls observed since boot. */
|
|
1049
|
+
reinforceTotal: number;
|
|
1050
|
+
/** Total get_taxonomy_state (Memory.getTaxonomyState) calls observed since boot. */
|
|
1051
|
+
taxonomyStateReadsTotal: number;
|
|
1052
|
+
/** Total name_cluster (Memory.nameCluster) calls observed since boot. */
|
|
1053
|
+
nameClusterCallsTotal: number;
|
|
1054
|
+
/** Reinforce calls by signal value. */
|
|
1055
|
+
reinforceBySignal: Record<string, number>;
|
|
1056
|
+
/** Sessions where at least one search happened before the first store. */
|
|
1057
|
+
searchBeforeFirstStoreSessions: number;
|
|
1058
|
+
/** Sessions whose first observed hygiene event was a store. */
|
|
1059
|
+
storeFirstSessions: number;
|
|
1060
|
+
}
|
|
1027
1061
|
interface MemoryStats {
|
|
1028
1062
|
totalEntries: number;
|
|
1029
1063
|
storageUsedBytes: number;
|
|
@@ -1039,6 +1073,8 @@ interface MemoryStats {
|
|
|
1039
1073
|
graphStore?: string;
|
|
1040
1074
|
/** Graph traversal telemetry; undefined when no graph store is active. */
|
|
1041
1075
|
graphTelemetry?: GraphTelemetrySnapshot;
|
|
1076
|
+
/** Usage-hygiene telemetry since process boot. */
|
|
1077
|
+
usageHygiene?: UsageHygieneSnapshot;
|
|
1042
1078
|
/** Whether the memory service is connected. False when using DisabledMemory. */
|
|
1043
1079
|
connected?: boolean;
|
|
1044
1080
|
}
|
|
@@ -1482,4 +1518,4 @@ interface CreatePyxMemoryOptions {
|
|
|
1482
1518
|
}
|
|
1483
1519
|
declare function createPyxMemory(opts?: CreatePyxMemoryOptions): MemoryClient;
|
|
1484
1520
|
|
|
1485
|
-
export { type AgentId, type ApiResponse, type ConsolidationRunResult, type CorrectionInput, type CorrectionRecord, type CreatePyxMemoryOptions, DEFAULTS, DEPRECATED_RAG_STRATEGIES, DisabledMemory, type DroppedGraphRelationship, EmbeddingProviderName, type EnrichmentCallbacks, type EntityExtractionResult, type ExtendedMemoryInterface, type FetchCorrectionsInput, type GraphEnrichment, type GraphEnrichmentStatus, 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, MemoryClient, type MemoryClientOptions, type MemoryEntry, type MemoryIngestRequest, type MemoryInterface, type MemoryListParams, type MemoryListResult, type MemoryLogFilters, 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, SINGLE_TENANT_ID, SensitivityLevel, type SourceEvidence, type StoreInput, StoreTarget, type TemporalQueryFilters, type TenantScopeOptions, type Timestamp, type Topology, type TopologyExtractionProvider, type TopologyServiceVariant, VectorProvider, type VectorStatus, type WikiLintReport, createPyxMemory, mergeExtractedEntities, normalizeGraphLabel, normalizeNameKey };
|
|
1521
|
+
export { type AgentId, type ApiResponse, type ConsolidationRunResult, type CorrectionInput, type CorrectionRecord, type CreatePyxMemoryOptions, DEFAULTS, DEPRECATED_RAG_STRATEGIES, DisabledMemory, type DroppedGraphRelationship, EmbeddingProviderName, type EnrichmentCallbacks, type EntityExtractionResult, type ExtendedMemoryInterface, type FetchCorrectionsInput, type GraphEnrichment, type GraphEnrichmentStatus, 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, MemoryClient, type MemoryClientOptions, type MemoryEntry, type MemoryIngestRequest, type MemoryInterface, type MemoryListParams, type MemoryListResult, type MemoryLogFilters, 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, SINGLE_TENANT_ID, SensitivityLevel, type SourceEvidence, type StoreInput, StoreTarget, TAXONOMY_MAX_CATEGORIES, type TemporalQueryFilters, type TenantScopeOptions, type Timestamp, type Topology, type TopologyExtractionProvider, type TopologyServiceVariant, type UsageHygieneSnapshot, VectorProvider, type VectorStatus, type WikiLintReport, createPyxMemory, mergeExtractedEntities, normalizeGraphLabel, normalizeNameKey };
|
package/dist/index.mjs
CHANGED
|
@@ -12,11 +12,12 @@ import {
|
|
|
12
12
|
SINGLE_TENANT_ID,
|
|
13
13
|
SensitivityLevel,
|
|
14
14
|
StoreTarget,
|
|
15
|
+
TAXONOMY_MAX_CATEGORIES,
|
|
15
16
|
VectorProvider,
|
|
16
17
|
mergeExtractedEntities,
|
|
17
18
|
normalizeGraphLabel,
|
|
18
19
|
normalizeNameKey
|
|
19
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-5BLT7RSY.mjs";
|
|
20
21
|
|
|
21
22
|
// src/preset.ts
|
|
22
23
|
var DEFAULT_MEMORY_URL = `http://localhost:${DEFAULTS.MEMORY_SERVER_PORT}`;
|
|
@@ -45,6 +46,7 @@ export {
|
|
|
45
46
|
SINGLE_TENANT_ID,
|
|
46
47
|
SensitivityLevel,
|
|
47
48
|
StoreTarget,
|
|
49
|
+
TAXONOMY_MAX_CATEGORIES,
|
|
48
50
|
VectorProvider,
|
|
49
51
|
createPyxMemory,
|
|
50
52
|
mergeExtractedEntities,
|
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-HOBDPIHO.mjs";
|
|
15
|
+
import "./chunk-5BLT7RSY.mjs";
|
|
16
16
|
|
|
17
17
|
// ../dashboard/src/hooks/use-consolidation-log.ts
|
|
18
18
|
import { useCallback as useCallback2, useMemo } from "react";
|