@papr/memory 1.0.0 → 1.2.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.
Files changed (146) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +11 -11
  3. package/api-promise.d.mts +2 -0
  4. package/api-promise.d.mts.map +1 -0
  5. package/api-promise.d.ts +1 -2
  6. package/api-promise.d.ts.map +1 -1
  7. package/api-promise.js +2 -15
  8. package/api-promise.js.map +1 -1
  9. package/client.d.mts +192 -0
  10. package/client.d.mts.map +1 -0
  11. package/client.d.ts +15 -15
  12. package/client.d.ts.map +1 -1
  13. package/client.js +8 -51
  14. package/client.js.map +1 -1
  15. package/client.mjs +1 -11
  16. package/client.mjs.map +1 -1
  17. package/core/api-promise.d.mts +46 -0
  18. package/core/api-promise.d.mts.map +1 -0
  19. package/core/api-promise.d.ts +3 -3
  20. package/core/api-promise.d.ts.map +1 -1
  21. package/core/api-promise.js +4 -14
  22. package/core/api-promise.js.map +1 -1
  23. package/core/api-promise.mjs +1 -11
  24. package/core/api-promise.mjs.map +1 -1
  25. package/core/error.d.mts +46 -0
  26. package/core/error.d.mts.map +1 -0
  27. package/core/resource.d.mts +6 -0
  28. package/core/resource.d.mts.map +1 -0
  29. package/core/resource.d.ts +1 -1
  30. package/core/resource.d.ts.map +1 -1
  31. package/core/uploads.d.mts +3 -0
  32. package/core/uploads.d.mts.map +1 -0
  33. package/core/uploads.d.ts +2 -2
  34. package/core/uploads.d.ts.map +1 -1
  35. package/error.d.mts +2 -0
  36. package/error.d.mts.map +1 -0
  37. package/error.d.ts +1 -2
  38. package/error.d.ts.map +1 -1
  39. package/error.js +2 -15
  40. package/error.js.map +1 -1
  41. package/index.d.mts +6 -0
  42. package/index.d.mts.map +1 -0
  43. package/index.d.ts +5 -5
  44. package/index.d.ts.map +1 -1
  45. package/internal/builtin-types.d.mts +73 -0
  46. package/internal/builtin-types.d.mts.map +1 -0
  47. package/internal/detect-platform.d.mts +15 -0
  48. package/internal/detect-platform.d.mts.map +1 -0
  49. package/internal/errors.d.mts +3 -0
  50. package/internal/errors.d.mts.map +1 -0
  51. package/internal/headers.d.mts +20 -0
  52. package/internal/headers.d.mts.map +1 -0
  53. package/internal/parse.d.mts +12 -0
  54. package/internal/parse.d.mts.map +1 -0
  55. package/internal/parse.d.ts +2 -2
  56. package/internal/parse.d.ts.map +1 -1
  57. package/internal/request-options.d.mts +32 -0
  58. package/internal/request-options.d.mts.map +1 -0
  59. package/internal/request-options.d.ts +4 -4
  60. package/internal/request-options.d.ts.map +1 -1
  61. package/internal/shims.d.mts +20 -0
  62. package/internal/shims.d.mts.map +1 -0
  63. package/internal/shims.d.ts +2 -8
  64. package/internal/shims.d.ts.map +1 -1
  65. package/internal/to-file.d.mts +45 -0
  66. package/internal/to-file.d.mts.map +1 -0
  67. package/internal/to-file.d.ts +1 -1
  68. package/internal/to-file.d.ts.map +1 -1
  69. package/internal/tslib.js +81 -0
  70. package/internal/tslib.mjs +17 -0
  71. package/internal/types.d.mts +67 -0
  72. package/internal/types.d.mts.map +1 -0
  73. package/internal/uploads.d.mts +42 -0
  74. package/internal/uploads.d.mts.map +1 -0
  75. package/internal/uploads.d.ts +3 -3
  76. package/internal/uploads.d.ts.map +1 -1
  77. package/internal/utils/base64.d.mts +3 -0
  78. package/internal/utils/base64.d.mts.map +1 -0
  79. package/internal/utils/bytes.d.mts +4 -0
  80. package/internal/utils/bytes.d.mts.map +1 -0
  81. package/internal/utils/env.d.mts +9 -0
  82. package/internal/utils/env.d.mts.map +1 -0
  83. package/internal/utils/log.d.mts +37 -0
  84. package/internal/utils/log.d.mts.map +1 -0
  85. package/internal/utils/log.d.ts +2 -2
  86. package/internal/utils/log.d.ts.map +1 -1
  87. package/internal/utils/path.d.mts +15 -0
  88. package/internal/utils/path.d.mts.map +1 -0
  89. package/internal/utils/sleep.d.mts +2 -0
  90. package/internal/utils/sleep.d.mts.map +1 -0
  91. package/internal/utils/uuid.d.mts +5 -0
  92. package/internal/utils/uuid.d.mts.map +1 -0
  93. package/internal/utils/values.d.mts +16 -0
  94. package/internal/utils/values.d.mts.map +1 -0
  95. package/internal/utils.d.mts +7 -0
  96. package/internal/utils.d.mts.map +1 -0
  97. package/internal/utils.d.ts +6 -6
  98. package/internal/utils.d.ts.map +1 -1
  99. package/internal/utils.js +7 -20
  100. package/internal/utils.js.map +1 -1
  101. package/package.json +5 -4
  102. package/resource.d.mts +2 -0
  103. package/resource.d.mts.map +1 -0
  104. package/resource.d.ts +1 -2
  105. package/resource.d.ts.map +1 -1
  106. package/resource.js +2 -15
  107. package/resource.js.map +1 -1
  108. package/resources/document.d.mts +103 -0
  109. package/resources/document.d.mts.map +1 -0
  110. package/resources/document.d.ts +3 -3
  111. package/resources/document.d.ts.map +1 -1
  112. package/resources/index.d.mts +4 -0
  113. package/resources/index.d.mts.map +1 -0
  114. package/resources/index.d.ts +3 -3
  115. package/resources/index.d.ts.map +1 -1
  116. package/resources/memory.d.mts +771 -0
  117. package/resources/memory.d.mts.map +1 -0
  118. package/resources/memory.d.ts +12 -4
  119. package/resources/memory.d.ts.map +1 -1
  120. package/resources/user.d.mts +139 -0
  121. package/resources/user.d.mts.map +1 -0
  122. package/resources/user.d.ts +3 -3
  123. package/resources/user.d.ts.map +1 -1
  124. package/resources.d.mts +2 -0
  125. package/resources.d.mts.map +1 -0
  126. package/resources.d.ts +1 -1
  127. package/resources.d.ts.map +1 -1
  128. package/resources.js +2 -15
  129. package/resources.js.map +1 -1
  130. package/src/resources/memory.ts +9 -0
  131. package/src/version.ts +1 -1
  132. package/uploads.d.mts +2 -0
  133. package/uploads.d.mts.map +1 -0
  134. package/uploads.d.ts +1 -2
  135. package/uploads.d.ts.map +1 -1
  136. package/uploads.js +2 -15
  137. package/uploads.js.map +1 -1
  138. package/version.d.mts +2 -0
  139. package/version.d.mts.map +1 -0
  140. package/version.d.ts +1 -1
  141. package/version.d.ts.map +1 -1
  142. package/version.js +1 -1
  143. package/version.js.map +1 -1
  144. package/version.mjs +1 -1
  145. package/version.mjs.map +1 -1
  146. package/src/global.d.ts +0 -5
