@pyxmate/memory 0.18.2 → 0.19.1

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-SHT5FPV6.mjs";
3
+ } from "./chunk-D5PMQYZM.mjs";
4
4
 
5
5
  // ../dashboard/src/aggregations/consolidation-analytics.ts
6
6
  function analyzeConsolidationLog(entries) {
@@ -574,6 +574,19 @@ var MemoryClient = class {
574
574
  );
575
575
  return result.entries;
576
576
  }
577
+ async summarizeEntity(name) {
578
+ return this.fetchApi("/api/memory/synthesis/entity", {
579
+ method: "POST",
580
+ body: JSON.stringify({ name })
581
+ });
582
+ }
583
+ async getEntitySynthesis(name) {
584
+ const params = new URLSearchParams({ name });
585
+ const result = await this.fetchApi(
586
+ `/api/memory/synthesis/entity?${params}`
587
+ );
588
+ return result.entry;
589
+ }
577
590
  async fetchApi(path, options) {
578
591
  const signal = options?.signal ?? AbortSignal.timeout(this._requestTimeoutMs);
579
592
  let res;
@@ -11,8 +11,8 @@ import {
11
11
  toGraphologyFormat,
12
12
  transformGraphData,
13
13
  unreachableHealth
14
- } from "./chunk-HV6A2WTS.mjs";
15
- import "./chunk-SHT5FPV6.mjs";
14
+ } from "./chunk-4DRKAXJE.mjs";
15
+ import "./chunk-D5PMQYZM.mjs";
16
16
  export {
17
17
  DashboardClient,
18
18
  Poller,
package/dist/index.d.ts CHANGED
@@ -107,6 +107,18 @@ interface ExtendedMemoryInterface extends MemoryInterface {
107
107
  * Cursor-based via `since` (created_at lower bound). No totalCount.
108
108
  */
109
109
  log(filters?: MemoryLogFilters): Promise<MemoryEntry$1[]>;
110
+ /**
111
+ * Synthesize a per-entity profile (Karpathy-wiki "wiki page" primitive).
112
+ * LLM-driven, caller-triggered. Stores a pinned `_kind:'entity-summary'`
113
+ * entry with `_search_visibility:'on-demand'` so it never enters the
114
+ * default retrieval pool. Re-running replaces the prior synthesis.
115
+ */
116
+ summarizeEntity(name: string): Promise<MemoryEntry$1>;
117
+ /**
118
+ * Fetch a previously-synthesized entity profile. Returns `null` when no
119
+ * synthesis exists yet. O(1) — the read side of the amortized pattern.
120
+ */
121
+ getEntitySynthesis(name: string): Promise<MemoryEntry$1 | null>;
110
122
  }
111
123
 
112
124
  /**
@@ -278,6 +290,8 @@ declare class MemoryClient implements ExtendedMemoryInterface {
278
290
  queryAsOf(asOfDate: string, filters?: TemporalQueryFilters): Promise<MemoryEntry$1[]>;
279
291
  log(filters?: MemoryLogFilters): Promise<MemoryEntry$1[]>;
280
292
  queryByEventTime(startTime: string, endTime: string, filters?: TemporalQueryFilters): Promise<MemoryEntry$1[]>;
293
+ summarizeEntity(name: string): Promise<MemoryEntry$1>;
294
+ getEntitySynthesis(name: string): Promise<MemoryEntry$1 | null>;
281
295
  protected fetchApi<T>(path: string, options?: RequestInit): Promise<T>;
282
296
  /**
283
297
  * Map fetch-layer rejections into a typed `MemoryServerError` so callers
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  MemoryClient,
3
3
  MemoryServerError
4
- } from "./chunk-SHT5FPV6.mjs";
4
+ } from "./chunk-D5PMQYZM.mjs";
5
5
 
6
6
  // ../shared/src/constants/defaults.ts
7
7
  var DEFAULTS = {
package/dist/react.mjs CHANGED
@@ -11,8 +11,8 @@ import {
11
11
  toGraphologyFormat,
12
12
  transformGraphData,
13
13
  unreachableHealth
14
- } from "./chunk-HV6A2WTS.mjs";
15
- import "./chunk-SHT5FPV6.mjs";
14
+ } from "./chunk-4DRKAXJE.mjs";
15
+ import "./chunk-D5PMQYZM.mjs";
16
16
 
17
17
  // ../dashboard/src/hooks/use-consolidation-log.ts
18
18
  import { useCallback as useCallback2, useMemo } from "react";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pyxmate/memory",
3
- "version": "0.18.2",
3
+ "version": "0.19.1",
4
4
  "type": "module",
5
5
  "description": "SDK for pyx-memory — Memory as a Service for AI agents",
6
6
  "license": "MIT",
@@ -1,23 +1,28 @@
1
1
  ---
2
2
  name: pyx-memory
3
3
  description: >
4
- Persistent memory system for AI agents. Use this skill to store and retrieve
5
- knowledge across conversations via pyx-memory. Triggers whenever you need to
6
- remember something, recall prior context, store a decision or bug fix, ingest
7
- files or images, or search for what was discussed before. Also use when
8
- integrating the pyx-memory SDK into code, working with MemoryClient, or using
9
- the HTTP API. Covers multi-tenant isolation (tenantId, TENANT_MODE),
10
- fine-grained ReBAC (namespaces, principals, authz tuples, AuthzPlan),
11
- sensitivity classification, encryption at rest, and confidence/abstention.
12
- Triggers on: 'remember', 'recall', 'store memory', 'search memory',
13
- 'ingest file', 'store this image', 'remember this document',
14
- 'what did we decide', 'pyx-memory', 'memory', 'MemoryClient',
15
- 'integrate memory', 'memory consolidation', 'multi-tenant',
16
- 'tenant isolation', 'sensitivity', 'encryption', 'confidence',
17
- 'abstention', 'access control', 'RBAC', 'ReBAC', 'Zanzibar',
18
- 'namespace', 'principal', 'authz tuple', 'permission', 'permissions',
19
- 'role', 'role-based access', 'read-only', 'agent isolation',
20
- 'per-agent memory'.
4
+ Persistent memory system for AI agents store and retrieve knowledge across
5
+ conversations via pyx-memory. Use this skill whenever you need to remember
6
+ something for later, recall what was discussed or decided in a prior session,
7
+ search stored memory before assuming, store a decision or bug-fix root cause,
8
+ or ingest files, documents, or images into long-term memory. Also use it for
9
+ the lifecycle and wiki primitives: building a per-entity profile or "wiki
10
+ page" (summarizeEntity / getEntitySynthesis an amortized "tell me about
11
+ X / give me a profile of this customer" synthesis that is computed once and
12
+ reused); browsing a chronological feed of what was added and when (memory
13
+ log "what has the agent learned", "what's new since last week"); linting
14
+ memory health (orphaned graph nodes, stale syntheses, dedup candidates); and
15
+ consolidation, decay, or session summarization. Use it for any integration
16
+ work with the pyx-memory SDK, MemoryClient, or HTTP API — including
17
+ multi-tenant isolation, fine-grained ReBAC (namespaces, principals, authz
18
+ tuples, AuthzPlan), sensitivity classification, encryption at rest, and
19
+ confidence/abstention scoring. Trigger this skill even when the user does
20
+ not say "pyx-memory" by name: phrases like "remember this", "what did we
21
+ decide", "recall earlier context", "store this decision", "search memory",
22
+ "give me a profile of <person/customer>", "summarize everything we know
23
+ about X", "what has the agent learned", or "set up per-agent / per-tenant
24
+ memory isolation" all indicate this skill should be used. When in doubt
25
+ about whether a request involves agent memory, prefer using this skill.
21
26
  allowed-tools: Read, Grep, Glob, Edit, Write, Bash(curl *)
22
27
  argument-hint: "[store|search|ingest] <content or query>"
23
28
  ---
@@ -46,7 +46,7 @@ const client = new MemoryClient('http://localhost:7822', process.env.MEMORY_API_
46
46
  | POST | `/api/memory/graph/query` | Traverse (JSON: `{ nodeId, depth? }`) |
47
47
  | POST | `/api/memory/graph/clear` | Clear all graph nodes and edges (admin) |
48
48
 
49
- ## Lifecycle (9 endpoints)
49
+ ## Lifecycle (13 endpoints)
50
50
 
51
51
  | Method | Endpoint | Description |
52
52
  |--------|----------|-------------|
@@ -59,6 +59,10 @@ const client = new MemoryClient('http://localhost:7822', process.env.MEMORY_API_
59
59
  | GET | `/api/memory/consolidation-log` | Audit trail |
60
60
  | GET | `/api/memory/query-as-of?asOf=...` | Bi-temporal point-in-time query (asOf, type, agentId, source, limit) |
61
61
  | GET | `/api/memory/query-by-event-time?startTime=...&endTime=...` | Bi-temporal event time range query (startTime, endTime, type, agentId, source, limit) |
62
+ | GET | `/api/memory/lint` | Read-only memory-wide lint report — graph orphans, decay candidates, stale syntheses, dedup candidates (v0.18.0) |
63
+ | GET | `/api/memory/log?since=...` | Chronological feed (Karpathy `log.md`). Cursor-style via `since` created_at lower bound; also `limit`, `type`, `agentId`, `source`. Returns `{ entries, count, since? }` (v0.18.1) |
64
+ | POST | `/api/memory/synthesis/entity` | Synthesize a per-entity profile (Karpathy "wiki page"). JSON: `{ name }`. LLM-driven; stores a pinned `_kind:'entity-summary'` entry with `_search_visibility:'on-demand'`. Returns the entry, 201 (v0.19.0) |
65
+ | GET | `/api/memory/synthesis/entity?name=...` | Fetch a previously-synthesized entity profile. Returns `{ entry }` (`null` if none) (v0.19.0) |
62
66
 
63
67
  ## ReBAC Admin (11 endpoints)
64
68
 
@@ -3,7 +3,7 @@
3
3
  ## Contents
4
4
  - Type Cheat Sheet
5
5
  - MemoryInterface (9 methods)
6
- - ExtendedMemoryInterface (6 lifecycle methods)
6
+ - ExtendedMemoryInterface (10 lifecycle methods)
7
7
  - MemoryClient Constructor and Concrete Methods
8
8
  - DashboardClient
9
9
  - MemorySearchResult, MemoryEntry, MemorySearchParams
@@ -62,7 +62,7 @@ interface MemoryInterface {
62
62
  }
63
63
  ```
64
64
 
65
- ## ExtendedMemoryInterface (adds 6 lifecycle methods)
65
+ ## ExtendedMemoryInterface (adds 10 lifecycle methods)
66
66
 
67
67
  ```typescript
68
68
  interface ExtendedMemoryInterface extends MemoryInterface {
@@ -72,9 +72,34 @@ interface ExtendedMemoryInterface extends MemoryInterface {
72
72
  runDecay(): Promise<number>;
73
73
  reindex(): Promise<void>;
74
74
  deleteBySource(source: string): Promise<number>;
75
+ // v0.18.0 — read-only memory-wide lint report (graph orphans, decay
76
+ // candidates, stale syntheses, content-hash dedup candidates).
77
+ lint(options?: { limit?: number }): Promise<WikiLintReport>;
78
+ // v0.18.1 — chronological feed (Karpathy log.md primitive). Cursor-style
79
+ // via `since` (created_at lower bound). No totalCount.
80
+ log(filters?: MemoryLogFilters): Promise<MemoryEntry[]>;
81
+ // v0.19.0 — entity synthesis (Karpathy "wiki page" primitive).
82
+ // summarizeEntity is LLM-driven and caller-triggered; it stores a pinned
83
+ // `_kind:'entity-summary'` entry with `_search_visibility:'on-demand'`
84
+ // (excluded from search). getEntitySynthesis is the O(1) read path.
85
+ summarizeEntity(name: string): Promise<MemoryEntry>;
86
+ getEntitySynthesis(name: string): Promise<MemoryEntry | null>;
75
87
  }
76
88
  ```
77
89
 
90
+ `MemoryLogFilters` = `{ since?: string; limit?: number; type?: MemoryType; agentId?: string; source?: string }`.
91
+
92
+ ### Reserved metadata conventions
93
+
94
+ Some `metadata` keys carry behavior, not just data:
95
+
96
+ | Key | Value | Effect |
97
+ |-----|-------|--------|
98
+ | `_search_visibility` | `'on-demand'` | Entry is excluded from every RAG engine's retrieval pool (v0.18.2 hook). Still reachable via `get` / `list` / `log` and deterministic-id fetch. Field absent ⇒ visible. |
99
+ | `_kind` | `'entity-summary'` | Marks an entity synthesis. `Memory.lint` flags stale ones; the `synthesis:` id prefix is reserved for entries carrying this. |
100
+ | `_sourceEntryIds` | `string[]` | Provenance — the entries a synthesis was built from. |
101
+ | `_maxEventTime` | ISO string \| null | Staleness contract — `lint` flags the synthesis when a source's eventTime later exceeds this. |
102
+
78
103
  ## MemoryClient Constructor and Concrete Methods
79
104
 
80
105
  ```typescript
@@ -100,7 +125,7 @@ Graph queries and file ingestion are available without `@pyx-memory/core`.
100
125
 
101
126
  ```typescript
102
127
  class MemoryClient implements ExtendedMemoryInterface {
103
- // ... all 15 interface methods (9 base + 6 lifecycle) ...
128
+ // ... all 19 interface methods (9 base + 10 lifecycle) ...
104
129
 
105
130
  // Graph operations (call pyx-memory server's graph endpoints)
106
131
  graphNodes(): Promise<GraphNode[]>;