@lanonasis/mem-intel-sdk 1.0.1 → 2.0.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/CHANGELOG.md +230 -15
- package/README.md +258 -4
- package/dist/core/client.d.ts +79 -7
- package/dist/core/client.d.ts.map +1 -1
- package/dist/core/index.cjs +360 -13
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +359 -14
- package/dist/core/index.js.map +1 -1
- package/dist/core/prediction-types.d.ts +270 -0
- package/dist/core/prediction-types.d.ts.map +1 -0
- package/dist/core/types.d.ts +94 -38
- package/dist/core/types.d.ts.map +1 -1
- package/dist/index-sdk.d.ts +2 -0
- package/dist/index-sdk.d.ts.map +1 -1
- package/dist/index.cjs +320 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +320 -13
- package/dist/index.js.map +1 -1
- package/dist/node/index.cjs +320 -13
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.js +320 -13
- package/dist/node/index.js.map +1 -1
- package/dist/react/hooks/useMemoryIntelligence.d.ts +94 -10
- package/dist/react/hooks/useMemoryIntelligence.d.ts.map +1 -1
- package/dist/react/index.cjs +320 -13
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.js +320 -13
- package/dist/react/index.js.map +1 -1
- package/dist/server/index.cjs +571 -47
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.js +571 -47
- package/dist/server/index.js.map +1 -1
- package/dist/server/mcp-server.d.ts.map +1 -1
- package/dist/utils/http-client.d.ts +35 -0
- package/dist/utils/http-client.d.ts.map +1 -1
- package/dist/utils/index.d.ts +3 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/prediction-engine.d.ts +90 -0
- package/dist/utils/prediction-engine.d.ts.map +1 -0
- package/dist/utils/response-adapter.d.ts +66 -0
- package/dist/utils/response-adapter.d.ts.map +1 -0
- package/dist/vue/composables/useMemoryIntelligence.d.ts +59 -0
- package/dist/vue/composables/useMemoryIntelligence.d.ts.map +1 -1
- package/dist/vue/index.cjs.map +1 -1
- package/dist/vue/index.js.map +1 -1
- package/package.json +11 -5
package/dist/react/index.js
CHANGED
|
@@ -45,12 +45,120 @@ var ValidationError = class extends MemoryIntelligenceError {
|
|
|
45
45
|
}
|
|
46
46
|
};
|
|
47
47
|
|
|
48
|
+
// src/utils/response-adapter.ts
|
|
49
|
+
function adaptEdgeFunctionResponse(httpResponse) {
|
|
50
|
+
if (httpResponse.error) {
|
|
51
|
+
return {
|
|
52
|
+
status: httpResponse.status,
|
|
53
|
+
error: httpResponse.error
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
const envelope = httpResponse.data;
|
|
57
|
+
if (!envelope) {
|
|
58
|
+
return {
|
|
59
|
+
status: httpResponse.status,
|
|
60
|
+
error: {
|
|
61
|
+
message: "Empty response from server",
|
|
62
|
+
code: "EMPTY_RESPONSE"
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
if (!envelope.success && envelope.error) {
|
|
67
|
+
return {
|
|
68
|
+
status: httpResponse.status,
|
|
69
|
+
error: envelope.error,
|
|
70
|
+
usage: envelope.usage,
|
|
71
|
+
tier_info: envelope.tier_info
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
return {
|
|
75
|
+
status: httpResponse.status,
|
|
76
|
+
data: envelope.data,
|
|
77
|
+
usage: envelope.usage,
|
|
78
|
+
tier_info: envelope.tier_info
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
function isEdgeFunctionEnvelope(data) {
|
|
82
|
+
if (typeof data !== "object" || data === null) {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
const obj = data;
|
|
86
|
+
return "success" in obj && typeof obj.success === "boolean";
|
|
87
|
+
}
|
|
88
|
+
function adaptResponse(httpResponse) {
|
|
89
|
+
if (httpResponse.error) {
|
|
90
|
+
return {
|
|
91
|
+
status: httpResponse.status,
|
|
92
|
+
error: httpResponse.error
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
const responseData = httpResponse.data;
|
|
96
|
+
if (isEdgeFunctionEnvelope(responseData)) {
|
|
97
|
+
return adaptEdgeFunctionResponse({
|
|
98
|
+
status: httpResponse.status,
|
|
99
|
+
data: responseData
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
return {
|
|
103
|
+
status: httpResponse.status,
|
|
104
|
+
data: responseData
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
var ResponseCache = class {
|
|
108
|
+
cache = /* @__PURE__ */ new Map();
|
|
109
|
+
ttl;
|
|
110
|
+
constructor(ttlMs = 3e5) {
|
|
111
|
+
this.ttl = ttlMs;
|
|
112
|
+
}
|
|
113
|
+
generateKey(endpoint, params) {
|
|
114
|
+
const paramStr = params ? JSON.stringify(params) : "";
|
|
115
|
+
return `${endpoint}:${paramStr}`;
|
|
116
|
+
}
|
|
117
|
+
set(endpoint, data, params) {
|
|
118
|
+
const key = this.generateKey(endpoint, params);
|
|
119
|
+
this.cache.set(key, {
|
|
120
|
+
data,
|
|
121
|
+
timestamp: Date.now(),
|
|
122
|
+
endpoint,
|
|
123
|
+
params
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
get(endpoint, params) {
|
|
127
|
+
const key = this.generateKey(endpoint, params);
|
|
128
|
+
const entry = this.cache.get(key);
|
|
129
|
+
if (!entry) {
|
|
130
|
+
return null;
|
|
131
|
+
}
|
|
132
|
+
if (Date.now() - entry.timestamp > this.ttl) {
|
|
133
|
+
this.cache.delete(key);
|
|
134
|
+
return null;
|
|
135
|
+
}
|
|
136
|
+
return entry.data;
|
|
137
|
+
}
|
|
138
|
+
clear() {
|
|
139
|
+
this.cache.clear();
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Clean up expired entries
|
|
143
|
+
*/
|
|
144
|
+
cleanup() {
|
|
145
|
+
const now = Date.now();
|
|
146
|
+
for (const [key, entry] of this.cache.entries()) {
|
|
147
|
+
if (now - entry.timestamp > this.ttl) {
|
|
148
|
+
this.cache.delete(key);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
|
|
48
154
|
// src/utils/http-client.ts
|
|
49
155
|
var HttpClient = class {
|
|
50
156
|
apiUrl;
|
|
51
157
|
apiKey;
|
|
52
158
|
timeout;
|
|
53
159
|
headers;
|
|
160
|
+
processingMode;
|
|
161
|
+
cache;
|
|
54
162
|
constructor(config) {
|
|
55
163
|
if (!config.apiKey) {
|
|
56
164
|
throw new ConfigurationError("API key is required");
|
|
@@ -63,11 +171,35 @@ var HttpClient = class {
|
|
|
63
171
|
this.apiUrl = config.apiUrl.replace(/\/$/, "");
|
|
64
172
|
this.apiKey = config.apiKey;
|
|
65
173
|
this.timeout = config.timeout || 3e4;
|
|
174
|
+
this.processingMode = config.processingMode || "api";
|
|
66
175
|
this.headers = {
|
|
67
176
|
"Content-Type": "application/json",
|
|
68
177
|
"X-API-Key": this.apiKey,
|
|
69
178
|
...config.headers
|
|
70
179
|
};
|
|
180
|
+
if (config.enableCache !== false && this.processingMode === "offline-fallback") {
|
|
181
|
+
this.cache = new ResponseCache(config.cacheTTL || 3e5);
|
|
182
|
+
} else {
|
|
183
|
+
this.cache = null;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Get the current processing mode
|
|
188
|
+
*/
|
|
189
|
+
getProcessingMode() {
|
|
190
|
+
return this.processingMode;
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Check if cache is enabled
|
|
194
|
+
*/
|
|
195
|
+
isCacheEnabled() {
|
|
196
|
+
return this.cache !== null;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Clear the response cache
|
|
200
|
+
*/
|
|
201
|
+
clearCache() {
|
|
202
|
+
this.cache?.clear();
|
|
71
203
|
}
|
|
72
204
|
async request(method, endpoint, data) {
|
|
73
205
|
const url = `${this.apiUrl}${endpoint}`;
|
|
@@ -127,6 +259,43 @@ var HttpClient = class {
|
|
|
127
259
|
};
|
|
128
260
|
}
|
|
129
261
|
}
|
|
262
|
+
/**
|
|
263
|
+
* Enhanced request that handles Edge Function envelope format
|
|
264
|
+
* and supports offline-fallback caching
|
|
265
|
+
*/
|
|
266
|
+
async enhancedRequest(method, endpoint, data) {
|
|
267
|
+
const cacheKey = data ? JSON.stringify(data) : void 0;
|
|
268
|
+
const rawResponse = await this.request(method, endpoint, data);
|
|
269
|
+
if (rawResponse.error?.code === "NETWORK_ERROR" || rawResponse.error?.code === "TIMEOUT") {
|
|
270
|
+
if (this.processingMode === "offline-fallback" && this.cache) {
|
|
271
|
+
const cached = this.cache.get(endpoint, cacheKey ? JSON.parse(cacheKey) : void 0);
|
|
272
|
+
if (cached) {
|
|
273
|
+
return {
|
|
274
|
+
status: 200,
|
|
275
|
+
data: cached,
|
|
276
|
+
fromCache: true
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
return {
|
|
281
|
+
status: rawResponse.status,
|
|
282
|
+
error: rawResponse.error,
|
|
283
|
+
fromCache: false
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
const adapted = adaptResponse(rawResponse);
|
|
287
|
+
if (!adapted.error && adapted.data && this.cache) {
|
|
288
|
+
this.cache.set(endpoint, adapted.data, cacheKey ? JSON.parse(cacheKey) : void 0);
|
|
289
|
+
}
|
|
290
|
+
return {
|
|
291
|
+
status: adapted.status,
|
|
292
|
+
data: adapted.data,
|
|
293
|
+
error: adapted.error,
|
|
294
|
+
usage: adapted.usage,
|
|
295
|
+
tier_info: adapted.tier_info,
|
|
296
|
+
fromCache: false
|
|
297
|
+
};
|
|
298
|
+
}
|
|
130
299
|
async get(endpoint) {
|
|
131
300
|
return this.request("GET", endpoint);
|
|
132
301
|
}
|
|
@@ -142,6 +311,22 @@ var HttpClient = class {
|
|
|
142
311
|
async delete(endpoint) {
|
|
143
312
|
return this.request("DELETE", endpoint);
|
|
144
313
|
}
|
|
314
|
+
// Enhanced methods with Edge Function envelope support
|
|
315
|
+
async getEnhanced(endpoint) {
|
|
316
|
+
return this.enhancedRequest("GET", endpoint);
|
|
317
|
+
}
|
|
318
|
+
async postEnhanced(endpoint, data) {
|
|
319
|
+
return this.enhancedRequest("POST", endpoint, data);
|
|
320
|
+
}
|
|
321
|
+
async putEnhanced(endpoint, data) {
|
|
322
|
+
return this.enhancedRequest("PUT", endpoint, data);
|
|
323
|
+
}
|
|
324
|
+
async patchEnhanced(endpoint, data) {
|
|
325
|
+
return this.enhancedRequest("PATCH", endpoint, data);
|
|
326
|
+
}
|
|
327
|
+
async deleteEnhanced(endpoint) {
|
|
328
|
+
return this.enhancedRequest("DELETE", endpoint);
|
|
329
|
+
}
|
|
145
330
|
};
|
|
146
331
|
|
|
147
332
|
// src/core/client.ts
|
|
@@ -149,20 +334,43 @@ var DEFAULT_API_URL = "https://api.lanonasis.com/api/v1";
|
|
|
149
334
|
var MemoryIntelligenceClient = class {
|
|
150
335
|
httpClient;
|
|
151
336
|
defaultResponseFormat;
|
|
337
|
+
processingMode;
|
|
152
338
|
constructor(config) {
|
|
153
339
|
if (!config.apiKey) {
|
|
154
340
|
throw new ConfigurationError(
|
|
155
341
|
"Missing required configuration: apiKey is required (format: lano_xxxxxxxxxx)"
|
|
156
342
|
);
|
|
157
343
|
}
|
|
344
|
+
this.processingMode = config.processingMode || "api";
|
|
158
345
|
this.httpClient = new HttpClient({
|
|
159
346
|
apiUrl: config.apiUrl || DEFAULT_API_URL,
|
|
160
347
|
apiKey: config.apiKey,
|
|
161
348
|
timeout: config.timeout,
|
|
162
|
-
headers: config.headers
|
|
349
|
+
headers: config.headers,
|
|
350
|
+
processingMode: this.processingMode,
|
|
351
|
+
enableCache: config.enableCache,
|
|
352
|
+
cacheTTL: config.cacheTTL
|
|
163
353
|
});
|
|
164
354
|
this.defaultResponseFormat = config.responseFormat || "markdown";
|
|
165
355
|
}
|
|
356
|
+
/**
|
|
357
|
+
* Get the current processing mode
|
|
358
|
+
*/
|
|
359
|
+
getProcessingMode() {
|
|
360
|
+
return this.processingMode;
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* Check if cache is enabled (for offline-fallback mode)
|
|
364
|
+
*/
|
|
365
|
+
isCacheEnabled() {
|
|
366
|
+
return this.httpClient.isCacheEnabled();
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* Clear the response cache
|
|
370
|
+
*/
|
|
371
|
+
clearCache() {
|
|
372
|
+
this.httpClient.clearCache();
|
|
373
|
+
}
|
|
166
374
|
/**
|
|
167
375
|
* Get HTTP client for direct API access
|
|
168
376
|
*/
|
|
@@ -194,7 +402,7 @@ var MemoryIntelligenceClient = class {
|
|
|
194
402
|
* Analyze usage patterns and trends in memory collection
|
|
195
403
|
*/
|
|
196
404
|
async analyzePatterns(params) {
|
|
197
|
-
const response = await this.httpClient.
|
|
405
|
+
const response = await this.httpClient.postEnhanced(
|
|
198
406
|
"/intelligence/analyze-patterns",
|
|
199
407
|
{
|
|
200
408
|
...params,
|
|
@@ -204,13 +412,18 @@ var MemoryIntelligenceClient = class {
|
|
|
204
412
|
if (response.error) {
|
|
205
413
|
throw new DatabaseError(`Failed to analyze patterns: ${response.error.message}`);
|
|
206
414
|
}
|
|
207
|
-
return
|
|
415
|
+
return {
|
|
416
|
+
data: response.data,
|
|
417
|
+
usage: response.usage,
|
|
418
|
+
tier_info: response.tier_info,
|
|
419
|
+
fromCache: response.fromCache
|
|
420
|
+
};
|
|
208
421
|
}
|
|
209
422
|
/**
|
|
210
423
|
* Get AI-powered tag suggestions for a memory
|
|
211
424
|
*/
|
|
212
425
|
async suggestTags(params) {
|
|
213
|
-
const response = await this.httpClient.
|
|
426
|
+
const response = await this.httpClient.postEnhanced(
|
|
214
427
|
"/intelligence/suggest-tags",
|
|
215
428
|
{
|
|
216
429
|
...params,
|
|
@@ -220,13 +433,18 @@ var MemoryIntelligenceClient = class {
|
|
|
220
433
|
if (response.error) {
|
|
221
434
|
throw new DatabaseError(`Failed to suggest tags: ${response.error.message}`);
|
|
222
435
|
}
|
|
223
|
-
return
|
|
436
|
+
return {
|
|
437
|
+
data: response.data,
|
|
438
|
+
usage: response.usage,
|
|
439
|
+
tier_info: response.tier_info,
|
|
440
|
+
fromCache: response.fromCache
|
|
441
|
+
};
|
|
224
442
|
}
|
|
225
443
|
/**
|
|
226
444
|
* Find semantically related memories using vector similarity
|
|
227
445
|
*/
|
|
228
446
|
async findRelated(params) {
|
|
229
|
-
const response = await this.httpClient.
|
|
447
|
+
const response = await this.httpClient.postEnhanced(
|
|
230
448
|
"/intelligence/find-related",
|
|
231
449
|
{
|
|
232
450
|
...params,
|
|
@@ -236,13 +454,18 @@ var MemoryIntelligenceClient = class {
|
|
|
236
454
|
if (response.error) {
|
|
237
455
|
throw new DatabaseError(`Failed to find related memories: ${response.error.message}`);
|
|
238
456
|
}
|
|
239
|
-
return
|
|
457
|
+
return {
|
|
458
|
+
data: response.data,
|
|
459
|
+
usage: response.usage,
|
|
460
|
+
tier_info: response.tier_info,
|
|
461
|
+
fromCache: response.fromCache
|
|
462
|
+
};
|
|
240
463
|
}
|
|
241
464
|
/**
|
|
242
465
|
* Detect potential duplicate memories
|
|
243
466
|
*/
|
|
244
467
|
async detectDuplicates(params) {
|
|
245
|
-
const response = await this.httpClient.
|
|
468
|
+
const response = await this.httpClient.postEnhanced(
|
|
246
469
|
"/intelligence/detect-duplicates",
|
|
247
470
|
{
|
|
248
471
|
...params,
|
|
@@ -252,13 +475,18 @@ var MemoryIntelligenceClient = class {
|
|
|
252
475
|
if (response.error) {
|
|
253
476
|
throw new DatabaseError(`Failed to detect duplicates: ${response.error.message}`);
|
|
254
477
|
}
|
|
255
|
-
return
|
|
478
|
+
return {
|
|
479
|
+
data: response.data,
|
|
480
|
+
usage: response.usage,
|
|
481
|
+
tier_info: response.tier_info,
|
|
482
|
+
fromCache: response.fromCache
|
|
483
|
+
};
|
|
256
484
|
}
|
|
257
485
|
/**
|
|
258
486
|
* Extract insights and patterns from memories
|
|
259
487
|
*/
|
|
260
488
|
async extractInsights(params) {
|
|
261
|
-
const response = await this.httpClient.
|
|
489
|
+
const response = await this.httpClient.postEnhanced(
|
|
262
490
|
"/intelligence/extract-insights",
|
|
263
491
|
{
|
|
264
492
|
...params,
|
|
@@ -268,13 +496,18 @@ var MemoryIntelligenceClient = class {
|
|
|
268
496
|
if (response.error) {
|
|
269
497
|
throw new DatabaseError(`Failed to extract insights: ${response.error.message}`);
|
|
270
498
|
}
|
|
271
|
-
return
|
|
499
|
+
return {
|
|
500
|
+
data: response.data,
|
|
501
|
+
usage: response.usage,
|
|
502
|
+
tier_info: response.tier_info,
|
|
503
|
+
fromCache: response.fromCache
|
|
504
|
+
};
|
|
272
505
|
}
|
|
273
506
|
/**
|
|
274
507
|
* Check the health and organization quality of memories
|
|
275
508
|
*/
|
|
276
509
|
async healthCheck(params) {
|
|
277
|
-
const response = await this.httpClient.
|
|
510
|
+
const response = await this.httpClient.postEnhanced(
|
|
278
511
|
"/intelligence/health-check",
|
|
279
512
|
{
|
|
280
513
|
...params,
|
|
@@ -284,7 +517,81 @@ var MemoryIntelligenceClient = class {
|
|
|
284
517
|
if (response.error) {
|
|
285
518
|
throw new DatabaseError(`Failed to check health: ${response.error.message}`);
|
|
286
519
|
}
|
|
287
|
-
return
|
|
520
|
+
return {
|
|
521
|
+
data: response.data,
|
|
522
|
+
usage: response.usage,
|
|
523
|
+
tier_info: response.tier_info,
|
|
524
|
+
fromCache: response.fromCache
|
|
525
|
+
};
|
|
526
|
+
}
|
|
527
|
+
/**
|
|
528
|
+
* Predictive Memory Recall - AI that anticipates what you need
|
|
529
|
+
*
|
|
530
|
+
* Uses a weighted scoring algorithm:
|
|
531
|
+
* - Semantic similarity to current context (40%)
|
|
532
|
+
* - Temporal relevance (recency decay curve) (30%)
|
|
533
|
+
* - Usage frequency (20%)
|
|
534
|
+
* - Serendipity factor (adjacent discoveries) (10%)
|
|
535
|
+
*
|
|
536
|
+
* @example
|
|
537
|
+
* ```typescript
|
|
538
|
+
* const result = await client.predictiveRecall({
|
|
539
|
+
* userId: "user-123",
|
|
540
|
+
* context: {
|
|
541
|
+
* currentProject: "Building dashboard components",
|
|
542
|
+
* recentTopics: ["React", "performance", "hooks"],
|
|
543
|
+
* contextText: "Optimizing render performance for data tables"
|
|
544
|
+
* },
|
|
545
|
+
* limit: 5,
|
|
546
|
+
* minConfidence: 50
|
|
547
|
+
* });
|
|
548
|
+
*
|
|
549
|
+
* for (const prediction of result.data.predictions) {
|
|
550
|
+
* console.log(`[${prediction.confidence}%] ${prediction.title}`);
|
|
551
|
+
* console.log(` Reason: ${prediction.reason}`);
|
|
552
|
+
* console.log(` Action: ${prediction.suggestedAction}`);
|
|
553
|
+
* }
|
|
554
|
+
* ```
|
|
555
|
+
*/
|
|
556
|
+
async predictiveRecall(params) {
|
|
557
|
+
const response = await this.httpClient.postEnhanced(
|
|
558
|
+
"/intelligence/predictive-recall",
|
|
559
|
+
{
|
|
560
|
+
userId: params.userId,
|
|
561
|
+
context: params.context,
|
|
562
|
+
limit: params.limit || 5,
|
|
563
|
+
minConfidence: params.minConfidence || 40,
|
|
564
|
+
includeSerendipity: params.includeSerendipity !== false,
|
|
565
|
+
memoryTypes: params.memoryTypes,
|
|
566
|
+
timeWindowDays: params.timeWindowDays || 90,
|
|
567
|
+
responseFormat: params.responseFormat || this.defaultResponseFormat
|
|
568
|
+
}
|
|
569
|
+
);
|
|
570
|
+
if (response.error) {
|
|
571
|
+
throw new DatabaseError(`Failed to get predictions: ${response.error.message}`);
|
|
572
|
+
}
|
|
573
|
+
return {
|
|
574
|
+
data: response.data,
|
|
575
|
+
usage: response.usage,
|
|
576
|
+
tier_info: response.tier_info,
|
|
577
|
+
fromCache: response.fromCache
|
|
578
|
+
};
|
|
579
|
+
}
|
|
580
|
+
/**
|
|
581
|
+
* Record feedback on a prediction (for improving accuracy over time)
|
|
582
|
+
*
|
|
583
|
+
* @example
|
|
584
|
+
* ```typescript
|
|
585
|
+
* await client.recordPredictionFeedback({
|
|
586
|
+
* memoryId: "mem-123",
|
|
587
|
+
* userId: "user-123",
|
|
588
|
+
* useful: true,
|
|
589
|
+
* action: "clicked"
|
|
590
|
+
* });
|
|
591
|
+
* ```
|
|
592
|
+
*/
|
|
593
|
+
async recordPredictionFeedback(params) {
|
|
594
|
+
await this.httpClient.post("/intelligence/prediction-feedback", params);
|
|
288
595
|
}
|
|
289
596
|
};
|
|
290
597
|
var MemoryIntelligenceContext = createContext(null);
|