cencori 1.8.0 → 1.8.2
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/ai/index.d.mts +1 -1
- package/dist/ai/index.d.ts +1 -1
- package/dist/ai/index.js +160 -21
- package/dist/ai/index.js.map +1 -1
- package/dist/ai/index.mjs +158 -21
- package/dist/ai/index.mjs.map +1 -1
- package/dist/compute/index.d.mts +1 -1
- package/dist/compute/index.d.ts +1 -1
- package/dist/documents/index.d.mts +1 -1
- package/dist/documents/index.d.ts +1 -1
- package/dist/index.d.mts +65 -11
- package/dist/index.d.ts +65 -11
- package/dist/index.js +258 -96
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +258 -96
- package/dist/index.mjs.map +1 -1
- package/dist/memory/index.d.mts +151 -26
- package/dist/memory/index.d.ts +151 -26
- package/dist/memory/index.js +210 -6
- package/dist/memory/index.js.map +1 -1
- package/dist/memory/index.mjs +208 -6
- package/dist/memory/index.mjs.map +1 -1
- package/dist/storage/index.d.mts +1 -1
- package/dist/storage/index.d.ts +1 -1
- package/dist/telemetry/index.d.mts +1 -1
- package/dist/telemetry/index.d.ts +1 -1
- package/dist/{types-CZSIg4JQ.d.mts → types-CAhDuNTz.d.mts} +34 -1
- package/dist/{types-CZSIg4JQ.d.ts → types-CAhDuNTz.d.ts} +34 -1
- package/dist/vision/index.d.mts +1 -1
- package/dist/vision/index.d.ts +1 -1
- package/dist/voice/index.d.mts +1 -1
- package/dist/voice/index.d.ts +1 -1
- package/dist/web/index.d.mts +1 -1
- package/dist/web/index.d.ts +1 -1
- package/dist/workflow/index.d.mts +1 -1
- package/dist/workflow/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/memory/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as CencoriConfig } from '../types-
|
|
1
|
+
import { C as CencoriConfig } from '../types-CAhDuNTz.mjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Cencori Memory SDK
|
|
@@ -54,10 +54,20 @@ interface SearchResult {
|
|
|
54
54
|
count: number;
|
|
55
55
|
latencyMs: number;
|
|
56
56
|
}
|
|
57
|
-
type MemoryScope = 'session' | 'user';
|
|
58
|
-
|
|
57
|
+
type MemoryScope = 'session' | 'user' | 'workspace' | 'org';
|
|
58
|
+
/** Scope-key inputs shared by every scoped-memory option shape. */
|
|
59
|
+
interface MemoryScopeKeys {
|
|
59
60
|
userId?: string;
|
|
60
61
|
sessionId?: string;
|
|
62
|
+
/** Workspace key for scope='workspace' (a caller-owned team/space id). */
|
|
63
|
+
workspaceId?: string;
|
|
64
|
+
/**
|
|
65
|
+
* Org key for scope='org'. Optional — the server defaults it to the
|
|
66
|
+
* authenticated organization, the only key org scope can address.
|
|
67
|
+
*/
|
|
68
|
+
orgId?: string;
|
|
69
|
+
}
|
|
70
|
+
interface WriteScopedMemoryOptions extends MemoryScopeKeys {
|
|
61
71
|
scope?: MemoryScope;
|
|
62
72
|
content: string;
|
|
63
73
|
namespace?: string;
|
|
@@ -72,10 +82,12 @@ interface ScopedMemory {
|
|
|
72
82
|
content: string;
|
|
73
83
|
importance: number;
|
|
74
84
|
createdAt: string;
|
|
85
|
+
/** Billed cost for the call that produced this (write paths). */
|
|
86
|
+
costUsd?: number;
|
|
87
|
+
model?: string;
|
|
88
|
+
provider?: string;
|
|
75
89
|
}
|
|
76
|
-
interface SearchScopedMemoryOptions {
|
|
77
|
-
userId?: string;
|
|
78
|
-
sessionId?: string;
|
|
90
|
+
interface SearchScopedMemoryOptions extends MemoryScopeKeys {
|
|
79
91
|
scope?: MemoryScope;
|
|
80
92
|
query: string;
|
|
81
93
|
topK?: number;
|
|
@@ -109,10 +121,12 @@ interface ScopedSearchResult {
|
|
|
109
121
|
}>;
|
|
110
122
|
count: number;
|
|
111
123
|
latencyMs: number;
|
|
124
|
+
/** Billed embedding cost for the search. */
|
|
125
|
+
costUsd: number;
|
|
126
|
+
model?: string;
|
|
127
|
+
provider?: string;
|
|
112
128
|
}
|
|
113
|
-
interface ListScopedMemoryOptions {
|
|
114
|
-
userId?: string;
|
|
115
|
-
sessionId?: string;
|
|
129
|
+
interface ListScopedMemoryOptions extends MemoryScopeKeys {
|
|
116
130
|
scope?: MemoryScope;
|
|
117
131
|
namespace?: string;
|
|
118
132
|
limit?: number;
|
|
@@ -131,9 +145,8 @@ interface ScopedMemoryList {
|
|
|
131
145
|
count: number;
|
|
132
146
|
nextCursor: string | null;
|
|
133
147
|
}
|
|
134
|
-
interface RecallOptions {
|
|
148
|
+
interface RecallOptions extends MemoryScopeKeys {
|
|
135
149
|
scope?: MemoryScope;
|
|
136
|
-
sessionId?: string;
|
|
137
150
|
namespace?: string;
|
|
138
151
|
topK?: number;
|
|
139
152
|
threshold?: number;
|
|
@@ -155,9 +168,8 @@ interface RememberExchange {
|
|
|
155
168
|
user?: string;
|
|
156
169
|
assistant?: string;
|
|
157
170
|
}
|
|
158
|
-
interface RememberOptions {
|
|
171
|
+
interface RememberOptions extends MemoryScopeKeys {
|
|
159
172
|
scope?: MemoryScope;
|
|
160
|
-
sessionId?: string;
|
|
161
173
|
namespace?: string;
|
|
162
174
|
extract?: {
|
|
163
175
|
model?: string;
|
|
@@ -174,10 +186,85 @@ interface RememberResult {
|
|
|
174
186
|
extracted: number;
|
|
175
187
|
count: number;
|
|
176
188
|
scope: MemoryScope;
|
|
189
|
+
/** Billed cost (extraction + embeddings + graph, if any). */
|
|
190
|
+
costUsd: number;
|
|
191
|
+
model: string;
|
|
192
|
+
provider?: string;
|
|
177
193
|
}
|
|
178
|
-
interface
|
|
179
|
-
|
|
180
|
-
|
|
194
|
+
interface WriteBatchOptions extends MemoryScopeKeys {
|
|
195
|
+
scope?: MemoryScope;
|
|
196
|
+
namespace?: string;
|
|
197
|
+
metadata?: Record<string, unknown>;
|
|
198
|
+
expiresAt?: string;
|
|
199
|
+
memories: Array<{
|
|
200
|
+
content: string;
|
|
201
|
+
importance?: number;
|
|
202
|
+
}>;
|
|
203
|
+
}
|
|
204
|
+
interface WriteBatchResult {
|
|
205
|
+
written: Array<{
|
|
206
|
+
id: string;
|
|
207
|
+
content: string;
|
|
208
|
+
importance: number;
|
|
209
|
+
}>;
|
|
210
|
+
count: number;
|
|
211
|
+
requested: number;
|
|
212
|
+
scope: MemoryScope;
|
|
213
|
+
scopeKey: string;
|
|
214
|
+
/** Billed embedding cost for the batch. */
|
|
215
|
+
costUsd?: number;
|
|
216
|
+
model?: string;
|
|
217
|
+
provider?: string;
|
|
218
|
+
}
|
|
219
|
+
interface ForgetByFilterOptions extends MemoryScopeKeys {
|
|
220
|
+
scope?: MemoryScope;
|
|
221
|
+
namespace?: string;
|
|
222
|
+
/** Forget memories created before this ISO-8601 instant. */
|
|
223
|
+
before?: string;
|
|
224
|
+
/** Forget only these memory ids. */
|
|
225
|
+
ids?: string[];
|
|
226
|
+
}
|
|
227
|
+
interface ForgetByFilterResult {
|
|
228
|
+
forgotten: number;
|
|
229
|
+
truncated: boolean;
|
|
230
|
+
scope: MemoryScope;
|
|
231
|
+
scopeKey: string;
|
|
232
|
+
}
|
|
233
|
+
interface ExportMemoryOptions extends MemoryScopeKeys {
|
|
234
|
+
scope?: MemoryScope;
|
|
235
|
+
namespace?: string;
|
|
236
|
+
limit?: number;
|
|
237
|
+
/** ISO created_at of the last memory on the previous page. */
|
|
238
|
+
cursor?: string;
|
|
239
|
+
}
|
|
240
|
+
interface ExportMemoryResult {
|
|
241
|
+
scope: MemoryScope;
|
|
242
|
+
scopeKey: string;
|
|
243
|
+
exportedAt: string;
|
|
244
|
+
memories: Array<{
|
|
245
|
+
id: string;
|
|
246
|
+
scope: MemoryScope;
|
|
247
|
+
namespace: string | null;
|
|
248
|
+
content: string;
|
|
249
|
+
importance: number;
|
|
250
|
+
metadata?: Record<string, unknown>;
|
|
251
|
+
status?: string;
|
|
252
|
+
createdAt: string | null;
|
|
253
|
+
}>;
|
|
254
|
+
count: number;
|
|
255
|
+
nextCursor: string | null;
|
|
256
|
+
truncated: boolean;
|
|
257
|
+
}
|
|
258
|
+
interface WriteStatusResult {
|
|
259
|
+
requestId: string;
|
|
260
|
+
status: 'pending' | 'success' | 'error';
|
|
261
|
+
extracted: number | null;
|
|
262
|
+
written: number | null;
|
|
263
|
+
scope: string | null;
|
|
264
|
+
error: string | null;
|
|
265
|
+
finishedAt: string | null;
|
|
266
|
+
}
|
|
267
|
+
interface ForgetSuggestionsOptions extends MemoryScopeKeys {
|
|
181
268
|
scope?: MemoryScope;
|
|
182
269
|
namespace?: string;
|
|
183
270
|
/** Max suggestions (weakest first). Default 20. */
|
|
@@ -198,9 +285,7 @@ interface ForgetSuggestionsResult {
|
|
|
198
285
|
/** How many active memories were evaluated. */
|
|
199
286
|
evaluated: number;
|
|
200
287
|
}
|
|
201
|
-
interface RememberGraphOptions {
|
|
202
|
-
userId?: string;
|
|
203
|
-
sessionId?: string;
|
|
288
|
+
interface RememberGraphOptions extends MemoryScopeKeys {
|
|
204
289
|
scope?: MemoryScope;
|
|
205
290
|
namespace?: string;
|
|
206
291
|
user?: string;
|
|
@@ -213,9 +298,7 @@ interface RememberGraphResult {
|
|
|
213
298
|
relations: number;
|
|
214
299
|
costUsd: number;
|
|
215
300
|
}
|
|
216
|
-
interface GraphQueryOptions {
|
|
217
|
-
userId?: string;
|
|
218
|
-
sessionId?: string;
|
|
301
|
+
interface GraphQueryOptions extends MemoryScopeKeys {
|
|
219
302
|
scope?: MemoryScope;
|
|
220
303
|
namespace?: string;
|
|
221
304
|
/** Entity name to start the traversal from. */
|
|
@@ -243,9 +326,7 @@ interface GraphResult {
|
|
|
243
326
|
}>;
|
|
244
327
|
message?: string;
|
|
245
328
|
}
|
|
246
|
-
interface ListEntitiesOptions {
|
|
247
|
-
userId?: string;
|
|
248
|
-
sessionId?: string;
|
|
329
|
+
interface ListEntitiesOptions extends MemoryScopeKeys {
|
|
249
330
|
scope?: MemoryScope;
|
|
250
331
|
namespace?: string;
|
|
251
332
|
type?: string;
|
|
@@ -429,6 +510,50 @@ declare class MemoryClient {
|
|
|
429
510
|
* ```
|
|
430
511
|
*/
|
|
431
512
|
remember(userId: string, exchange: RememberExchange, options?: RememberOptions): Promise<RememberResult>;
|
|
513
|
+
/**
|
|
514
|
+
* Write up to 50 memories in one call — one quota check, one embedding
|
|
515
|
+
* call, one reconciliation pass for the whole batch.
|
|
516
|
+
*
|
|
517
|
+
* @example
|
|
518
|
+
* ```typescript
|
|
519
|
+
* await cencori.memory.writeBatch({
|
|
520
|
+
* userId: session.user.id,
|
|
521
|
+
* memories: [{ content: 'Prefers dark mode' }, { content: 'Uses TypeScript' }],
|
|
522
|
+
* });
|
|
523
|
+
* ```
|
|
524
|
+
*/
|
|
525
|
+
writeBatch(options: WriteBatchOptions): Promise<WriteBatchResult>;
|
|
526
|
+
/**
|
|
527
|
+
* Forget memories by filter — a hard delete, audit-logged. At least a
|
|
528
|
+
* scope key is required; narrow with namespace / before / ids.
|
|
529
|
+
*
|
|
530
|
+
* @example
|
|
531
|
+
* ```typescript
|
|
532
|
+
* await cencori.memory.forgetByFilter({ userId, before: '2026-01-01T00:00:00Z' });
|
|
533
|
+
* ```
|
|
534
|
+
*/
|
|
535
|
+
forgetByFilter(options: ForgetByFilterOptions): Promise<ForgetByFilterResult>;
|
|
536
|
+
/**
|
|
537
|
+
* GDPR export — a portable dump of everything stored about a scope key.
|
|
538
|
+
* Cursor-paginated; walk `nextCursor` until `truncated` is false.
|
|
539
|
+
*
|
|
540
|
+
* @example
|
|
541
|
+
* ```typescript
|
|
542
|
+
* const dump = await cencori.memory.export({ userId: session.user.id });
|
|
543
|
+
* ```
|
|
544
|
+
*/
|
|
545
|
+
export(options: ExportMemoryOptions): Promise<ExportMemoryResult>;
|
|
546
|
+
/**
|
|
547
|
+
* Confirm an async chat writeback. The chat response carries
|
|
548
|
+
* `memory.write_request_id` — poll here until `status` leaves `pending`.
|
|
549
|
+
*
|
|
550
|
+
* @example
|
|
551
|
+
* ```typescript
|
|
552
|
+
* const res = await cencori.chat.completions.create({ model, messages, memory: { userId } });
|
|
553
|
+
* const receipt = await cencori.memory.writeStatus(res.memory!.write_request_id!);
|
|
554
|
+
* ```
|
|
555
|
+
*/
|
|
556
|
+
writeStatus(requestId: string): Promise<WriteStatusResult>;
|
|
432
557
|
/**
|
|
433
558
|
* Create a new memory namespace
|
|
434
559
|
*/
|
|
@@ -490,4 +615,4 @@ declare class MemoryClient {
|
|
|
490
615
|
}
|
|
491
616
|
declare function createMemoryClient(config: CencoriConfig): MemoryClient;
|
|
492
617
|
|
|
493
|
-
export { type CreateNamespaceOptions, type EntitiesResult, type FetchedMemory, type ForgetSuggestionsOptions, type ForgetSuggestionsResult, type GraphQueryOptions, type GraphResult, type ListEntitiesOptions, type ListScopedMemoryOptions, MEMORY_FETCH_TOOL, type Memory, MemoryClient, type MemoryNamespace, type MemoryScope, type RecallOptions, type RememberExchange, type RememberGraphOptions, type RememberGraphResult, type RememberOptions, type RememberResult, type ScopedMemory, type ScopedMemoryList, type ScopedSearchResult, type SearchMemoryOptions, type SearchResult, type SearchScopedMemoryOptions, type StoreMemoryOptions, type WriteScopedMemoryOptions, createMemoryClient };
|
|
618
|
+
export { type CreateNamespaceOptions, type EntitiesResult, type ExportMemoryOptions, type ExportMemoryResult, type FetchedMemory, type ForgetByFilterOptions, type ForgetByFilterResult, type ForgetSuggestionsOptions, type ForgetSuggestionsResult, type GraphQueryOptions, type GraphResult, type ListEntitiesOptions, type ListScopedMemoryOptions, MEMORY_FETCH_TOOL, type Memory, MemoryClient, type MemoryNamespace, type MemoryScope, type MemoryScopeKeys, type RecallOptions, type RememberExchange, type RememberGraphOptions, type RememberGraphResult, type RememberOptions, type RememberResult, type ScopedMemory, type ScopedMemoryList, type ScopedSearchResult, type SearchMemoryOptions, type SearchResult, type SearchScopedMemoryOptions, type StoreMemoryOptions, type WriteBatchOptions, type WriteBatchResult, type WriteScopedMemoryOptions, type WriteStatusResult, createMemoryClient };
|
package/dist/memory/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as CencoriConfig } from '../types-
|
|
1
|
+
import { C as CencoriConfig } from '../types-CAhDuNTz.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Cencori Memory SDK
|
|
@@ -54,10 +54,20 @@ interface SearchResult {
|
|
|
54
54
|
count: number;
|
|
55
55
|
latencyMs: number;
|
|
56
56
|
}
|
|
57
|
-
type MemoryScope = 'session' | 'user';
|
|
58
|
-
|
|
57
|
+
type MemoryScope = 'session' | 'user' | 'workspace' | 'org';
|
|
58
|
+
/** Scope-key inputs shared by every scoped-memory option shape. */
|
|
59
|
+
interface MemoryScopeKeys {
|
|
59
60
|
userId?: string;
|
|
60
61
|
sessionId?: string;
|
|
62
|
+
/** Workspace key for scope='workspace' (a caller-owned team/space id). */
|
|
63
|
+
workspaceId?: string;
|
|
64
|
+
/**
|
|
65
|
+
* Org key for scope='org'. Optional — the server defaults it to the
|
|
66
|
+
* authenticated organization, the only key org scope can address.
|
|
67
|
+
*/
|
|
68
|
+
orgId?: string;
|
|
69
|
+
}
|
|
70
|
+
interface WriteScopedMemoryOptions extends MemoryScopeKeys {
|
|
61
71
|
scope?: MemoryScope;
|
|
62
72
|
content: string;
|
|
63
73
|
namespace?: string;
|
|
@@ -72,10 +82,12 @@ interface ScopedMemory {
|
|
|
72
82
|
content: string;
|
|
73
83
|
importance: number;
|
|
74
84
|
createdAt: string;
|
|
85
|
+
/** Billed cost for the call that produced this (write paths). */
|
|
86
|
+
costUsd?: number;
|
|
87
|
+
model?: string;
|
|
88
|
+
provider?: string;
|
|
75
89
|
}
|
|
76
|
-
interface SearchScopedMemoryOptions {
|
|
77
|
-
userId?: string;
|
|
78
|
-
sessionId?: string;
|
|
90
|
+
interface SearchScopedMemoryOptions extends MemoryScopeKeys {
|
|
79
91
|
scope?: MemoryScope;
|
|
80
92
|
query: string;
|
|
81
93
|
topK?: number;
|
|
@@ -109,10 +121,12 @@ interface ScopedSearchResult {
|
|
|
109
121
|
}>;
|
|
110
122
|
count: number;
|
|
111
123
|
latencyMs: number;
|
|
124
|
+
/** Billed embedding cost for the search. */
|
|
125
|
+
costUsd: number;
|
|
126
|
+
model?: string;
|
|
127
|
+
provider?: string;
|
|
112
128
|
}
|
|
113
|
-
interface ListScopedMemoryOptions {
|
|
114
|
-
userId?: string;
|
|
115
|
-
sessionId?: string;
|
|
129
|
+
interface ListScopedMemoryOptions extends MemoryScopeKeys {
|
|
116
130
|
scope?: MemoryScope;
|
|
117
131
|
namespace?: string;
|
|
118
132
|
limit?: number;
|
|
@@ -131,9 +145,8 @@ interface ScopedMemoryList {
|
|
|
131
145
|
count: number;
|
|
132
146
|
nextCursor: string | null;
|
|
133
147
|
}
|
|
134
|
-
interface RecallOptions {
|
|
148
|
+
interface RecallOptions extends MemoryScopeKeys {
|
|
135
149
|
scope?: MemoryScope;
|
|
136
|
-
sessionId?: string;
|
|
137
150
|
namespace?: string;
|
|
138
151
|
topK?: number;
|
|
139
152
|
threshold?: number;
|
|
@@ -155,9 +168,8 @@ interface RememberExchange {
|
|
|
155
168
|
user?: string;
|
|
156
169
|
assistant?: string;
|
|
157
170
|
}
|
|
158
|
-
interface RememberOptions {
|
|
171
|
+
interface RememberOptions extends MemoryScopeKeys {
|
|
159
172
|
scope?: MemoryScope;
|
|
160
|
-
sessionId?: string;
|
|
161
173
|
namespace?: string;
|
|
162
174
|
extract?: {
|
|
163
175
|
model?: string;
|
|
@@ -174,10 +186,85 @@ interface RememberResult {
|
|
|
174
186
|
extracted: number;
|
|
175
187
|
count: number;
|
|
176
188
|
scope: MemoryScope;
|
|
189
|
+
/** Billed cost (extraction + embeddings + graph, if any). */
|
|
190
|
+
costUsd: number;
|
|
191
|
+
model: string;
|
|
192
|
+
provider?: string;
|
|
177
193
|
}
|
|
178
|
-
interface
|
|
179
|
-
|
|
180
|
-
|
|
194
|
+
interface WriteBatchOptions extends MemoryScopeKeys {
|
|
195
|
+
scope?: MemoryScope;
|
|
196
|
+
namespace?: string;
|
|
197
|
+
metadata?: Record<string, unknown>;
|
|
198
|
+
expiresAt?: string;
|
|
199
|
+
memories: Array<{
|
|
200
|
+
content: string;
|
|
201
|
+
importance?: number;
|
|
202
|
+
}>;
|
|
203
|
+
}
|
|
204
|
+
interface WriteBatchResult {
|
|
205
|
+
written: Array<{
|
|
206
|
+
id: string;
|
|
207
|
+
content: string;
|
|
208
|
+
importance: number;
|
|
209
|
+
}>;
|
|
210
|
+
count: number;
|
|
211
|
+
requested: number;
|
|
212
|
+
scope: MemoryScope;
|
|
213
|
+
scopeKey: string;
|
|
214
|
+
/** Billed embedding cost for the batch. */
|
|
215
|
+
costUsd?: number;
|
|
216
|
+
model?: string;
|
|
217
|
+
provider?: string;
|
|
218
|
+
}
|
|
219
|
+
interface ForgetByFilterOptions extends MemoryScopeKeys {
|
|
220
|
+
scope?: MemoryScope;
|
|
221
|
+
namespace?: string;
|
|
222
|
+
/** Forget memories created before this ISO-8601 instant. */
|
|
223
|
+
before?: string;
|
|
224
|
+
/** Forget only these memory ids. */
|
|
225
|
+
ids?: string[];
|
|
226
|
+
}
|
|
227
|
+
interface ForgetByFilterResult {
|
|
228
|
+
forgotten: number;
|
|
229
|
+
truncated: boolean;
|
|
230
|
+
scope: MemoryScope;
|
|
231
|
+
scopeKey: string;
|
|
232
|
+
}
|
|
233
|
+
interface ExportMemoryOptions extends MemoryScopeKeys {
|
|
234
|
+
scope?: MemoryScope;
|
|
235
|
+
namespace?: string;
|
|
236
|
+
limit?: number;
|
|
237
|
+
/** ISO created_at of the last memory on the previous page. */
|
|
238
|
+
cursor?: string;
|
|
239
|
+
}
|
|
240
|
+
interface ExportMemoryResult {
|
|
241
|
+
scope: MemoryScope;
|
|
242
|
+
scopeKey: string;
|
|
243
|
+
exportedAt: string;
|
|
244
|
+
memories: Array<{
|
|
245
|
+
id: string;
|
|
246
|
+
scope: MemoryScope;
|
|
247
|
+
namespace: string | null;
|
|
248
|
+
content: string;
|
|
249
|
+
importance: number;
|
|
250
|
+
metadata?: Record<string, unknown>;
|
|
251
|
+
status?: string;
|
|
252
|
+
createdAt: string | null;
|
|
253
|
+
}>;
|
|
254
|
+
count: number;
|
|
255
|
+
nextCursor: string | null;
|
|
256
|
+
truncated: boolean;
|
|
257
|
+
}
|
|
258
|
+
interface WriteStatusResult {
|
|
259
|
+
requestId: string;
|
|
260
|
+
status: 'pending' | 'success' | 'error';
|
|
261
|
+
extracted: number | null;
|
|
262
|
+
written: number | null;
|
|
263
|
+
scope: string | null;
|
|
264
|
+
error: string | null;
|
|
265
|
+
finishedAt: string | null;
|
|
266
|
+
}
|
|
267
|
+
interface ForgetSuggestionsOptions extends MemoryScopeKeys {
|
|
181
268
|
scope?: MemoryScope;
|
|
182
269
|
namespace?: string;
|
|
183
270
|
/** Max suggestions (weakest first). Default 20. */
|
|
@@ -198,9 +285,7 @@ interface ForgetSuggestionsResult {
|
|
|
198
285
|
/** How many active memories were evaluated. */
|
|
199
286
|
evaluated: number;
|
|
200
287
|
}
|
|
201
|
-
interface RememberGraphOptions {
|
|
202
|
-
userId?: string;
|
|
203
|
-
sessionId?: string;
|
|
288
|
+
interface RememberGraphOptions extends MemoryScopeKeys {
|
|
204
289
|
scope?: MemoryScope;
|
|
205
290
|
namespace?: string;
|
|
206
291
|
user?: string;
|
|
@@ -213,9 +298,7 @@ interface RememberGraphResult {
|
|
|
213
298
|
relations: number;
|
|
214
299
|
costUsd: number;
|
|
215
300
|
}
|
|
216
|
-
interface GraphQueryOptions {
|
|
217
|
-
userId?: string;
|
|
218
|
-
sessionId?: string;
|
|
301
|
+
interface GraphQueryOptions extends MemoryScopeKeys {
|
|
219
302
|
scope?: MemoryScope;
|
|
220
303
|
namespace?: string;
|
|
221
304
|
/** Entity name to start the traversal from. */
|
|
@@ -243,9 +326,7 @@ interface GraphResult {
|
|
|
243
326
|
}>;
|
|
244
327
|
message?: string;
|
|
245
328
|
}
|
|
246
|
-
interface ListEntitiesOptions {
|
|
247
|
-
userId?: string;
|
|
248
|
-
sessionId?: string;
|
|
329
|
+
interface ListEntitiesOptions extends MemoryScopeKeys {
|
|
249
330
|
scope?: MemoryScope;
|
|
250
331
|
namespace?: string;
|
|
251
332
|
type?: string;
|
|
@@ -429,6 +510,50 @@ declare class MemoryClient {
|
|
|
429
510
|
* ```
|
|
430
511
|
*/
|
|
431
512
|
remember(userId: string, exchange: RememberExchange, options?: RememberOptions): Promise<RememberResult>;
|
|
513
|
+
/**
|
|
514
|
+
* Write up to 50 memories in one call — one quota check, one embedding
|
|
515
|
+
* call, one reconciliation pass for the whole batch.
|
|
516
|
+
*
|
|
517
|
+
* @example
|
|
518
|
+
* ```typescript
|
|
519
|
+
* await cencori.memory.writeBatch({
|
|
520
|
+
* userId: session.user.id,
|
|
521
|
+
* memories: [{ content: 'Prefers dark mode' }, { content: 'Uses TypeScript' }],
|
|
522
|
+
* });
|
|
523
|
+
* ```
|
|
524
|
+
*/
|
|
525
|
+
writeBatch(options: WriteBatchOptions): Promise<WriteBatchResult>;
|
|
526
|
+
/**
|
|
527
|
+
* Forget memories by filter — a hard delete, audit-logged. At least a
|
|
528
|
+
* scope key is required; narrow with namespace / before / ids.
|
|
529
|
+
*
|
|
530
|
+
* @example
|
|
531
|
+
* ```typescript
|
|
532
|
+
* await cencori.memory.forgetByFilter({ userId, before: '2026-01-01T00:00:00Z' });
|
|
533
|
+
* ```
|
|
534
|
+
*/
|
|
535
|
+
forgetByFilter(options: ForgetByFilterOptions): Promise<ForgetByFilterResult>;
|
|
536
|
+
/**
|
|
537
|
+
* GDPR export — a portable dump of everything stored about a scope key.
|
|
538
|
+
* Cursor-paginated; walk `nextCursor` until `truncated` is false.
|
|
539
|
+
*
|
|
540
|
+
* @example
|
|
541
|
+
* ```typescript
|
|
542
|
+
* const dump = await cencori.memory.export({ userId: session.user.id });
|
|
543
|
+
* ```
|
|
544
|
+
*/
|
|
545
|
+
export(options: ExportMemoryOptions): Promise<ExportMemoryResult>;
|
|
546
|
+
/**
|
|
547
|
+
* Confirm an async chat writeback. The chat response carries
|
|
548
|
+
* `memory.write_request_id` — poll here until `status` leaves `pending`.
|
|
549
|
+
*
|
|
550
|
+
* @example
|
|
551
|
+
* ```typescript
|
|
552
|
+
* const res = await cencori.chat.completions.create({ model, messages, memory: { userId } });
|
|
553
|
+
* const receipt = await cencori.memory.writeStatus(res.memory!.write_request_id!);
|
|
554
|
+
* ```
|
|
555
|
+
*/
|
|
556
|
+
writeStatus(requestId: string): Promise<WriteStatusResult>;
|
|
432
557
|
/**
|
|
433
558
|
* Create a new memory namespace
|
|
434
559
|
*/
|
|
@@ -490,4 +615,4 @@ declare class MemoryClient {
|
|
|
490
615
|
}
|
|
491
616
|
declare function createMemoryClient(config: CencoriConfig): MemoryClient;
|
|
492
617
|
|
|
493
|
-
export { type CreateNamespaceOptions, type EntitiesResult, type FetchedMemory, type ForgetSuggestionsOptions, type ForgetSuggestionsResult, type GraphQueryOptions, type GraphResult, type ListEntitiesOptions, type ListScopedMemoryOptions, MEMORY_FETCH_TOOL, type Memory, MemoryClient, type MemoryNamespace, type MemoryScope, type RecallOptions, type RememberExchange, type RememberGraphOptions, type RememberGraphResult, type RememberOptions, type RememberResult, type ScopedMemory, type ScopedMemoryList, type ScopedSearchResult, type SearchMemoryOptions, type SearchResult, type SearchScopedMemoryOptions, type StoreMemoryOptions, type WriteScopedMemoryOptions, createMemoryClient };
|
|
618
|
+
export { type CreateNamespaceOptions, type EntitiesResult, type ExportMemoryOptions, type ExportMemoryResult, type FetchedMemory, type ForgetByFilterOptions, type ForgetByFilterResult, type ForgetSuggestionsOptions, type ForgetSuggestionsResult, type GraphQueryOptions, type GraphResult, type ListEntitiesOptions, type ListScopedMemoryOptions, MEMORY_FETCH_TOOL, type Memory, MemoryClient, type MemoryNamespace, type MemoryScope, type MemoryScopeKeys, type RecallOptions, type RememberExchange, type RememberGraphOptions, type RememberGraphResult, type RememberOptions, type RememberResult, type ScopedMemory, type ScopedMemoryList, type ScopedSearchResult, type SearchMemoryOptions, type SearchResult, type SearchScopedMemoryOptions, type StoreMemoryOptions, type WriteBatchOptions, type WriteBatchResult, type WriteScopedMemoryOptions, type WriteStatusResult, createMemoryClient };
|