@@ -0,0 +1,771 @@
1
+ import { APIResource } from "../core/resource.mjs";
2
+ import * as DocumentAPI from "./document.mjs";
3
+ import { APIPromise } from "../core/api-promise.mjs";
4
+ import { RequestOptions } from "../internal/request-options.mjs";
5
+ export declare class Memory extends APIResource {
6
+ /**
7
+ * Update an existing memory item by ID.
8
+ *
9
+ * **Authentication Required**:
10
+ * One of the following authentication methods must be used:
11
+ * - Bearer token in `Authorization` header
12
+ * - API Key in `X-API-Key` header
13
+ * - Session token in `X-Session-Token` header
14
+ *
15
+ * **Required Headers**:
16
+ * - Content-Type: application/json
17
+ * - X-Client-Type: (e.g., 'papr_plugin', 'browser_extension')
18
+ *
19
+ * The API validates content size against MAX_CONTENT_LENGTH environment variable (defaults to 15000 bytes).
20
+ *
21
+ * @example
22
+ * ```ts
23
+ * const memory = await client.memory.update('memory_id');
24
+ * ```
25
+ */
26
+ update(memoryID: string, body: MemoryUpdateParams, options?: RequestOptions): APIPromise<MemoryUpdateResponse>;
27
+ /**
28
+ * Delete a memory item by ID.
29
+ *
30
+ * **Authentication Required**:
31
+ * One of the following authentication methods must be used:
32
+ * - Bearer token in `Authorization` header
33
+ * - API Key in `X-API-Key` header
34
+ * - Session token in `X-Session-Token` header
35
+ *
36
+ * **Required Headers**:
37
+ * - X-Client-Type: (e.g., 'papr_plugin', 'browser_extension')
38
+ *
39
+ * @example
40
+ * ```ts
41
+ * const memory = await client.memory.delete('memory_id');
42
+ * ```
43
+ */
44
+ delete(memoryID: string, params?: MemoryDeleteParams | null | undefined, options?: RequestOptions): APIPromise<MemoryDeleteResponse>;
45
+ /**
46
+ * Add a new memory item to the system with size validation and background
47
+ * processing.
48
+ *
49
+ * **Authentication Required**:
50
+ * One of the following authentication methods must be used:
51
+ * - Bearer token in `Authorization` header
52
+ * - API Key in `X-API-Key` header
53
+ * - Session token in `X-Session-Token` header
54
+ *
55
+ * **Required Headers**:
56
+ * - Content-Type: application/json
57
+ * - X-Client-Type: (e.g., 'papr_plugin', 'browser_extension')
58
+ *
59
+ * The API validates content size against MAX_CONTENT_LENGTH environment variable (defaults to 15000 bytes).
60
+ *
61
+ * @example
62
+ * ```ts
63
+ * const addMemoryResponse = await client.memory.add({
64
+ * content:
65
+ * 'Meeting notes from the product planning session',
66
+ * });
67
+ * ```
68
+ */
69
+ add(params: MemoryAddParams, options?: RequestOptions): APIPromise<AddMemoryResponse>;
70
+ /**
71
+ * Add multiple memory items in a batch with size validation and background
72
+ * processing.
73
+ *
74
+ * **Authentication Required**:
75
+ * One of the following authentication methods must be used:
76
+ * - Bearer token in `Authorization` header
77
+ * - API Key in `X-API-Key` header
78
+ * - Session token in `X-Session-Token` header
79
+ *
80
+ * **Required Headers**:
81
+ * - Content-Type: application/json
82
+ * - X-Client-Type: (e.g., 'papr_plugin', 'browser_extension')
83
+ *
84
+ * The API validates individual memory content size against MAX_CONTENT_LENGTH environment variable (defaults to 15000 bytes).
85
+ *
86
+ * @example
87
+ * ```ts
88
+ * const response = await client.memory.addBatch({
89
+ * memories: [
90
+ * {
91
+ * content:
92
+ * 'Meeting notes from the product planning session',
93
+ * },
94
+ * {
95
+ * content: 'Follow-up tasks from the planning meeting',
96
+ * },
97
+ * ],
98
+ * });
99
+ * ```
100
+ */
101
+ addBatch(params: MemoryAddBatchParams, options?: RequestOptions): APIPromise<MemoryAddBatchResponse>;
102
+ /**
103
+ * Retrieve a memory item by ID.
104
+ *
105
+ * **Authentication Required**:
106
+ * One of the following authentication methods must be used:
107
+ * - Bearer token in `Authorization` header
108
+ * - API Key in `X-API-Key` header
109
+ * - Session token in `X-Session-Token` header
110
+ *
111
+ * **Required Headers**:
112
+ * - X-Client-Type: (e.g., 'papr_plugin', 'browser_extension')
113
+ *
114
+ * @example
115
+ * ```ts
116
+ * const searchResponse = await client.memory.get('memory_id');
117
+ * ```
118
+ */
119
+ get(memoryID: string, options?: RequestOptions): APIPromise<SearchResponse>;
120
+ /**
121
+ * Search through memories with authentication required.
122
+ *
123
+ * **Authentication Required**:
124
+ * One of the following authentication methods must be used:
125
+ * - Bearer token in `Authorization` header
126
+ * - API Key in `X-API-Key` header
127
+ * - Session token in `X-Session-Token` header
128
+ *
129
+ * **Recommended Headers**:
130
+ * ```
131
+ * Accept-Encoding: gzip
132
+ * ```
133
+ *
134
+ * The API supports response compression for improved performance. Responses larger than 1KB will be automatically compressed when this header is present.
135
+ *
136
+ * @example
137
+ * ```ts
138
+ * const searchResponse = await client.memory.search({
139
+ * query:
140
+ * 'Find recurring customer complaints about API performance from the last month. Focus on issues where customers specifically mentioned timeout errors or slow response times in their conversations.',
141
+ * });
142
+ * ```
143
+ */
144
+ search(params: MemorySearchParams, options?: RequestOptions): APIPromise<SearchResponse>;
145
+ }
146
+ /**
147
+ * Request model for adding a new memory
148
+ */
149
+ export interface AddMemory {
150
+ /**
151
+ * The content of the memory item you want to add to memory
152
+ */
153
+ content: string;
154
+ /**
155
+ * Context can be conversation history or any relevant context for a memory item
156
+ */
157
+ context?: Array<ContextItem> | null;
158
+ /**
159
+ * Metadata for memory request
160
+ */
161
+ metadata?: MemoryMetadata | null;
162
+ /**
163
+ * Array of relationships that we can use in Graph DB (neo4J)
164
+ */
165
+ relationships_json?: Array<RelationshipItem> | null;
166
+ /**
167
+ * Content type of the memory item
168
+ */
169
+ type?: MemoryType;
170
+ }
171
+ /**
172
+ * Unified response model for add_memory API endpoint (success or error).
173
+ */
174
+ export interface AddMemoryResponse {
175
+ /**
176
+ * HTTP status code
177
+ */
178
+ code?: number;
179
+ /**
180
+ * List of memory items if successful
181
+ */
182
+ data?: Array<DocumentAPI.AddMemoryItem> | null;
183
+ /**
184
+ * Additional error details or context
185
+ */
186
+ details?: unknown;
187
+ /**
188
+ * Error message if failed
189
+ */
190
+ error?: string | null;
191
+ /**
192
+ * 'success' or 'error'
193
+ */
194
+ status?: string;
195
+ }
196
+ /**
197
+ * Context item for memory request
198
+ */
199
+ export interface ContextItem {
200
+ content: string;
201
+ role: 'user' | 'assistant';
202
+ }
203
+ /**
204
+ * Metadata for memory request
205
+ */
206
+ export interface MemoryMetadata {
207
+ conversationId?: string | null;
208
+ /**
209
+ * ISO datetime when the memory was created
210
+ */
211
+ createdAt?: string | null;
212
+ 'emoji tags'?: string | null;
213
+ 'emotion tags'?: string | null;
214
+ /**
215
+ * Hierarchical structures to enable navigation from broad topics to specific ones
216
+ */
217
+ hierarchical_structures?: string | null;
218
+ location?: string | null;
219
+ role_read_access?: Array<string> | null;
220
+ role_write_access?: Array<string> | null;
221
+ sourceUrl?: string | null;
222
+ topics?: string | null;
223
+ user_id?: string | null;
224
+ user_read_access?: Array<string> | null;
225
+ user_write_access?: Array<string> | null;
226
+ workspace_read_access?: Array<string> | null;
227
+ workspace_write_access?: Array<string> | null;
228
+ [k: string]: unknown;
229
+ }
230
+ /**
231
+ * Valid memory types
232
+ */
233
+ export type MemoryType = 'text' | 'code_snippet' | 'document';
234
+ /**
235
+ * Relationship item for memory request
236
+ */
237
+ export interface RelationshipItem {
238
+ related_item_id: 'TextMemoryItem' | 'previous_memory_item_id';
239
+ related_item_type: 'TextMemoryItem';
240
+ relation_type: string;
241
+ metadata?: unknown;
242
+ }
243
+ export interface SearchResponse {
244
+ /**
245
+ * HTTP status code
246
+ */
247
+ code?: number;
248
+ /**
249
+ * Return type for SearchResult
250
+ */
251
+ data?: SearchResponse.Data | null;
252
+ /**
253
+ * Additional error details or context
254
+ */
255
+ details?: unknown;
256
+ /**
257
+ * Error message if failed
258
+ */
259
+ error?: string | null;
260
+ /**
261
+ * 'success' or 'error'
262
+ */
263
+ status?: string;
264
+ }
265
+ export declare namespace SearchResponse {
266
+ /**
267
+ * Return type for SearchResult
268
+ */
269
+ interface Data {
270
+ memories: Array<Data.Memory>;
271
+ nodes: Array<Data.Node>;
272
+ }
273
+ namespace Data {
274
+ /**
275
+ * A memory item in the knowledge base
276
+ */
277
+ interface Memory {
278
+ id: string;
279
+ acl: Record<string, Record<string, boolean>>;
280
+ content: string;
281
+ type: string;
282
+ user_id: string;
283
+ context?: string | null;
284
+ conversation_id?: string;
285
+ created_at?: string | null;
286
+ current_step?: string | null;
287
+ file_url?: string | null;
288
+ filename?: string | null;
289
+ hierarchical_structures?: string;
290
+ location?: string | null;
291
+ metadata?: string | unknown | null;
292
+ page?: string | null;
293
+ page_number?: number | null;
294
+ source_document_id?: string | null;
295
+ source_message_id?: string | null;
296
+ source_type?: string;
297
+ source_url?: string;
298
+ steps?: Array<string>;
299
+ tags?: Array<string>;
300
+ title?: string | null;
301
+ topics?: Array<string>;
302
+ total_pages?: number | null;
303
+ updated_at?: string | null;
304
+ workspace_id?: string | null;
305
+ [k: string]: unknown;
306
+ }
307
+ /**
308
+ * Public-facing node structure matching our internal representation
309
+ */
310
+ interface Node {
311
+ label: 'Memory' | 'Person' | 'Company' | 'Project' | 'Task' | 'Insight' | 'Meeting' | 'Opportunity' | 'Code';
312
+ /**
313
+ * Memory node properties
314
+ */
315
+ properties: Node.PaprMemoryNodeProperties | Node.PersonNodeProperties | Node.CompanyNodeProperties | Node.ProjectNodeProperties | Node.TaskNodeProperties | Node.InsightNodeProperties | Node.MeetingNodeProperties | Node.OpportunityNodeProperties | Node.CodeNodeProperties;
316
+ }
317
+ namespace Node {
318
+ /**
319
+ * Memory node properties
320
+ */
321
+ interface PaprMemoryNodeProperties {
322
+ id: string;
323
+ content: string;
324
+ current_step: string;
325
+ emotion_tags: Array<string>;
326
+ steps: Array<string>;
327
+ topics: Array<string>;
328
+ type: string;
329
+ conversationId?: string | null;
330
+ createdAt?: string | null;
331
+ emoji_tags?: Array<string> | null;
332
+ hierarchical_structures?: string | null;
333
+ pageId?: string | null;
334
+ role_read_access?: Array<string> | null;
335
+ role_write_access?: Array<string> | null;
336
+ sourceType?: string | null;
337
+ sourceUrl?: string | null;
338
+ title?: string | null;
339
+ updatedAt?: string | null;
340
+ user_id?: string | null;
341
+ user_read_access?: Array<string> | null;
342
+ user_write_access?: Array<string> | null;
343
+ workspace_id?: string | null;
344
+ workspace_read_access?: Array<string> | null;
345
+ workspace_write_access?: Array<string> | null;
346
+ }
347
+ /**
348
+ * Person node properties
349
+ */
350
+ interface PersonNodeProperties {
351
+ id: string;
352
+ description: string;
353
+ name: string;
354
+ role: string;
355
+ conversationId?: string | null;
356
+ createdAt?: string | null;
357
+ pageId?: string | null;
358
+ role_read_access?: Array<string> | null;
359
+ role_write_access?: Array<string> | null;
360
+ sourceType?: string | null;
361
+ sourceUrl?: string | null;
362
+ updatedAt?: string | null;
363
+ user_id?: string | null;
364
+ user_read_access?: Array<string> | null;
365
+ user_write_access?: Array<string> | null;
366
+ workspace_id?: string | null;
367
+ workspace_read_access?: Array<string> | null;
368
+ workspace_write_access?: Array<string> | null;
369
+ }
370
+ /**
371
+ * Company node properties
372
+ */
373
+ interface CompanyNodeProperties {
374
+ id: string;
375
+ description: string;
376
+ name: string;
377
+ conversationId?: string | null;
378
+ createdAt?: string | null;
379
+ pageId?: string | null;
380
+ role_read_access?: Array<string> | null;
381
+ role_write_access?: Array<string> | null;
382
+ sourceType?: string | null;
383
+ sourceUrl?: string | null;
384
+ updatedAt?: string | null;
385
+ user_id?: string | null;
386
+ user_read_access?: Array<string> | null;
387
+ user_write_access?: Array<string> | null;
388
+ workspace_id?: string | null;
389
+ workspace_read_access?: Array<string> | null;
390
+ workspace_write_access?: Array<string> | null;
391
+ }
392
+ /**
393
+ * Project node properties
394
+ */
395
+ interface ProjectNodeProperties {
396
+ id: string;
397
+ description: string;
398
+ name: string;
399
+ type: string;
400
+ conversationId?: string | null;
401
+ createdAt?: string | null;
402
+ pageId?: string | null;
403
+ role_read_access?: Array<string> | null;
404
+ role_write_access?: Array<string> | null;
405
+ sourceType?: string | null;
406
+ sourceUrl?: string | null;
407
+ updatedAt?: string | null;
408
+ user_id?: string | null;
409
+ user_read_access?: Array<string> | null;
410
+ user_write_access?: Array<string> | null;
411
+ workspace_id?: string | null;
412
+ workspace_read_access?: Array<string> | null;
413
+ workspace_write_access?: Array<string> | null;
414
+ }
415
+ /**
416
+ * Task node properties
417
+ */
418
+ interface TaskNodeProperties {
419
+ id: string;
420
+ description: string;
421
+ status: 'new' | 'in_progress' | 'completed';
422
+ title: string;
423
+ type: 'task' | 'subtask' | 'bug' | 'feature_request' | 'epic' | 'support_ticket';
424
+ conversationId?: string | null;
425
+ createdAt?: string | null;
426
+ pageId?: string | null;
427
+ role_read_access?: Array<string> | null;
428
+ role_write_access?: Array<string> | null;
429
+ sourceType?: string | null;
430
+ sourceUrl?: string | null;
431
+ updatedAt?: string | null;
432
+ user_id?: string | null;
433
+ user_read_access?: Array<string> | null;
434
+ user_write_access?: Array<string> | null;
435
+ workspace_id?: string | null;
436
+ workspace_read_access?: Array<string> | null;
437
+ workspace_write_access?: Array<string> | null;
438
+ }
439
+ /**
440
+ * Insight node properties
441
+ */
442
+ interface InsightNodeProperties {
443
+ id: string;
444
+ description: string;
445
+ source: string;
446
+ title: string;
447
+ type: 'customer_insight' | 'product_insight' | 'market_insight' | 'competitive_insight' | 'technical_insight' | 'other';
448
+ conversationId?: string | null;
449
+ createdAt?: string | null;
450
+ pageId?: string | null;
451
+ role_read_access?: Array<string> | null;
452
+ role_write_access?: Array<string> | null;
453
+ sourceType?: string | null;
454
+ sourceUrl?: string | null;
455
+ updatedAt?: string | null;
456
+ user_id?: string | null;
457
+ user_read_access?: Array<string> | null;
458
+ user_write_access?: Array<string> | null;
459
+ workspace_id?: string | null;
460
+ workspace_read_access?: Array<string> | null;
461
+ workspace_write_access?: Array<string> | null;
462
+ }
463
+ /**
464
+ * Meeting node properties
465
+ */
466
+ interface MeetingNodeProperties {
467
+ id: string;
468
+ action_items: Array<string>;
469
+ agenda: string;
470
+ date: string;
471
+ outcome: string;
472
+ participants: Array<string>;
473
+ summary: string;
474
+ time: string;
475
+ title: string;
476
+ type: string;
477
+ conversationId?: string | null;
478
+ createdAt?: string | null;
479
+ pageId?: string | null;
480
+ role_read_access?: Array<string> | null;
481
+ role_write_access?: Array<string> | null;
482
+ sourceType?: string | null;
483
+ sourceUrl?: string | null;
484
+ updatedAt?: string | null;
485
+ user_id?: string | null;
486
+ user_read_access?: Array<string> | null;
487
+ user_write_access?: Array<string> | null;
488
+ workspace_id?: string | null;
489
+ workspace_read_access?: Array<string> | null;
490
+ workspace_write_access?: Array<string> | null;
491
+ }
492
+ /**
493
+ * Opportunity node properties
494
+ */
495
+ interface OpportunityNodeProperties {
496
+ id: string;
497
+ close_date: string;
498
+ description: string;
499
+ next_steps: Array<string>;
500
+ probability: number;
501
+ stage: 'prospect' | 'lead' | 'opportunity' | 'won' | 'lost';
502
+ title: string;
503
+ value: number;
504
+ conversationId?: string | null;
505
+ createdAt?: string | null;
506
+ pageId?: string | null;
507
+ role_read_access?: Array<string> | null;
508
+ role_write_access?: Array<string> | null;
509
+ sourceType?: string | null;
510
+ sourceUrl?: string | null;
511
+ updatedAt?: string | null;
512
+ user_id?: string | null;
513
+ user_read_access?: Array<string> | null;
514
+ user_write_access?: Array<string> | null;
515
+ workspace_id?: string | null;
516
+ workspace_read_access?: Array<string> | null;
517
+ workspace_write_access?: Array<string> | null;
518
+ }
519
+ /**
520
+ * Code node properties
521
+ */
522
+ interface CodeNodeProperties {
523
+ id: string;
524
+ author: string;
525
+ language: string;
526
+ name: string;
527
+ conversationId?: string | null;
528
+ createdAt?: string | null;
529
+ pageId?: string | null;
530
+ role_read_access?: Array<string> | null;
531
+ role_write_access?: Array<string> | null;
532
+ sourceType?: string | null;
533
+ sourceUrl?: string | null;
534
+ updatedAt?: string | null;
535
+ user_id?: string | null;
536
+ user_read_access?: Array<string> | null;
537
+ user_write_access?: Array<string> | null;
538
+ workspace_id?: string | null;
539
+ workspace_read_access?: Array<string> | null;
540
+ workspace_write_access?: Array<string> | null;
541
+ }
542
+ }
543
+ }
544
+ }
545
+ /**
546
+ * Unified response model for update_memory API endpoint (success or error).
547
+ */
548
+ export interface MemoryUpdateResponse {
549
+ /**
550
+ * HTTP status code
551
+ */
552
+ code?: number;
553
+ /**
554
+ * Additional error details or context
555
+ */
556
+ details?: unknown;
557
+ /**
558
+ * Error message if failed
559
+ */
560
+ error?: string | null;
561
+ /**
562
+ * List of updated memory items if successful
563
+ */
564
+ memory_items?: Array<MemoryUpdateResponse.MemoryItem> | null;
565
+ /**
566
+ * Status message
567
+ */
568
+ message?: string | null;
569
+ /**
570
+ * 'success' or 'error'
571
+ */
572
+ status?: string;
573
+ /**
574
+ * Status of update operation for each system
575
+ */
576
+ status_obj?: MemoryUpdateResponse.StatusObj | null;
577
+ }
578
+ export declare namespace MemoryUpdateResponse {
579
+ /**
580
+ * Model for a single updated memory item
581
+ */
582
+ interface MemoryItem {
583
+ memoryId: string;
584
+ objectId: string;
585
+ updatedAt: string;
586
+ content?: string | null;
587
+ memoryChunkIds?: Array<string> | null;
588
+ }
589
+ /**
590
+ * Status of update operation for each system
591
+ */
592
+ interface StatusObj {
593
+ neo4j?: boolean;
594
+ parse?: boolean;
595
+ pinecone?: boolean;
596
+ }
597
+ }
598
+ export interface MemoryDeleteResponse {
599
+ /**
600
+ * HTTP status code
601
+ */
602
+ code?: number;
603
+ deletion_status?: MemoryDeleteResponse.DeletionStatus | null;
604
+ details?: unknown;
605
+ error?: string | null;
606
+ memoryId?: string;
607
+ message?: string | null;
608
+ objectId?: string;
609
+ /**
610
+ * 'success' or 'error'
611
+ */
612
+ status?: string;
613
+ }
614
+ export declare namespace MemoryDeleteResponse {
615
+ interface DeletionStatus {
616
+ neo4j?: boolean;
617
+ parse?: boolean;
618
+ pinecone?: boolean;
619
+ }
620
+ }
621
+ export interface MemoryAddBatchResponse {
622
+ /**
623
+ * HTTP status code for the batch operation
624
+ */
625
+ code?: number;
626
+ /**
627
+ * Additional error details or context
628
+ */
629
+ details?: unknown;
630
+ /**
631
+ * Batch-level error message, if any
632
+ */
633
+ error?: string | null;
634
+ /**
635
+ * List of errors for failed items
636
+ */
637
+ errors?: Array<MemoryAddBatchResponse.Error>;
638
+ /**
639
+ * Human-readable status message
640
+ */
641
+ message?: string | null;
642
+ /**
643
+ * 'success', 'partial', or 'error'
644
+ */
645
+ status?: string;
646
+ /**
647
+ * List of successful add responses
648
+ */
649
+ successful?: Array<AddMemoryResponse>;
650
+ total_content_size?: number;
651
+ total_failed?: number;
652
+ total_processed?: number;
653
+ total_storage_size?: number;
654
+ total_successful?: number;
655
+ }
656
+ export declare namespace MemoryAddBatchResponse {
657
+ interface Error {
658
+ error: string;
659
+ index: number;
660
+ code?: number | null;
661
+ details?: unknown;
662
+ status?: string | null;
663
+ }
664
+ }
665
+ export interface MemoryUpdateParams {
666
+ /**
667
+ * The new content of the memory item
668
+ */
669
+ content?: string | null;
670
+ /**
671
+ * Updated context for the memory item
672
+ */
673
+ context?: Array<ContextItem> | null;
674
+ /**
675
+ * Metadata for memory request
676
+ */
677
+ metadata?: MemoryMetadata | null;
678
+ /**
679
+ * Updated relationships for Graph DB (neo4J)
680
+ */
681
+ relationships_json?: Array<RelationshipItem> | null;
682
+ /**
683
+ * Valid memory types
684
+ */
685
+ type?: MemoryType | null;
686
+ }
687
+ export interface MemoryDeleteParams {
688
+ /**
689
+ * Skip Parse Server deletion
690
+ */
691
+ skip_parse?: boolean;
692
+ }
693
+ export interface MemoryAddParams {
694
+ /**
695
+ * Body param: The content of the memory item you want to add to memory
696
+ */
697
+ content: string;
698
+ /**
699
+ * Query param: If True, skips adding background tasks for processing
700
+ */
701
+ skip_background_processing?: boolean;
702
+ /**
703
+ * Body param: Context can be conversation history or any relevant context for a
704
+ * memory item
705
+ */
706
+ context?: Array<ContextItem> | null;
707
+ /**
708
+ * Body param: Metadata for memory request
709
+ */
710
+ metadata?: MemoryMetadata | null;
711
+ /**
712
+ * Body param: Array of relationships that we can use in Graph DB (neo4J)
713
+ */
714
+ relationships_json?: Array<RelationshipItem> | null;
715
+ /**
716
+ * Body param: Content type of the memory item
717
+ */
718
+ type?: MemoryType;
719
+ }
720
+ export interface MemoryAddBatchParams {
721
+ /**
722
+ * Body param: List of memory items to add in batch
723
+ */
724
+ memories: Array<AddMemory>;
725
+ /**
726
+ * Query param: If True, skips adding background tasks for processing
727
+ */
728
+ skip_background_processing?: boolean;
729
+ /**
730
+ * Body param: Number of items to process in parallel
731
+ */
732
+ batch_size?: number | null;
733
+ }
734
+ export interface MemorySearchParams {
735
+ /**
736
+ * Body param: Detailed search query describing what you're looking for. For best
737
+ * results, write 2-3 sentences that include specific details, context, and time
738
+ * frame. For example: 'Find recurring customer complaints about API performance
739
+ * from the last month. Focus on issues where customers specifically mentioned
740
+ * timeout errors or slow response times in their conversations.'
741
+ */
742
+ query: string;
743
+ /**
744
+ * Query param: Maximum number of memories to return
745
+ */
746
+ max_memories?: number;
747
+ /**
748
+ * Query param: Maximum number of neo nodes to return
749
+ */
750
+ max_nodes?: number;
751
+ /**
752
+ * Body param: Whether to enable additional ranking of search results. Default is
753
+ * false because results are already ranked when using an LLM for search
754
+ * (recommended approach). Only enable this if you're not using an LLM in your
755
+ * search pipeline and need additional result ranking.
756
+ */
757
+ rank_results?: boolean;
758
+ /**
759
+ * Body param: Optional user ID to filter search results by a specific user. If not
760
+ * provided, results are not filtered by user.
761
+ */
762
+ user_id?: string | null;
763
+ /**
764
+ * Header param: Recommended to use 'gzip' for response compression
765
+ */
766
+ 'Accept-Encoding'?: string;
767
+ }
768
+ export declare namespace Memory {
769
+ export { type AddMemory as AddMemory, type AddMemoryResponse as AddMemoryResponse, type ContextItem as ContextItem, type MemoryMetadata as MemoryMetadata, type MemoryType as MemoryType, type RelationshipItem as RelationshipItem, type SearchResponse as SearchResponse, type MemoryUpdateResponse as MemoryUpdateResponse, type MemoryDeleteResponse as MemoryDeleteResponse, type MemoryAddBatchResponse as MemoryAddBatchResponse, type MemoryUpdateParams as MemoryUpdateParams, type MemoryDeleteParams as MemoryDeleteParams, type MemoryAddParams as MemoryAddParams, type MemoryAddBatchParams as MemoryAddBatchParams, type MemorySearchParams as MemorySearchParams, };
770
+ }
771
+ //# sourceMappingURL=memory.d.mts.map