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