@pyxmate/memory 0.0.5-beta → 0.1.1-beta
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/README.md +10 -0
- package/bin/init.mjs +63 -0
- package/dist/{chunk-Q4QIILKH.mjs → chunk-JMXAZPDT.mjs} +39 -11
- package/dist/{chunk-EDIYGMT2.mjs → chunk-XNKO7F3P.mjs} +1 -1
- package/dist/dashboard.mjs +2 -2
- package/dist/index.d.ts +85 -40
- package/dist/index.mjs +10 -4
- package/dist/react.mjs +2 -2
- package/package.json +9 -3
- package/skills/pyx-memory-integration/SKILL.md +266 -0
- package/skills/pyx-memory-integration/examples/disabled-memory.ts +53 -0
- package/skills/pyx-memory-integration/examples/minimal-embedded.ts +25 -0
- package/skills/pyx-memory-integration/examples/minimal-sidecar.ts +14 -0
- package/skills/pyx-memory-integration/patterns/consumer.md +103 -0
- package/skills/pyx-memory-integration/patterns/embedded.md +223 -0
- package/skills/pyx-memory-integration/reference/advanced.md +139 -0
- package/skills/pyx-memory-integration/reference/http-api.md +82 -0
- package/skills/pyx-memory-integration/reference/parity.md +63 -0
- package/skills/pyx-memory-integration/reference/types.md +203 -0
package/README.md
CHANGED
|
@@ -10,6 +10,16 @@ Provides an HTTP client, shared types, and optional dashboard + React hooks for
|
|
|
10
10
|
npm install @pyxmate/memory
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
+
## Setup Claude Code Skills
|
|
14
|
+
|
|
15
|
+
If you use [Claude Code](https://docs.anthropic.com/en/docs/claude-code), run this command to install pyx-memory integration skills:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npx @pyxmate/memory init
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
This copies skill files into `.claude/skills/pyx-memory-integration/` so Claude Code auto-discovers pyx-memory patterns, types, and API reference when working in your project.
|
|
22
|
+
|
|
13
23
|
## Usage
|
|
14
24
|
|
|
15
25
|
```ts
|
package/bin/init.mjs
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { cpSync, existsSync, mkdirSync, readdirSync } from 'node:fs';
|
|
4
|
+
import { dirname, join, resolve } from 'node:path';
|
|
5
|
+
import { fileURLToPath } from 'node:url';
|
|
6
|
+
|
|
7
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
8
|
+
|
|
9
|
+
const command = process.argv[2];
|
|
10
|
+
|
|
11
|
+
if (command !== 'init') {
|
|
12
|
+
console.log(`Usage: pyxmate-memory init
|
|
13
|
+
|
|
14
|
+
Commands:
|
|
15
|
+
init Copy pyx-memory skill files into .claude/skills/ for Claude Code auto-discovery`);
|
|
16
|
+
process.exit(command ? 1 : 0);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const source = resolve(__dirname, '..', 'skills', 'pyx-memory-integration');
|
|
20
|
+
const target = resolve(process.cwd(), '.claude', 'skills', 'pyx-memory-integration');
|
|
21
|
+
|
|
22
|
+
if (!existsSync(source)) {
|
|
23
|
+
console.error('Error: Skills directory not found in package. Please reinstall @pyxmate/memory.');
|
|
24
|
+
process.exit(1);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Ensure target parent exists
|
|
28
|
+
mkdirSync(dirname(target), { recursive: true });
|
|
29
|
+
|
|
30
|
+
// Copy skills (overwrites existing files for idempotency)
|
|
31
|
+
cpSync(source, target, { recursive: true });
|
|
32
|
+
|
|
33
|
+
// Count copied files
|
|
34
|
+
function countFiles(dir) {
|
|
35
|
+
let count = 0;
|
|
36
|
+
for (const entry of readdirSync(dir, { withFileTypes: true })) {
|
|
37
|
+
if (entry.isDirectory()) {
|
|
38
|
+
count += countFiles(join(dir, entry.name));
|
|
39
|
+
} else {
|
|
40
|
+
count++;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return count;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function listFiles(dir, prefix = '') {
|
|
47
|
+
const lines = [];
|
|
48
|
+
for (const entry of readdirSync(dir, { withFileTypes: true })) {
|
|
49
|
+
if (entry.isDirectory()) {
|
|
50
|
+
lines.push(...listFiles(join(dir, entry.name), `${prefix}${entry.name}/`));
|
|
51
|
+
} else {
|
|
52
|
+
lines.push(` ${prefix}${entry.name}`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return lines;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const fileCount = countFiles(target);
|
|
59
|
+
const fileList = listFiles(target);
|
|
60
|
+
|
|
61
|
+
console.log(`Copied ${fileCount} skill files to .claude/skills/pyx-memory-integration/\n`);
|
|
62
|
+
console.log(fileList.join('\n'));
|
|
63
|
+
console.log('\nClaude Code will now auto-discover pyx-memory integration patterns.');
|
|
@@ -13,15 +13,20 @@ var MemoryServerError = class extends Error {
|
|
|
13
13
|
};
|
|
14
14
|
var MemoryClient = class {
|
|
15
15
|
baseUrl;
|
|
16
|
-
|
|
16
|
+
_authHeaders;
|
|
17
|
+
constructor(memoryUrl, apiKey) {
|
|
17
18
|
this.baseUrl = memoryUrl.replace(/\/$/, "");
|
|
19
|
+
const trimmed = apiKey?.trim();
|
|
20
|
+
this._authHeaders = trimmed ? { Authorization: `Bearer ${trimmed}` } : {};
|
|
18
21
|
}
|
|
19
22
|
/** Encode a path segment to prevent URL injection */
|
|
20
23
|
encodePathSegment(segment) {
|
|
21
24
|
return encodeURIComponent(segment);
|
|
22
25
|
}
|
|
23
26
|
async initialize() {
|
|
24
|
-
const response = await fetch(`${this.baseUrl}/health
|
|
27
|
+
const response = await fetch(`${this.baseUrl}/health`, {
|
|
28
|
+
headers: this._authHeaders
|
|
29
|
+
});
|
|
25
30
|
if (!response.ok) {
|
|
26
31
|
throw new Error(`Memory server not reachable at ${this.baseUrl}: ${response.status}`);
|
|
27
32
|
}
|
|
@@ -29,13 +34,7 @@ var MemoryClient = class {
|
|
|
29
34
|
async store(entry) {
|
|
30
35
|
return this.fetchApi("/api/memory/ingest", {
|
|
31
36
|
method: "POST",
|
|
32
|
-
body: JSON.stringify(
|
|
33
|
-
content: entry.content,
|
|
34
|
-
type: entry.type,
|
|
35
|
-
metadata: entry.metadata,
|
|
36
|
-
agentId: entry.agentId,
|
|
37
|
-
sessionId: entry.sessionId
|
|
38
|
-
})
|
|
37
|
+
body: JSON.stringify(entry)
|
|
39
38
|
});
|
|
40
39
|
}
|
|
41
40
|
async search(params) {
|
|
@@ -44,6 +43,11 @@ var MemoryClient = class {
|
|
|
44
43
|
if (params.type) searchParams.set("type", params.type);
|
|
45
44
|
if (params.agentId) searchParams.set("agentId", params.agentId);
|
|
46
45
|
if (params.strategy) searchParams.set("strategy", params.strategy);
|
|
46
|
+
if (params.eventTimeRange) {
|
|
47
|
+
searchParams.set("eventTimeStart", params.eventTimeRange[0]);
|
|
48
|
+
searchParams.set("eventTimeEnd", params.eventTimeRange[1]);
|
|
49
|
+
}
|
|
50
|
+
if (params.asOf) searchParams.set("asOf", params.asOf);
|
|
47
51
|
return this.fetchApi(`/api/memory/search?${searchParams}`);
|
|
48
52
|
}
|
|
49
53
|
async get(id) {
|
|
@@ -93,7 +97,8 @@ var MemoryClient = class {
|
|
|
93
97
|
formData.append("file", file);
|
|
94
98
|
const res = await fetch(`${this.baseUrl}/api/memory/ingest/file`, {
|
|
95
99
|
method: "POST",
|
|
96
|
-
body: formData
|
|
100
|
+
body: formData,
|
|
101
|
+
headers: this._authHeaders
|
|
97
102
|
});
|
|
98
103
|
const body = await res.json();
|
|
99
104
|
if (!body.success || body.data === void 0) {
|
|
@@ -168,12 +173,35 @@ var MemoryClient = class {
|
|
|
168
173
|
);
|
|
169
174
|
return result.deleted;
|
|
170
175
|
}
|
|
176
|
+
async queryAsOf(asOfDate, filters = {}) {
|
|
177
|
+
const params = new URLSearchParams({ asOf: asOfDate });
|
|
178
|
+
if (filters.type) params.set("type", filters.type);
|
|
179
|
+
if (filters.agentId) params.set("agentId", filters.agentId);
|
|
180
|
+
if (filters.source) params.set("source", filters.source);
|
|
181
|
+
if (filters.limit) params.set("limit", String(filters.limit));
|
|
182
|
+
const result = await this.fetchApi(
|
|
183
|
+
`/api/memory/query-as-of?${params}`
|
|
184
|
+
);
|
|
185
|
+
return result.entries;
|
|
186
|
+
}
|
|
187
|
+
async queryByEventTime(startTime, endTime, filters = {}) {
|
|
188
|
+
const params = new URLSearchParams({ startTime, endTime });
|
|
189
|
+
if (filters.type) params.set("type", filters.type);
|
|
190
|
+
if (filters.agentId) params.set("agentId", filters.agentId);
|
|
191
|
+
if (filters.source) params.set("source", filters.source);
|
|
192
|
+
if (filters.limit) params.set("limit", String(filters.limit));
|
|
193
|
+
const result = await this.fetchApi(
|
|
194
|
+
`/api/memory/query-by-event-time?${params}`
|
|
195
|
+
);
|
|
196
|
+
return result.entries;
|
|
197
|
+
}
|
|
171
198
|
async fetchApi(path, options) {
|
|
172
199
|
const res = await fetch(`${this.baseUrl}${path}`, {
|
|
173
200
|
...options,
|
|
174
201
|
headers: {
|
|
175
202
|
"Content-Type": "application/json",
|
|
176
|
-
...options?.headers
|
|
203
|
+
...options?.headers,
|
|
204
|
+
...this._authHeaders
|
|
177
205
|
}
|
|
178
206
|
});
|
|
179
207
|
const body = await res.json();
|
package/dist/dashboard.mjs
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MemoryEntry as MemoryEntry$1, MemorySearchParams as MemorySearchParams$1, MemorySearchResult as MemorySearchResult$1, MemoryType as MemoryType$1, MemoryStats as MemoryStats$1, GraphNode as GraphNode$1, GraphTraversalResult as GraphTraversalResult$1 } from '@pyx-memory/shared';
|
|
1
|
+
import { StoreInput as StoreInput$1, MemoryEntry as MemoryEntry$1, MemorySearchParams as MemorySearchParams$1, MemorySearchResult as MemorySearchResult$1, MemoryType as MemoryType$1, MemoryStats as MemoryStats$1, GraphNode as GraphNode$1, GraphTraversalResult as GraphTraversalResult$1 } from '@pyx-memory/shared';
|
|
2
2
|
|
|
3
3
|
/** Parameters for paginated entry listing. */
|
|
4
4
|
interface MemoryListParams {
|
|
@@ -18,13 +18,17 @@ interface MemoryListResult {
|
|
|
18
18
|
page: number;
|
|
19
19
|
limit: number;
|
|
20
20
|
}
|
|
21
|
+
/** Filters for temporal queries (queryAsOf, queryByEventTime). */
|
|
22
|
+
interface TemporalQueryFilters {
|
|
23
|
+
type?: MemoryType$1;
|
|
24
|
+
agentId?: string;
|
|
25
|
+
source?: string;
|
|
26
|
+
limit?: number;
|
|
27
|
+
}
|
|
21
28
|
/** Abstract interface for memory systems (local or remote). */
|
|
22
29
|
interface MemoryInterface {
|
|
23
30
|
initialize(): Promise<void>;
|
|
24
|
-
store(entry:
|
|
25
|
-
id?: string;
|
|
26
|
-
createdAt?: string;
|
|
27
|
-
}): Promise<MemoryEntry$1>;
|
|
31
|
+
store(entry: StoreInput$1): Promise<MemoryEntry$1>;
|
|
28
32
|
search(params: MemorySearchParams$1): Promise<MemorySearchResult$1>;
|
|
29
33
|
/** List entries with SQL LIMIT/OFFSET pagination. */
|
|
30
34
|
list(params?: MemoryListParams): Promise<MemoryListResult>;
|
|
@@ -32,6 +36,10 @@ interface MemoryInterface {
|
|
|
32
36
|
delete(id: string): Promise<boolean>;
|
|
33
37
|
clearSession(sessionId: string): Promise<number>;
|
|
34
38
|
stats(): Promise<MemoryStats$1>;
|
|
39
|
+
/** Query entries as they existed at a point in time (by ingest time). */
|
|
40
|
+
queryAsOf(asOfDate: string, filters?: TemporalQueryFilters): Promise<MemoryEntry$1[]>;
|
|
41
|
+
/** Query entries by event time range (when things actually happened). */
|
|
42
|
+
queryByEventTime(startTime: string, endTime: string, filters?: TemporalQueryFilters): Promise<MemoryEntry$1[]>;
|
|
35
43
|
shutdown(): Promise<void>;
|
|
36
44
|
}
|
|
37
45
|
/** Consolidation run result. */
|
|
@@ -59,7 +67,9 @@ interface ExtendedMemoryInterface extends MemoryInterface {
|
|
|
59
67
|
|
|
60
68
|
interface IngestionResult {
|
|
61
69
|
filename: string;
|
|
70
|
+
fileType: string;
|
|
62
71
|
chunks: number;
|
|
72
|
+
entryIds: string[];
|
|
63
73
|
totalCharacters: number;
|
|
64
74
|
}
|
|
65
75
|
|
|
@@ -72,14 +82,12 @@ declare class MemoryServerError extends Error {
|
|
|
72
82
|
}
|
|
73
83
|
declare class MemoryClient implements ExtendedMemoryInterface {
|
|
74
84
|
protected baseUrl: string;
|
|
75
|
-
|
|
85
|
+
private readonly _authHeaders;
|
|
86
|
+
constructor(memoryUrl: string, apiKey?: string);
|
|
76
87
|
/** Encode a path segment to prevent URL injection */
|
|
77
88
|
private encodePathSegment;
|
|
78
89
|
initialize(): Promise<void>;
|
|
79
|
-
store(entry:
|
|
80
|
-
id?: string;
|
|
81
|
-
createdAt?: string;
|
|
82
|
-
}): Promise<MemoryEntry$1>;
|
|
90
|
+
store(entry: StoreInput$1): Promise<MemoryEntry$1>;
|
|
83
91
|
search(params: MemorySearchParams$1): Promise<MemorySearchResult$1>;
|
|
84
92
|
get(id: string): Promise<MemoryEntry$1 | null>;
|
|
85
93
|
delete(id: string): Promise<boolean>;
|
|
@@ -110,13 +118,14 @@ declare class MemoryClient implements ExtendedMemoryInterface {
|
|
|
110
118
|
runDecay(): Promise<number>;
|
|
111
119
|
reindex(): Promise<void>;
|
|
112
120
|
deleteBySource(source: string): Promise<number>;
|
|
121
|
+
queryAsOf(asOfDate: string, filters?: TemporalQueryFilters): Promise<MemoryEntry$1[]>;
|
|
122
|
+
queryByEventTime(startTime: string, endTime: string, filters?: TemporalQueryFilters): Promise<MemoryEntry$1[]>;
|
|
113
123
|
protected fetchApi<T>(path: string, options?: RequestInit): Promise<T>;
|
|
114
124
|
}
|
|
115
125
|
|
|
116
126
|
declare const DEFAULTS: {
|
|
117
127
|
readonly DATA_DIR: "./data";
|
|
118
128
|
readonly VECTOR_PROVIDER: "lancedb";
|
|
119
|
-
readonly EMBEDDING_PROVIDER: "stub";
|
|
120
129
|
readonly MEMORY_SERVER_PORT: 7822;
|
|
121
130
|
};
|
|
122
131
|
|
|
@@ -148,12 +157,13 @@ declare const RAGStrategy: {
|
|
|
148
157
|
type RAGStrategy = (typeof RAGStrategy)[keyof typeof RAGStrategy];
|
|
149
158
|
declare const VectorProvider: {
|
|
150
159
|
readonly LANCEDB: "lancedb";
|
|
151
|
-
readonly QDRANT: "qdrant";
|
|
152
160
|
};
|
|
153
161
|
type VectorProvider = (typeof VectorProvider)[keyof typeof VectorProvider];
|
|
154
162
|
declare const EmbeddingProviderName: {
|
|
155
163
|
readonly STUB: "stub";
|
|
164
|
+
/** @deprecated Vestigial — pyx-memory uses internal BGE-M3 embeddings. */
|
|
156
165
|
readonly ANTHROPIC: "anthropic";
|
|
166
|
+
/** @deprecated Vestigial — pyx-memory uses internal BGE-M3 embeddings. */
|
|
157
167
|
readonly OPENAI: "openai";
|
|
158
168
|
readonly LOCAL: "local";
|
|
159
169
|
};
|
|
@@ -165,6 +175,7 @@ interface MemoryEntry {
|
|
|
165
175
|
agentId?: AgentId;
|
|
166
176
|
sessionId?: string;
|
|
167
177
|
metadata: Record<string, unknown>;
|
|
178
|
+
/** @deprecated Vestigial — embeddings are managed internally by the vector store. */
|
|
168
179
|
embedding?: number[];
|
|
169
180
|
createdAt: Timestamp;
|
|
170
181
|
/** SHA-256 hash of content for deduplication. */
|
|
@@ -184,30 +195,16 @@ interface MemoryEntry {
|
|
|
184
195
|
/** When this entry was ingested into the system. */
|
|
185
196
|
ingestTime?: string;
|
|
186
197
|
}
|
|
187
|
-
interface SearchFilters {
|
|
188
|
-
/** Filter by source identifier. */
|
|
189
|
-
source?: string;
|
|
190
|
-
/** Minimum importance score. */
|
|
191
|
-
importanceMin?: number;
|
|
192
|
-
/** Event time range [start, end] as ISO timestamps. */
|
|
193
|
-
eventTimeRange?: [string, string];
|
|
194
|
-
/** Filter by parent entry ID. */
|
|
195
|
-
parentId?: string;
|
|
196
|
-
/** Filter by content type in metadata. */
|
|
197
|
-
contentType?: string;
|
|
198
|
-
}
|
|
199
198
|
interface MemorySearchParams {
|
|
200
199
|
query: string;
|
|
201
200
|
type?: MemoryType;
|
|
202
201
|
agentId?: AgentId;
|
|
203
202
|
limit?: number;
|
|
204
203
|
strategy?: RAGStrategy;
|
|
205
|
-
/**
|
|
206
|
-
|
|
207
|
-
/**
|
|
208
|
-
|
|
209
|
-
/** Enable reranking of results. */
|
|
210
|
-
enableRerank?: boolean;
|
|
204
|
+
/** Filter results to entries whose eventTime falls within [start, end] (ISO 8601). */
|
|
205
|
+
eventTimeRange?: [string, string];
|
|
206
|
+
/** Filter results to entries ingested before this cutoff (ISO 8601). Falls back to createdAt when ingestTime is null. */
|
|
207
|
+
asOf?: string;
|
|
211
208
|
}
|
|
212
209
|
interface MemorySearchResult {
|
|
213
210
|
entries: MemoryEntry[];
|
|
@@ -219,11 +216,67 @@ interface MemorySearchResult {
|
|
|
219
216
|
score: number;
|
|
220
217
|
}>;
|
|
221
218
|
}
|
|
219
|
+
declare const StoreTarget: {
|
|
220
|
+
readonly SQLITE: "sqlite";
|
|
221
|
+
readonly VECTOR: "vector";
|
|
222
|
+
readonly GRAPH: "graph";
|
|
223
|
+
};
|
|
224
|
+
type StoreTarget = (typeof StoreTarget)[keyof typeof StoreTarget];
|
|
225
|
+
/** Agent-provided entity for graph storage. */
|
|
226
|
+
interface IngestEntity {
|
|
227
|
+
/** Entity name (e.g., "Alice", "TypeScript"). */
|
|
228
|
+
name: string;
|
|
229
|
+
/** Entity type — freeform, agent decides (e.g., "PERSON", "TOOL"). */
|
|
230
|
+
type: string;
|
|
231
|
+
/** Optional properties to attach to the graph node. */
|
|
232
|
+
properties?: Record<string, unknown>;
|
|
233
|
+
}
|
|
234
|
+
/** Agent-provided relationship for graph storage. */
|
|
235
|
+
interface IngestRelationship {
|
|
236
|
+
/** Source entity name (must match an entity in the entities array). */
|
|
237
|
+
source: string;
|
|
238
|
+
/** Target entity name (must match an entity in the entities array). */
|
|
239
|
+
target: string;
|
|
240
|
+
/** Relationship type — freeform, agent decides (e.g., "WORKS_AT", "USES"). */
|
|
241
|
+
type: string;
|
|
242
|
+
/** Optional properties to attach to the graph edge. */
|
|
243
|
+
properties?: Record<string, unknown>;
|
|
244
|
+
}
|
|
245
|
+
/** Store input: what the agent sends to Memory.store(). */
|
|
246
|
+
type StoreInput = Omit<MemoryEntry, 'id' | 'createdAt'> & {
|
|
247
|
+
id?: string;
|
|
248
|
+
createdAt?: string;
|
|
249
|
+
/** Storage targets. Default: ["sqlite", "vector"]. */
|
|
250
|
+
targets?: StoreTarget[];
|
|
251
|
+
/** Agent-provided entities for graph storage. Required when targets includes "graph". */
|
|
252
|
+
entities?: IngestEntity[];
|
|
253
|
+
/** Agent-provided relationships for graph storage. */
|
|
254
|
+
relationships?: IngestRelationship[];
|
|
255
|
+
};
|
|
222
256
|
interface MemoryIngestRequest {
|
|
223
257
|
content?: string;
|
|
224
258
|
type?: MemoryType;
|
|
225
|
-
fileType?: 'pdf' | 'csv' | 'txt';
|
|
226
259
|
metadata?: Record<string, unknown>;
|
|
260
|
+
agentId?: string;
|
|
261
|
+
sessionId?: string;
|
|
262
|
+
/** Storage targets. Default: ["sqlite", "vector"]. */
|
|
263
|
+
targets?: StoreTarget[];
|
|
264
|
+
/** Agent-provided entities for graph storage. Required when targets includes "graph". */
|
|
265
|
+
entities?: IngestEntity[];
|
|
266
|
+
/** Agent-provided relationships for graph storage. */
|
|
267
|
+
relationships?: IngestRelationship[];
|
|
268
|
+
/** Importance score (1-10). */
|
|
269
|
+
importance?: number;
|
|
270
|
+
/** Source identifier (e.g., filename, URL). */
|
|
271
|
+
source?: string;
|
|
272
|
+
/** When the event occurred (ISO timestamp). */
|
|
273
|
+
eventTime?: string;
|
|
274
|
+
/** Optional deterministic ID for the entry (agent-provided). */
|
|
275
|
+
id?: string;
|
|
276
|
+
/** Parent entry ID for hierarchical storage (e.g., doc → section → chunk). */
|
|
277
|
+
parentId?: string;
|
|
278
|
+
/** When this entry was ingested (ISO timestamp). Default: now. */
|
|
279
|
+
ingestTime?: string;
|
|
227
280
|
}
|
|
228
281
|
interface MemoryStats {
|
|
229
282
|
totalEntries: number;
|
|
@@ -235,14 +288,6 @@ interface MemoryStats {
|
|
|
235
288
|
/** Whether the memory service is connected. False when using DisabledMemory. */
|
|
236
289
|
connected?: boolean;
|
|
237
290
|
}
|
|
238
|
-
interface GraphEdge {
|
|
239
|
-
id: string;
|
|
240
|
-
sourceEntity: string;
|
|
241
|
-
targetEntity: string;
|
|
242
|
-
relation: string;
|
|
243
|
-
weight: number;
|
|
244
|
-
memoryEntryId: string;
|
|
245
|
-
}
|
|
246
291
|
interface GraphNode {
|
|
247
292
|
id: string;
|
|
248
293
|
name: string;
|
|
@@ -267,4 +312,4 @@ interface GraphTraversalResult {
|
|
|
267
312
|
}>;
|
|
268
313
|
}
|
|
269
314
|
|
|
270
|
-
export { type AgentId, type ApiResponse, type ConsolidationRunResult, DEFAULTS, EmbeddingProviderName, type ExtendedMemoryInterface, type
|
|
315
|
+
export { type AgentId, type ApiResponse, type ConsolidationRunResult, DEFAULTS, EmbeddingProviderName, type ExtendedMemoryInterface, type GraphNode, type GraphRelationship, type GraphTraversalResult, type IngestEntity, type IngestRelationship, type IngestionResult, MemoryClient, type MemoryEntry, type MemoryIngestRequest, type MemoryInterface, type MemoryListParams, type MemoryListResult, type MemorySearchParams, type MemorySearchResult, MemoryServerError, type MemoryStats, MemoryType, RAGStrategy, type StoreInput, StoreTarget, type TemporalQueryFilters, type Timestamp, VectorProvider };
|
package/dist/index.mjs
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MemoryClient,
|
|
3
3
|
MemoryServerError
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-JMXAZPDT.mjs";
|
|
5
5
|
|
|
6
6
|
// ../shared/src/constants/defaults.ts
|
|
7
7
|
var DEFAULTS = {
|
|
8
8
|
DATA_DIR: "./data",
|
|
9
9
|
VECTOR_PROVIDER: "lancedb",
|
|
10
|
-
EMBEDDING_PROVIDER: "stub",
|
|
11
10
|
MEMORY_SERVER_PORT: 7822
|
|
12
11
|
};
|
|
13
12
|
|
|
@@ -26,15 +25,21 @@ var RAGStrategy = {
|
|
|
26
25
|
HYBRID: "hybrid"
|
|
27
26
|
};
|
|
28
27
|
var VectorProvider = {
|
|
29
|
-
LANCEDB: "lancedb"
|
|
30
|
-
QDRANT: "qdrant"
|
|
28
|
+
LANCEDB: "lancedb"
|
|
31
29
|
};
|
|
32
30
|
var EmbeddingProviderName = {
|
|
33
31
|
STUB: "stub",
|
|
32
|
+
/** @deprecated Vestigial — pyx-memory uses internal BGE-M3 embeddings. */
|
|
34
33
|
ANTHROPIC: "anthropic",
|
|
34
|
+
/** @deprecated Vestigial — pyx-memory uses internal BGE-M3 embeddings. */
|
|
35
35
|
OPENAI: "openai",
|
|
36
36
|
LOCAL: "local"
|
|
37
37
|
};
|
|
38
|
+
var StoreTarget = {
|
|
39
|
+
SQLITE: "sqlite",
|
|
40
|
+
VECTOR: "vector",
|
|
41
|
+
GRAPH: "graph"
|
|
42
|
+
};
|
|
38
43
|
export {
|
|
39
44
|
DEFAULTS,
|
|
40
45
|
EmbeddingProviderName,
|
|
@@ -42,5 +47,6 @@ export {
|
|
|
42
47
|
MemoryServerError,
|
|
43
48
|
MemoryType,
|
|
44
49
|
RAGStrategy,
|
|
50
|
+
StoreTarget,
|
|
45
51
|
VectorProvider
|
|
46
52
|
};
|
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-XNKO7F3P.mjs";
|
|
15
|
+
import "./chunk-JMXAZPDT.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.
|
|
3
|
+
"version": "0.1.1-beta",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "SDK for pyx-memory — Memory as a Service for AI agents",
|
|
6
6
|
"license": "MIT",
|
|
@@ -33,15 +33,21 @@
|
|
|
33
33
|
"types": "./dist/react.d.ts"
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
|
+
"bin": {
|
|
37
|
+
"pyxmate-memory": "./bin/init.mjs"
|
|
38
|
+
},
|
|
36
39
|
"files": [
|
|
37
40
|
"dist",
|
|
41
|
+
"bin",
|
|
42
|
+
"skills",
|
|
38
43
|
"README.md",
|
|
39
44
|
"LICENSE"
|
|
40
45
|
],
|
|
41
46
|
"scripts": {
|
|
42
|
-
"
|
|
47
|
+
"copy-skills": "rm -rf skills/pyx-memory-integration && mkdir -p skills && cp -r ../../.claude/skills/pyx-memory-integration skills/pyx-memory-integration && rm -rf skills/pyx-memory-integration/scripts",
|
|
48
|
+
"build": "bun run copy-skills && tsup",
|
|
43
49
|
"typecheck": "tsc --noEmit",
|
|
44
|
-
"clean": "rm -rf dist node_modules .turbo"
|
|
50
|
+
"clean": "rm -rf dist skills node_modules .turbo"
|
|
45
51
|
},
|
|
46
52
|
"peerDependencies": {
|
|
47
53
|
"react": ">=18.0.0"
|