@nebula-ai/sdk 1.2.2 → 1.3.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 (423) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/LICENSE +4 -23
  3. package/README.md +305 -126
  4. package/api-promise.d.mts +2 -0
  5. package/api-promise.d.mts.map +1 -0
  6. package/api-promise.d.ts +2 -0
  7. package/api-promise.d.ts.map +1 -0
  8. package/api-promise.js +6 -0
  9. package/api-promise.js.map +1 -0
  10. package/api-promise.mjs +2 -0
  11. package/api-promise.mjs.map +1 -0
  12. package/client.d.mts +205 -0
  13. package/client.d.mts.map +1 -0
  14. package/client.d.ts +205 -0
  15. package/client.d.ts.map +1 -0
  16. package/client.js +505 -0
  17. package/client.js.map +1 -0
  18. package/client.mjs +501 -0
  19. package/client.mjs.map +1 -0
  20. package/core/api-promise.d.mts +46 -0
  21. package/core/api-promise.d.mts.map +1 -0
  22. package/core/api-promise.d.ts +46 -0
  23. package/core/api-promise.d.ts.map +1 -0
  24. package/core/api-promise.js +74 -0
  25. package/core/api-promise.js.map +1 -0
  26. package/core/api-promise.mjs +70 -0
  27. package/core/api-promise.mjs.map +1 -0
  28. package/core/error.d.mts +46 -0
  29. package/core/error.d.mts.map +1 -0
  30. package/core/error.d.ts +46 -0
  31. package/core/error.d.ts.map +1 -0
  32. package/core/error.js +113 -0
  33. package/core/error.js.map +1 -0
  34. package/core/error.mjs +97 -0
  35. package/core/error.mjs.map +1 -0
  36. package/core/resource.d.mts +6 -0
  37. package/core/resource.d.mts.map +1 -0
  38. package/core/resource.d.ts +6 -0
  39. package/core/resource.d.ts.map +1 -0
  40. package/core/resource.js +11 -0
  41. package/core/resource.js.map +1 -0
  42. package/core/resource.mjs +7 -0
  43. package/core/resource.mjs.map +1 -0
  44. package/core/uploads.d.mts +3 -0
  45. package/core/uploads.d.mts.map +1 -0
  46. package/core/uploads.d.ts +3 -0
  47. package/core/uploads.d.ts.map +1 -0
  48. package/core/uploads.js +6 -0
  49. package/core/uploads.js.map +1 -0
  50. package/core/uploads.mjs +2 -0
  51. package/core/uploads.mjs.map +1 -0
  52. package/error.d.mts +2 -0
  53. package/error.d.mts.map +1 -0
  54. package/error.d.ts +2 -0
  55. package/error.d.ts.map +1 -0
  56. package/error.js +6 -0
  57. package/error.js.map +1 -0
  58. package/error.mjs +2 -0
  59. package/error.mjs.map +1 -0
  60. package/index.d.mts +13 -0
  61. package/index.d.mts.map +1 -0
  62. package/index.d.ts +13 -0
  63. package/index.d.ts.map +1 -0
  64. package/index.js +43 -0
  65. package/index.js.map +1 -0
  66. package/index.mjs +13 -0
  67. package/index.mjs.map +1 -0
  68. package/internal/builtin-types.d.mts +73 -0
  69. package/internal/builtin-types.d.mts.map +1 -0
  70. package/internal/builtin-types.d.ts +73 -0
  71. package/internal/builtin-types.d.ts.map +1 -0
  72. package/internal/builtin-types.js +4 -0
  73. package/internal/builtin-types.js.map +1 -0
  74. package/internal/builtin-types.mjs +3 -0
  75. package/internal/builtin-types.mjs.map +1 -0
  76. package/internal/detect-platform.d.mts +15 -0
  77. package/internal/detect-platform.d.mts.map +1 -0
  78. package/internal/detect-platform.d.ts +15 -0
  79. package/internal/detect-platform.d.ts.map +1 -0
  80. package/internal/detect-platform.js +162 -0
  81. package/internal/detect-platform.js.map +1 -0
  82. package/internal/detect-platform.mjs +157 -0
  83. package/internal/detect-platform.mjs.map +1 -0
  84. package/internal/errors.d.mts +3 -0
  85. package/internal/errors.d.mts.map +1 -0
  86. package/internal/errors.d.ts +3 -0
  87. package/internal/errors.d.ts.map +1 -0
  88. package/internal/errors.js +41 -0
  89. package/internal/errors.js.map +1 -0
  90. package/internal/errors.mjs +36 -0
  91. package/internal/errors.mjs.map +1 -0
  92. package/internal/headers.d.mts +20 -0
  93. package/internal/headers.d.mts.map +1 -0
  94. package/internal/headers.d.ts +20 -0
  95. package/internal/headers.d.ts.map +1 -0
  96. package/internal/headers.js +79 -0
  97. package/internal/headers.js.map +1 -0
  98. package/internal/headers.mjs +74 -0
  99. package/internal/headers.mjs.map +1 -0
  100. package/internal/parse.d.mts +12 -0
  101. package/internal/parse.d.mts.map +1 -0
  102. package/internal/parse.d.ts +12 -0
  103. package/internal/parse.d.ts.map +1 -0
  104. package/internal/parse.js +40 -0
  105. package/internal/parse.js.map +1 -0
  106. package/internal/parse.mjs +37 -0
  107. package/internal/parse.mjs.map +1 -0
  108. package/internal/qs/formats.d.mts +7 -0
  109. package/internal/qs/formats.d.mts.map +1 -0
  110. package/internal/qs/formats.d.ts +7 -0
  111. package/internal/qs/formats.d.ts.map +1 -0
  112. package/internal/qs/formats.js +13 -0
  113. package/internal/qs/formats.js.map +1 -0
  114. package/internal/qs/formats.mjs +9 -0
  115. package/internal/qs/formats.mjs.map +1 -0
  116. package/internal/qs/index.d.mts +10 -0
  117. package/internal/qs/index.d.mts.map +1 -0
  118. package/internal/qs/index.d.ts +10 -0
  119. package/internal/qs/index.d.ts.map +1 -0
  120. package/internal/qs/index.js +14 -0
  121. package/internal/qs/index.js.map +1 -0
  122. package/internal/qs/index.mjs +10 -0
  123. package/internal/qs/index.mjs.map +1 -0
  124. package/internal/qs/stringify.d.mts +3 -0
  125. package/internal/qs/stringify.d.mts.map +1 -0
  126. package/internal/qs/stringify.d.ts +3 -0
  127. package/internal/qs/stringify.d.ts.map +1 -0
  128. package/internal/qs/stringify.js +277 -0
  129. package/internal/qs/stringify.js.map +1 -0
  130. package/internal/qs/stringify.mjs +274 -0
  131. package/internal/qs/stringify.mjs.map +1 -0
  132. package/internal/qs/types.d.mts +57 -0
  133. package/internal/qs/types.d.mts.map +1 -0
  134. package/internal/qs/types.d.ts +57 -0
  135. package/internal/qs/types.d.ts.map +1 -0
  136. package/internal/qs/types.js +3 -0
  137. package/internal/qs/types.js.map +1 -0
  138. package/internal/qs/types.mjs +2 -0
  139. package/internal/qs/types.mjs.map +1 -0
  140. package/internal/qs/utils.d.mts +15 -0
  141. package/internal/qs/utils.d.mts.map +1 -0
  142. package/internal/qs/utils.d.ts +15 -0
  143. package/internal/qs/utils.d.ts.map +1 -0
  144. package/internal/qs/utils.js +230 -0
  145. package/internal/qs/utils.js.map +1 -0
  146. package/internal/qs/utils.mjs +217 -0
  147. package/internal/qs/utils.mjs.map +1 -0
  148. package/internal/request-options.d.mts +79 -0
  149. package/internal/request-options.d.mts.map +1 -0
  150. package/internal/request-options.d.ts +79 -0
  151. package/internal/request-options.d.ts.map +1 -0
  152. package/internal/request-options.js +14 -0
  153. package/internal/request-options.js.map +1 -0
  154. package/internal/request-options.mjs +10 -0
  155. package/internal/request-options.mjs.map +1 -0
  156. package/internal/shim-types.d.mts +17 -0
  157. package/internal/shim-types.d.mts.map +1 -0
  158. package/internal/shim-types.d.ts +17 -0
  159. package/internal/shim-types.d.ts.map +1 -0
  160. package/internal/shim-types.js +4 -0
  161. package/internal/shim-types.js.map +1 -0
  162. package/internal/shim-types.mjs +3 -0
  163. package/internal/shim-types.mjs.map +1 -0
  164. package/internal/shims.d.mts +20 -0
  165. package/internal/shims.d.mts.map +1 -0
  166. package/internal/shims.d.ts +20 -0
  167. package/internal/shims.d.ts.map +1 -0
  168. package/internal/shims.js +92 -0
  169. package/internal/shims.js.map +1 -0
  170. package/internal/shims.mjs +85 -0
  171. package/internal/shims.mjs.map +1 -0
  172. package/internal/to-file.d.mts +45 -0
  173. package/internal/to-file.d.mts.map +1 -0
  174. package/internal/to-file.d.ts +45 -0
  175. package/internal/to-file.d.ts.map +1 -0
  176. package/internal/to-file.js +91 -0
  177. package/internal/to-file.js.map +1 -0
  178. package/internal/to-file.mjs +88 -0
  179. package/internal/to-file.mjs.map +1 -0
  180. package/internal/tslib.js +81 -0
  181. package/internal/tslib.mjs +17 -0
  182. package/internal/types.d.mts +69 -0
  183. package/internal/types.d.mts.map +1 -0
  184. package/internal/types.d.ts +69 -0
  185. package/internal/types.d.ts.map +1 -0
  186. package/internal/types.js +4 -0
  187. package/internal/types.js.map +1 -0
  188. package/internal/types.mjs +3 -0
  189. package/internal/types.mjs.map +1 -0
  190. package/internal/uploads.d.mts +42 -0
  191. package/internal/uploads.d.mts.map +1 -0
  192. package/internal/uploads.d.ts +42 -0
  193. package/internal/uploads.d.ts.map +1 -0
  194. package/internal/uploads.js +141 -0
  195. package/internal/uploads.js.map +1 -0
  196. package/internal/uploads.mjs +131 -0
  197. package/internal/uploads.mjs.map +1 -0
  198. package/internal/utils/base64.d.mts +3 -0
  199. package/internal/utils/base64.d.mts.map +1 -0
  200. package/internal/utils/base64.d.ts +3 -0
  201. package/internal/utils/base64.d.ts.map +1 -0
  202. package/internal/utils/base64.js +38 -0
  203. package/internal/utils/base64.js.map +1 -0
  204. package/internal/utils/base64.mjs +33 -0
  205. package/internal/utils/base64.mjs.map +1 -0
  206. package/internal/utils/bytes.d.mts +4 -0
  207. package/internal/utils/bytes.d.mts.map +1 -0
  208. package/internal/utils/bytes.d.ts +4 -0
  209. package/internal/utils/bytes.d.ts.map +1 -0
  210. package/internal/utils/bytes.js +31 -0
  211. package/internal/utils/bytes.js.map +1 -0
  212. package/internal/utils/bytes.mjs +26 -0
  213. package/internal/utils/bytes.mjs.map +1 -0
  214. package/internal/utils/env.d.mts +9 -0
  215. package/internal/utils/env.d.mts.map +1 -0
  216. package/internal/utils/env.d.ts +9 -0
  217. package/internal/utils/env.d.ts.map +1 -0
  218. package/internal/utils/env.js +22 -0
  219. package/internal/utils/env.js.map +1 -0
  220. package/internal/utils/env.mjs +18 -0
  221. package/internal/utils/env.mjs.map +1 -0
  222. package/internal/utils/log.d.mts +37 -0
  223. package/internal/utils/log.d.mts.map +1 -0
  224. package/internal/utils/log.d.ts +37 -0
  225. package/internal/utils/log.d.ts.map +1 -0
  226. package/internal/utils/log.js +86 -0
  227. package/internal/utils/log.js.map +1 -0
  228. package/internal/utils/log.mjs +80 -0
  229. package/internal/utils/log.mjs.map +1 -0
  230. package/internal/utils/path.d.mts +15 -0
  231. package/internal/utils/path.d.mts.map +1 -0
  232. package/internal/utils/path.d.ts +15 -0
  233. package/internal/utils/path.d.ts.map +1 -0
  234. package/internal/utils/path.js +79 -0
  235. package/internal/utils/path.js.map +1 -0
  236. package/internal/utils/path.mjs +74 -0
  237. package/internal/utils/path.mjs.map +1 -0
  238. package/internal/utils/query.d.mts +2 -0
  239. package/internal/utils/query.d.mts.map +1 -0
  240. package/internal/utils/query.d.ts +2 -0
  241. package/internal/utils/query.d.ts.map +1 -0
  242. package/internal/utils/query.js +10 -0
  243. package/internal/utils/query.js.map +1 -0
  244. package/internal/utils/query.mjs +6 -0
  245. package/internal/utils/query.mjs.map +1 -0
  246. package/internal/utils/sleep.d.mts +2 -0
  247. package/internal/utils/sleep.d.mts.map +1 -0
  248. package/internal/utils/sleep.d.ts +2 -0
  249. package/internal/utils/sleep.d.ts.map +1 -0
  250. package/internal/utils/sleep.js +7 -0
  251. package/internal/utils/sleep.js.map +1 -0
  252. package/internal/utils/sleep.mjs +3 -0
  253. package/internal/utils/sleep.mjs.map +1 -0
  254. package/internal/utils/uuid.d.mts +5 -0
  255. package/internal/utils/uuid.d.mts.map +1 -0
  256. package/internal/utils/uuid.d.ts +5 -0
  257. package/internal/utils/uuid.d.ts.map +1 -0
  258. package/internal/utils/uuid.js +19 -0
  259. package/internal/utils/uuid.js.map +1 -0
  260. package/internal/utils/uuid.mjs +15 -0
  261. package/internal/utils/uuid.mjs.map +1 -0
  262. package/internal/utils/values.d.mts +18 -0
  263. package/internal/utils/values.d.mts.map +1 -0
  264. package/internal/utils/values.d.ts +18 -0
  265. package/internal/utils/values.d.ts.map +1 -0
  266. package/internal/utils/values.js +112 -0
  267. package/internal/utils/values.js.map +1 -0
  268. package/internal/utils/values.mjs +94 -0
  269. package/internal/utils/values.mjs.map +1 -0
  270. package/internal/utils.d.mts +8 -0
  271. package/internal/utils.d.mts.map +1 -0
  272. package/internal/utils.d.ts +8 -0
  273. package/internal/utils.d.ts.map +1 -0
  274. package/internal/utils.js +12 -0
  275. package/internal/utils.js.map +1 -0
  276. package/internal/utils.mjs +9 -0
  277. package/internal/utils.mjs.map +1 -0
  278. package/lib/dx.d.mts +96 -0
  279. package/lib/dx.d.mts.map +1 -0
  280. package/lib/dx.d.ts +96 -0
  281. package/lib/dx.d.ts.map +1 -0
  282. package/lib/dx.js +239 -0
  283. package/lib/dx.js.map +1 -0
  284. package/lib/dx.mjs +235 -0
  285. package/lib/dx.mjs.map +1 -0
  286. package/package.json +144 -58
  287. package/resource.d.mts +2 -0
  288. package/resource.d.mts.map +1 -0
  289. package/resource.d.ts +2 -0
  290. package/resource.d.ts.map +1 -0
  291. package/resource.js +6 -0
  292. package/resource.js.map +1 -0
  293. package/resource.mjs +2 -0
  294. package/resource.mjs.map +1 -0
  295. package/resources/collections.d.mts +289 -0
  296. package/resources/collections.d.mts.map +1 -0
  297. package/resources/collections.d.ts +289 -0
  298. package/resources/collections.d.ts.map +1 -0
  299. package/resources/collections.js +72 -0
  300. package/resources/collections.js.map +1 -0
  301. package/resources/collections.mjs +68 -0
  302. package/resources/collections.mjs.map +1 -0
  303. package/resources/connectors.d.mts +148 -0
  304. package/resources/connectors.d.mts.map +1 -0
  305. package/resources/connectors.d.ts +148 -0
  306. package/resources/connectors.d.ts.map +1 -0
  307. package/resources/connectors.js +50 -0
  308. package/resources/connectors.js.map +1 -0
  309. package/resources/connectors.mjs +46 -0
  310. package/resources/connectors.mjs.map +1 -0
  311. package/resources/index.d.mts +6 -0
  312. package/resources/index.d.mts.map +1 -0
  313. package/resources/index.d.ts +6 -0
  314. package/resources/index.d.ts.map +1 -0
  315. package/resources/index.js +13 -0
  316. package/resources/index.js.map +1 -0
  317. package/resources/index.mjs +6 -0
  318. package/resources/index.mjs.map +1 -0
  319. package/resources/memories.d.mts +1737 -0
  320. package/resources/memories.d.mts.map +1 -0
  321. package/resources/memories.d.ts +1737 -0
  322. package/resources/memories.d.ts.map +1 -0
  323. package/resources/memories.js +157 -0
  324. package/resources/memories.js.map +1 -0
  325. package/resources/memories.mjs +153 -0
  326. package/resources/memories.mjs.map +1 -0
  327. package/resources/snapshots.d.mts +281 -0
  328. package/resources/snapshots.d.mts.map +1 -0
  329. package/resources/snapshots.d.ts +281 -0
  330. package/resources/snapshots.d.ts.map +1 -0
  331. package/resources/snapshots.js +22 -0
  332. package/resources/snapshots.js.map +1 -0
  333. package/resources/snapshots.mjs +18 -0
  334. package/resources/snapshots.mjs.map +1 -0
  335. package/resources/top-level.d.mts +14 -0
  336. package/resources/top-level.d.mts.map +1 -0
  337. package/resources/top-level.d.ts +14 -0
  338. package/resources/top-level.d.ts.map +1 -0
  339. package/resources/top-level.js +4 -0
  340. package/resources/top-level.js.map +1 -0
  341. package/resources/top-level.mjs +3 -0
  342. package/resources/top-level.mjs.map +1 -0
  343. package/resources.d.mts +2 -0
  344. package/resources.d.mts.map +1 -0
  345. package/resources.d.ts +2 -0
  346. package/resources.d.ts.map +1 -0
  347. package/resources.js +5 -0
  348. package/resources.js.map +1 -0
  349. package/resources.mjs +2 -0
  350. package/resources.mjs.map +1 -0
  351. package/src/api-promise.ts +2 -0
  352. package/src/client.ts +892 -0
  353. package/src/core/README.md +3 -0
  354. package/src/core/api-promise.ts +92 -0
  355. package/src/core/error.ts +130 -0
  356. package/src/core/resource.ts +11 -0
  357. package/src/core/uploads.ts +2 -0
  358. package/src/error.ts +2 -0
  359. package/src/index.ts +36 -0
  360. package/src/internal/README.md +3 -0
  361. package/src/internal/builtin-types.ts +93 -0
  362. package/src/internal/detect-platform.ts +196 -0
  363. package/src/internal/errors.ts +33 -0
  364. package/src/internal/headers.ts +97 -0
  365. package/src/internal/parse.ts +56 -0
  366. package/src/internal/qs/LICENSE.md +13 -0
  367. package/src/internal/qs/README.md +3 -0
  368. package/src/internal/qs/formats.ts +10 -0
  369. package/src/internal/qs/index.ts +13 -0
  370. package/src/internal/qs/stringify.ts +385 -0
  371. package/src/internal/qs/types.ts +71 -0
  372. package/src/internal/qs/utils.ts +265 -0
  373. package/src/internal/request-options.ts +93 -0
  374. package/src/internal/shim-types.ts +26 -0
  375. package/src/internal/shims.ts +107 -0
  376. package/src/internal/to-file.ts +154 -0
  377. package/src/internal/types.ts +95 -0
  378. package/src/internal/uploads.ts +187 -0
  379. package/src/internal/utils/base64.ts +40 -0
  380. package/src/internal/utils/bytes.ts +32 -0
  381. package/src/internal/utils/env.ts +18 -0
  382. package/src/internal/utils/log.ts +127 -0
  383. package/src/internal/utils/path.ts +88 -0
  384. package/src/internal/utils/query.ts +7 -0
  385. package/src/internal/utils/sleep.ts +3 -0
  386. package/src/internal/utils/uuid.ts +17 -0
  387. package/src/internal/utils/values.ts +105 -0
  388. package/src/internal/utils.ts +9 -0
  389. package/src/lib/.keep +4 -0
  390. package/src/lib/dx.ts +459 -0
  391. package/src/resource.ts +2 -0
  392. package/src/resources/collections.ts +474 -0
  393. package/src/resources/connectors.ts +236 -0
  394. package/src/resources/index.ts +56 -0
  395. package/src/resources/memories.ts +2409 -0
  396. package/src/resources/snapshots.ts +387 -0
  397. package/src/resources/top-level.ts +19 -0
  398. package/src/resources.ts +1 -0
  399. package/src/tsconfig.json +11 -0
  400. package/src/uploads.ts +2 -0
  401. package/src/version.ts +1 -0
  402. package/uploads.d.mts +2 -0
  403. package/uploads.d.mts.map +1 -0
  404. package/uploads.d.ts +2 -0
  405. package/uploads.d.ts.map +1 -0
  406. package/uploads.js +6 -0
  407. package/uploads.js.map +1 -0
  408. package/uploads.mjs +2 -0
  409. package/uploads.mjs.map +1 -0
  410. package/version.d.mts +2 -0
  411. package/version.d.mts.map +1 -0
  412. package/version.d.ts +2 -0
  413. package/version.d.ts.map +1 -0
  414. package/version.js +5 -0
  415. package/version.js.map +1 -0
  416. package/version.mjs +2 -0
  417. package/version.mjs.map +1 -0
  418. package/dist/index.d.mts +0 -599
  419. package/dist/index.d.ts +0 -599
  420. package/dist/index.js +0 -1345
  421. package/dist/index.js.map +0 -1
  422. package/dist/index.mjs +0 -1330
  423. package/dist/index.mjs.map +0 -1
@@ -0,0 +1,2409 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../core/resource';
4
+ import { APIPromise } from '../core/api-promise';
5
+ import { RequestOptions } from '../internal/request-options';
6
+ import { path } from '../internal/utils/path';
7
+
8
+ export class Memories extends APIResource {
9
+ /**
10
+ * Create a new memory (conversation or document) using clean JSON body.
11
+ *
12
+ * - Use `collection_id` (UUID)
13
+ * - `engram_type` is optional and inferred from payload shape:
14
+ * - If `messages` present -> conversation
15
+ * - Otherwise -> document
16
+ * - For conversations: provide `messages` array
17
+ * - For documents: provide `raw_text` or `chunks`
18
+ * - Use `snapshot` for device-memory mode (mutually exclusive with collection_id)
19
+ */
20
+ create(body: MemoryCreateParams, options?: RequestOptions): APIPromise<MemoryCreateResponse> {
21
+ return this._client.post('/v1/memories', { body, ...options });
22
+ }
23
+
24
+ /**
25
+ * Retrieves detailed information about a specific engram by its ID.
26
+ *
27
+ * This endpoint returns the engram's metadata, status, and system information. It
28
+ * does not return the engram's content - use the `/engrams/{id}/download` endpoint
29
+ * for that.
30
+ *
31
+ * Users can only retrieve engrams they own or have access to through collections.
32
+ * Superusers can retrieve any engram.
33
+ */
34
+ retrieve(id: string, options?: RequestOptions): APIPromise<MemoryRetrieveResponse> {
35
+ return this._client.get(path`/v1/memories/${id}`, options);
36
+ }
37
+
38
+ /**
39
+ * Update memory-level properties including name, metadata, and collection
40
+ * associations.
41
+ *
42
+ * This endpoint allows updating properties of an entire memory (document or
43
+ * conversation) without modifying its content:
44
+ *
45
+ * - **name**: Updates the authoritative engram title
46
+ * - **metadata**: Can replace or merge with existing metadata
47
+ * - **collection_ids**: Updates authoritative engram collection associations
48
+ *
49
+ * Users can only update memories they own or have access to through collections.
50
+ * At least one collection association must be maintained.
51
+ *
52
+ * If collection_id is provided and the engram is shared across collections, a
53
+ * copy-on-write will be performed to create a collection-specific copy before
54
+ * modification.
55
+ */
56
+ update(id: string, params: MemoryUpdateParams, options?: RequestOptions): APIPromise<MemoryUpdateResponse> {
57
+ const { collection_id, ...body } = params;
58
+ return this._client.patch(path`/v1/memories/${id}`, { query: { collection_id }, body, ...options });
59
+ }
60
+
61
+ /**
62
+ * Returns a paginated list of engrams the authenticated user has access to.
63
+ *
64
+ * Results can be filtered by providing specific engram IDs or collection IDs.
65
+ * Regular users will only see engrams they own or have access to through
66
+ * collections. Superusers can see all engrams.
67
+ *
68
+ * The engrams are returned in order of last modification, with most recent first.
69
+ * The response includes the engram's text field if available.
70
+ */
71
+ list(
72
+ query: MemoryListParams | null | undefined = {},
73
+ options?: RequestOptions,
74
+ ): APIPromise<MemoryListResponse> {
75
+ return this._client.get('/v1/memories', { query, ...options });
76
+ }
77
+
78
+ /**
79
+ * Delete a specific engram with graph awareness. All chunks corresponding to the
80
+ * engram are deleted, and graph components (entities/relationships) are updated or
81
+ * deleted based on remaining chunk references from other engrams.
82
+ *
83
+ * This method now properly handles graph components and maintains graph integrity
84
+ * for search operations.
85
+ */
86
+ delete(id: string, options?: RequestOptions): APIPromise<MemoryDeleteResponse> {
87
+ return this._client.delete(path`/v1/memories/${id}`, options);
88
+ }
89
+
90
+ /**
91
+ * Append content to an existing engram.
92
+ *
93
+ * **For conversation engrams:**
94
+ *
95
+ * - Provide `messages` array with content, role, and optional metadata
96
+ * - Works like `/conversations/{id}/messages` endpoint
97
+ *
98
+ * **For document engrams:**
99
+ *
100
+ * - Provide either `raw_text` or `chunks` to append additional content
101
+ * - Content will be processed and added to the engram
102
+ */
103
+ append(id: string, body: MemoryAppendParams, options?: RequestOptions): APIPromise<MemoryAppendResponse> {
104
+ return this._client.post(path`/v1/memories/${id}/append`, { body, ...options });
105
+ }
106
+
107
+ /**
108
+ * Get a presigned URL for uploading large files directly to S3.
109
+ *
110
+ * Use this for files larger than 5MB that cannot be sent inline as base64. After
111
+ * uploading, reference the file in memory creation using S3FileReference.
112
+ *
113
+ * Args: filename: Original filename (e.g., "image.jpg") content_type: MIME type
114
+ * (e.g., "image/jpeg", "application/pdf") file_size: Expected file size in bytes
115
+ * (max 100MB)
116
+ *
117
+ * Returns: dict with: - upload_url: Presigned URL for PUT request (expires in 1
118
+ * hour) - upload_headers: Headers that must be sent with the presigned PUT
119
+ * request - s3_key: The S3 key to reference in memory creation - bucket: S3 bucket
120
+ * name - expires_in: Seconds until URL expires - max_size: Maximum allowed file
121
+ * size
122
+ */
123
+ createUpload(
124
+ params: MemoryCreateUploadParams,
125
+ options?: RequestOptions,
126
+ ): APIPromise<MemoryCreateUploadResponse> {
127
+ const { content_type, file_size, filename } = params;
128
+ return this._client.post('/v1/memories/upload', {
129
+ query: { content_type, file_size, filename },
130
+ ...options,
131
+ });
132
+ }
133
+
134
+ /**
135
+ * Delete one or more engrams.
136
+ *
137
+ * This endpoint efficiently handles both single and batch deletions. When multiple
138
+ * IDs are provided, it uses optimized batch operations.
139
+ *
140
+ * Args: ids: Either a single UUID or a list of UUIDs to delete
141
+ *
142
+ * Returns: For single deletion: boolean success response For batch deletion:
143
+ * detailed results with successful and failed deletions
144
+ */
145
+ deleteMany(params: MemoryDeleteManyParams, options?: RequestOptions): APIPromise<MemoryDeleteManyResponse> {
146
+ const { body } = params;
147
+ return this._client.post('/v1/memories/delete', { body: body, ...options });
148
+ }
149
+
150
+ /**
151
+ * Delete a file from S3 that was uploaded via a presigned URL. Verifies the caller
152
+ * owns the file via S3 object metadata.
153
+ */
154
+ deleteUpload(
155
+ params: MemoryDeleteUploadParams,
156
+ options?: RequestOptions,
157
+ ): APIPromise<MemoryDeleteUploadResponse> {
158
+ const { s3_key } = params;
159
+ return this._client.delete('/v1/memories/upload', { query: { s3_key }, ...options });
160
+ }
161
+
162
+ /**
163
+ * Perform a search query across your memories.
164
+ *
165
+ * **Standard mode** (collection_ids or readable-scope search): returns
166
+ * hierarchical MemoryRecall with semantics, episodes, procedures, and sources.
167
+ *
168
+ * **Snapshot mode** (snapshot field): returns graph-search results with {entities,
169
+ * relationships} from stateless in-memory traversal.
170
+ */
171
+ search(body: MemorySearchParams, options?: RequestOptions): APIPromise<MemorySearchResponse> {
172
+ return this._client.post('/v1/memories/search', { body, ...options });
173
+ }
174
+ }
175
+
176
+ /**
177
+ * Create-memory success response. Standard memory ingestion returns an accepted
178
+ * async-ingestion envelope; snapshot mode returns the updated snapshot
179
+ * synchronously.
180
+ */
181
+ export type MemoryCreateResponse =
182
+ | MemoryCreateResponse.NebulaResultsMemoryCreateAcceptedResponse
183
+ | MemoryCreateResponse.NebulaResultsSnapshotMutationResult;
184
+
185
+ export namespace MemoryCreateResponse {
186
+ export interface NebulaResultsMemoryCreateAcceptedResponse {
187
+ /**
188
+ * Accepted-response envelope for async memory ingestion.
189
+ */
190
+ results: NebulaResultsMemoryCreateAcceptedResponse.Results;
191
+ }
192
+
193
+ export namespace NebulaResultsMemoryCreateAcceptedResponse {
194
+ /**
195
+ * Accepted-response envelope for async memory ingestion.
196
+ */
197
+ export interface Results {
198
+ id: string;
199
+
200
+ message: string;
201
+
202
+ engram_id?: string | null;
203
+
204
+ memory_id?: string | null;
205
+
206
+ status?: 'parsing' | 'processing' | 'queued' | null;
207
+
208
+ task_id?: string | null;
209
+ }
210
+ }
211
+
212
+ export interface NebulaResultsSnapshotMutationResult {
213
+ /**
214
+ * Updated snapshot returned by snapshot-mode memory writes.
215
+ */
216
+ results: NebulaResultsSnapshotMutationResult.Results;
217
+ }
218
+
219
+ export namespace NebulaResultsSnapshotMutationResult {
220
+ /**
221
+ * Updated snapshot returned by snapshot-mode memory writes.
222
+ */
223
+ export interface Results {
224
+ /**
225
+ * Portable full snapshot owned by the client.
226
+ */
227
+ snapshot: Results.Snapshot;
228
+ }
229
+
230
+ export namespace Results {
231
+ /**
232
+ * Portable full snapshot owned by the client.
233
+ */
234
+ export interface Snapshot {
235
+ collection_id: string;
236
+
237
+ root_hash: string;
238
+
239
+ created_at?: string;
240
+
241
+ format_version?: number;
242
+
243
+ generation?: number;
244
+
245
+ /**
246
+ * A complete graph payload or a context subgraph payload.
247
+ */
248
+ graph?: Snapshot.Graph;
249
+ }
250
+
251
+ export namespace Snapshot {
252
+ /**
253
+ * A complete graph payload or a context subgraph payload.
254
+ */
255
+ export interface Graph {
256
+ entities?: Array<Graph.Entity>;
257
+
258
+ /**
259
+ * A positionally-aligned masked embedding matrix.
260
+ */
261
+ entity_description_embeddings?: Graph.EntityDescriptionEmbeddings;
262
+
263
+ /**
264
+ * A positionally-aligned masked embedding matrix.
265
+ */
266
+ relationship_description_embeddings?: Graph.RelationshipDescriptionEmbeddings;
267
+
268
+ /**
269
+ * A positionally-aligned masked embedding matrix.
270
+ */
271
+ relationship_relation_embeddings?: Graph.RelationshipRelationEmbeddings;
272
+
273
+ relationships?: Array<Graph.Relationship>;
274
+ }
275
+
276
+ export namespace Graph {
277
+ /**
278
+ * Canonical entity record used in snapshots, WAL ops, and segments.
279
+ */
280
+ export interface Entity {
281
+ id: string;
282
+
283
+ created_at: string;
284
+
285
+ engram_id: string;
286
+
287
+ name: string;
288
+
289
+ updated_at: string;
290
+
291
+ category?: string | null;
292
+
293
+ chunk_ids?: Array<string>;
294
+
295
+ collection_id?: string;
296
+
297
+ description?: string | null;
298
+
299
+ fts_terms?: { [key: string]: number } | null;
300
+
301
+ metadata?: { [key: string]: unknown };
302
+
303
+ relationship_count?: number;
304
+ }
305
+
306
+ /**
307
+ * A positionally-aligned masked embedding matrix.
308
+ */
309
+ export interface EntityDescriptionEmbeddings {
310
+ dim?: number;
311
+
312
+ encoding?: 'npy-base64';
313
+
314
+ mask_b64?: string;
315
+
316
+ values_b64?: string;
317
+ }
318
+
319
+ /**
320
+ * A positionally-aligned masked embedding matrix.
321
+ */
322
+ export interface RelationshipDescriptionEmbeddings {
323
+ dim?: number;
324
+
325
+ encoding?: 'npy-base64';
326
+
327
+ mask_b64?: string;
328
+
329
+ values_b64?: string;
330
+ }
331
+
332
+ /**
333
+ * A positionally-aligned masked embedding matrix.
334
+ */
335
+ export interface RelationshipRelationEmbeddings {
336
+ dim?: number;
337
+
338
+ encoding?: 'npy-base64';
339
+
340
+ mask_b64?: string;
341
+
342
+ values_b64?: string;
343
+ }
344
+
345
+ /**
346
+ * Canonical relationship record used in snapshots, WAL ops, and segments.
347
+ */
348
+ export interface Relationship {
349
+ id: string;
350
+
351
+ created_at: string;
352
+
353
+ object_id: string;
354
+
355
+ subject_id: string;
356
+
357
+ updated_at: string;
358
+
359
+ category?: string | null;
360
+
361
+ chunk_ids?: Array<string>;
362
+
363
+ collection_id?: string;
364
+
365
+ description?: string | null;
366
+
367
+ engram_id?: string | null;
368
+
369
+ inference_metadata?: { [key: string]: unknown } | null;
370
+
371
+ metadata?: { [key: string]: unknown };
372
+
373
+ object?: string | null;
374
+
375
+ predicate?: string;
376
+
377
+ relationship_type?: string | null;
378
+
379
+ subject?: string | null;
380
+
381
+ temporal_precision?: string | null;
382
+
383
+ valid_span?: { [key: string]: unknown } | null;
384
+
385
+ weight?: number | null;
386
+ }
387
+ }
388
+ }
389
+ }
390
+ }
391
+ }
392
+
393
+ export interface MemoryRetrieveResponse {
394
+ /**
395
+ * Base class for engram information handling.
396
+ */
397
+ results: MemoryRetrieveResponse.Results;
398
+ }
399
+
400
+ export namespace MemoryRetrieveResponse {
401
+ /**
402
+ * Base class for engram information handling.
403
+ */
404
+ export interface Results {
405
+ id: string;
406
+
407
+ collection_ids: Array<string>;
408
+
409
+ /**
410
+ * Types of file formats that can be stored as engrams.
411
+ */
412
+ document_type:
413
+ | 'mp3'
414
+ | 'csv'
415
+ | 'eml'
416
+ | 'msg'
417
+ | 'p7s'
418
+ | 'epub'
419
+ | 'xls'
420
+ | 'xlsx'
421
+ | 'html'
422
+ | 'htm'
423
+ | 'bmp'
424
+ | 'heic'
425
+ | 'jpeg'
426
+ | 'png'
427
+ | 'tiff'
428
+ | 'jpg'
429
+ | 'svg'
430
+ | 'md'
431
+ | 'org'
432
+ | 'odt'
433
+ | 'pdf'
434
+ | 'txt'
435
+ | 'json'
436
+ | 'ppt'
437
+ | 'pptx'
438
+ | 'rst'
439
+ | 'rtf'
440
+ | 'tsv'
441
+ | 'gif'
442
+ | 'doc'
443
+ | 'docx'
444
+ | 'py'
445
+ | 'js'
446
+ | 'ts'
447
+ | 'css';
448
+
449
+ /**
450
+ * Types of engrams - broader categories that include documents and conversations.
451
+ */
452
+ engram_type: 'document' | 'conversation';
453
+
454
+ metadata: { [key: string]: unknown };
455
+
456
+ owner_id: string;
457
+
458
+ chunks?: Array<unknown> | null;
459
+
460
+ created_at?: string | null;
461
+
462
+ /**
463
+ * Status of graph creation per document.
464
+ */
465
+ extraction_status?: 'pending' | 'processing' | 'success' | 'failed';
466
+
467
+ ingestion_attempt_number?: number | null;
468
+
469
+ /**
470
+ * Status of document processing.
471
+ */
472
+ ingestion_status?:
473
+ | 'pending'
474
+ | 'parsing'
475
+ | 'extracting'
476
+ | 'chunking'
477
+ | 'embedding'
478
+ | 'augmenting'
479
+ | 'storing'
480
+ | 'failed'
481
+ | 'success';
482
+
483
+ merkle_root?: string | null;
484
+
485
+ search_ready_seq?: number | null;
486
+
487
+ size_in_bytes?: number | null;
488
+
489
+ text?: string | null;
490
+
491
+ title?: string | null;
492
+
493
+ total_tokens?: number | null;
494
+
495
+ updated_at?: string | null;
496
+
497
+ version?: string | null;
498
+
499
+ workflow_run_id?: string | null;
500
+ }
501
+ }
502
+
503
+ export interface MemoryUpdateResponse {
504
+ /**
505
+ * Base class for engram information handling.
506
+ */
507
+ results: MemoryUpdateResponse.Results;
508
+ }
509
+
510
+ export namespace MemoryUpdateResponse {
511
+ /**
512
+ * Base class for engram information handling.
513
+ */
514
+ export interface Results {
515
+ id: string;
516
+
517
+ collection_ids: Array<string>;
518
+
519
+ /**
520
+ * Types of file formats that can be stored as engrams.
521
+ */
522
+ document_type:
523
+ | 'mp3'
524
+ | 'csv'
525
+ | 'eml'
526
+ | 'msg'
527
+ | 'p7s'
528
+ | 'epub'
529
+ | 'xls'
530
+ | 'xlsx'
531
+ | 'html'
532
+ | 'htm'
533
+ | 'bmp'
534
+ | 'heic'
535
+ | 'jpeg'
536
+ | 'png'
537
+ | 'tiff'
538
+ | 'jpg'
539
+ | 'svg'
540
+ | 'md'
541
+ | 'org'
542
+ | 'odt'
543
+ | 'pdf'
544
+ | 'txt'
545
+ | 'json'
546
+ | 'ppt'
547
+ | 'pptx'
548
+ | 'rst'
549
+ | 'rtf'
550
+ | 'tsv'
551
+ | 'gif'
552
+ | 'doc'
553
+ | 'docx'
554
+ | 'py'
555
+ | 'js'
556
+ | 'ts'
557
+ | 'css';
558
+
559
+ /**
560
+ * Types of engrams - broader categories that include documents and conversations.
561
+ */
562
+ engram_type: 'document' | 'conversation';
563
+
564
+ metadata: { [key: string]: unknown };
565
+
566
+ owner_id: string;
567
+
568
+ chunks?: Array<unknown> | null;
569
+
570
+ created_at?: string | null;
571
+
572
+ /**
573
+ * Status of graph creation per document.
574
+ */
575
+ extraction_status?: 'pending' | 'processing' | 'success' | 'failed';
576
+
577
+ ingestion_attempt_number?: number | null;
578
+
579
+ /**
580
+ * Status of document processing.
581
+ */
582
+ ingestion_status?:
583
+ | 'pending'
584
+ | 'parsing'
585
+ | 'extracting'
586
+ | 'chunking'
587
+ | 'embedding'
588
+ | 'augmenting'
589
+ | 'storing'
590
+ | 'failed'
591
+ | 'success';
592
+
593
+ merkle_root?: string | null;
594
+
595
+ search_ready_seq?: number | null;
596
+
597
+ size_in_bytes?: number | null;
598
+
599
+ text?: string | null;
600
+
601
+ title?: string | null;
602
+
603
+ total_tokens?: number | null;
604
+
605
+ updated_at?: string | null;
606
+
607
+ version?: string | null;
608
+
609
+ workflow_run_id?: string | null;
610
+ }
611
+ }
612
+
613
+ export interface MemoryListResponse {
614
+ results: Array<MemoryListResponse.Result>;
615
+
616
+ total_entries: number;
617
+ }
618
+
619
+ export namespace MemoryListResponse {
620
+ /**
621
+ * Base class for engram information handling.
622
+ */
623
+ export interface Result {
624
+ id: string;
625
+
626
+ collection_ids: Array<string>;
627
+
628
+ /**
629
+ * Types of file formats that can be stored as engrams.
630
+ */
631
+ document_type:
632
+ | 'mp3'
633
+ | 'csv'
634
+ | 'eml'
635
+ | 'msg'
636
+ | 'p7s'
637
+ | 'epub'
638
+ | 'xls'
639
+ | 'xlsx'
640
+ | 'html'
641
+ | 'htm'
642
+ | 'bmp'
643
+ | 'heic'
644
+ | 'jpeg'
645
+ | 'png'
646
+ | 'tiff'
647
+ | 'jpg'
648
+ | 'svg'
649
+ | 'md'
650
+ | 'org'
651
+ | 'odt'
652
+ | 'pdf'
653
+ | 'txt'
654
+ | 'json'
655
+ | 'ppt'
656
+ | 'pptx'
657
+ | 'rst'
658
+ | 'rtf'
659
+ | 'tsv'
660
+ | 'gif'
661
+ | 'doc'
662
+ | 'docx'
663
+ | 'py'
664
+ | 'js'
665
+ | 'ts'
666
+ | 'css';
667
+
668
+ /**
669
+ * Types of engrams - broader categories that include documents and conversations.
670
+ */
671
+ engram_type: 'document' | 'conversation';
672
+
673
+ metadata: { [key: string]: unknown };
674
+
675
+ owner_id: string;
676
+
677
+ chunks?: Array<unknown> | null;
678
+
679
+ created_at?: string | null;
680
+
681
+ /**
682
+ * Status of graph creation per document.
683
+ */
684
+ extraction_status?: 'pending' | 'processing' | 'success' | 'failed';
685
+
686
+ ingestion_attempt_number?: number | null;
687
+
688
+ /**
689
+ * Status of document processing.
690
+ */
691
+ ingestion_status?:
692
+ | 'pending'
693
+ | 'parsing'
694
+ | 'extracting'
695
+ | 'chunking'
696
+ | 'embedding'
697
+ | 'augmenting'
698
+ | 'storing'
699
+ | 'failed'
700
+ | 'success';
701
+
702
+ merkle_root?: string | null;
703
+
704
+ search_ready_seq?: number | null;
705
+
706
+ size_in_bytes?: number | null;
707
+
708
+ text?: string | null;
709
+
710
+ title?: string | null;
711
+
712
+ total_tokens?: number | null;
713
+
714
+ updated_at?: string | null;
715
+
716
+ version?: string | null;
717
+
718
+ workflow_run_id?: string | null;
719
+ }
720
+ }
721
+
722
+ export interface MemoryDeleteResponse {
723
+ results: MemoryDeleteResponse.Results;
724
+ }
725
+
726
+ export namespace MemoryDeleteResponse {
727
+ export interface Results {
728
+ success: boolean;
729
+ }
730
+ }
731
+
732
+ export type MemoryAppendResponse =
733
+ | MemoryAppendResponse.NebulaResultsAppendMemoryResponse
734
+ | MemoryAppendResponse.NebulaResultsIngestionResponse;
735
+
736
+ export namespace MemoryAppendResponse {
737
+ export interface NebulaResultsAppendMemoryResponse {
738
+ results: NebulaResultsAppendMemoryResponse.Results;
739
+ }
740
+
741
+ export namespace NebulaResultsAppendMemoryResponse {
742
+ export interface Results {
743
+ id: string;
744
+
745
+ message: Results.Message;
746
+
747
+ appended_messages?: Array<Results.AppendedMessage>;
748
+
749
+ metadata?: { [key: string]: unknown };
750
+ }
751
+
752
+ export namespace Results {
753
+ export interface Message {
754
+ role: 'system' | 'user' | 'assistant' | 'function' | 'tool' | (string & {});
755
+
756
+ content?: unknown;
757
+
758
+ function_call?: { [key: string]: unknown } | null;
759
+
760
+ image_data?: { [key: string]: string } | null;
761
+
762
+ image_url?: string | null;
763
+
764
+ metadata?: { [key: string]: unknown } | null;
765
+
766
+ name?: string | null;
767
+
768
+ structured_content?: Array<{ [key: string]: unknown }> | null;
769
+
770
+ tool_call_id?: string | null;
771
+
772
+ tool_calls?: Array<{ [key: string]: unknown }> | null;
773
+ }
774
+
775
+ export interface AppendedMessage {
776
+ message_id: string;
777
+
778
+ chunk_ids?: Array<string>;
779
+ }
780
+ }
781
+ }
782
+
783
+ export interface NebulaResultsIngestionResponse {
784
+ results: NebulaResultsIngestionResponse.Results;
785
+ }
786
+
787
+ export namespace NebulaResultsIngestionResponse {
788
+ export interface Results {
789
+ /**
790
+ * The ID of the engram that was ingested.
791
+ */
792
+ engram_id: string;
793
+
794
+ /**
795
+ * A message describing the result of the ingestion request.
796
+ */
797
+ message: string;
798
+
799
+ /**
800
+ * The task ID of the ingestion request.
801
+ */
802
+ task_id?: string | null;
803
+ }
804
+ }
805
+ }
806
+
807
+ export interface MemoryCreateUploadResponse {
808
+ results: MemoryCreateUploadResponse.Results;
809
+ }
810
+
811
+ export namespace MemoryCreateUploadResponse {
812
+ export interface Results {
813
+ bucket: string;
814
+
815
+ download_url: string;
816
+
817
+ expires_in: number;
818
+
819
+ max_size: number;
820
+
821
+ s3_key: string;
822
+
823
+ upload_headers: { [key: string]: string };
824
+
825
+ upload_url: string;
826
+ }
827
+ }
828
+
829
+ export type MemoryDeleteManyResponse =
830
+ | MemoryDeleteManyResponse.NebulaResultsGenericBooleanResponse
831
+ | MemoryDeleteManyResponse.BatchDeleteResponse;
832
+
833
+ export namespace MemoryDeleteManyResponse {
834
+ export interface NebulaResultsGenericBooleanResponse {
835
+ results: NebulaResultsGenericBooleanResponse.Results;
836
+ }
837
+
838
+ export namespace NebulaResultsGenericBooleanResponse {
839
+ export interface Results {
840
+ success: boolean;
841
+ }
842
+ }
843
+
844
+ export interface BatchDeleteResponse {
845
+ message: string;
846
+
847
+ results: BatchDeleteResponse.Results;
848
+ }
849
+
850
+ export namespace BatchDeleteResponse {
851
+ export interface Results {
852
+ failed: Array<{ [key: string]: unknown }>;
853
+
854
+ successful: Array<string>;
855
+
856
+ summary: { [key: string]: unknown };
857
+ }
858
+ }
859
+ }
860
+
861
+ export interface MemoryDeleteUploadResponse {
862
+ results: MemoryDeleteUploadResponse.Results;
863
+ }
864
+
865
+ export namespace MemoryDeleteUploadResponse {
866
+ export interface Results {
867
+ message: string;
868
+
869
+ id?: string | null;
870
+
871
+ memory_id?: string | null;
872
+ }
873
+ }
874
+
875
+ export type MemorySearchResponse =
876
+ | MemorySearchResponse.NebulaResultsCompactMemoryRecallResponse
877
+ | MemorySearchResponse.NebulaResultsMemoryRecall
878
+ | MemorySearchResponse.NebulaResultsSnapshotSearchResult;
879
+
880
+ export namespace MemorySearchResponse {
881
+ export interface NebulaResultsCompactMemoryRecallResponse {
882
+ /**
883
+ * Default compact response from /v1/memories/search.
884
+ */
885
+ results: NebulaResultsCompactMemoryRecallResponse.Results;
886
+ }
887
+
888
+ export namespace NebulaResultsCompactMemoryRecallResponse {
889
+ /**
890
+ * Default compact response from /v1/memories/search.
891
+ */
892
+ export interface Results {
893
+ query: string;
894
+
895
+ episodic?: Array<{ [key: string]: unknown }>;
896
+
897
+ procedural?: Array<{ [key: string]: unknown }>;
898
+
899
+ semantic?: Array<{ [key: string]: unknown }>;
900
+
901
+ sources?: Array<{ [key: string]: unknown }>;
902
+
903
+ token_count?: number;
904
+ }
905
+ }
906
+
907
+ export interface NebulaResultsMemoryRecall {
908
+ /**
909
+ * Hierarchical memory response - all layers, weighted by activation.
910
+ *
911
+ * This is the primary response type for conceptual memory retrieval. It contains
912
+ * all layers of the memory hierarchy:
913
+ *
914
+ * 1. **Entities (gestalt/schema layer)**: EntityProfiles that represent the
915
+ * conceptual understanding of activated entities.
916
+ *
917
+ * 2. **Semantics (semantic layer)**: Structured assertions (facts, inferences,
918
+ * tasks) scored by relevance and confidence.
919
+ *
920
+ * 3. **Episodes (temporal clusters)**: Episodic nodegroups that cluster temporally
921
+ * related facts and events.
922
+ *
923
+ * 4. **Sources (episodic layer)**: The raw source material that grounds the
924
+ * structured knowledge in actual moments/quotes.
925
+ */
926
+ results: NebulaResultsMemoryRecall.Results;
927
+ }
928
+
929
+ export namespace NebulaResultsMemoryRecall {
930
+ /**
931
+ * Hierarchical memory response - all layers, weighted by activation.
932
+ *
933
+ * This is the primary response type for conceptual memory retrieval. It contains
934
+ * all layers of the memory hierarchy:
935
+ *
936
+ * 1. **Entities (gestalt/schema layer)**: EntityProfiles that represent the
937
+ * conceptual understanding of activated entities.
938
+ *
939
+ * 2. **Semantics (semantic layer)**: Structured assertions (facts, inferences,
940
+ * tasks) scored by relevance and confidence.
941
+ *
942
+ * 3. **Episodes (temporal clusters)**: Episodic nodegroups that cluster temporally
943
+ * related facts and events.
944
+ *
945
+ * 4. **Sources (episodic layer)**: The raw source material that grounds the
946
+ * structured knowledge in actual moments/quotes.
947
+ */
948
+ export interface Results {
949
+ query: string;
950
+
951
+ entities?: Array<Results.Entity>;
952
+
953
+ episodic?: Array<Results.Episodic>;
954
+
955
+ inference_hints?: Array<Results.InferenceHint>;
956
+
957
+ procedural?: Array<Results.Procedural>;
958
+
959
+ semantic?: Array<Results.Semantic>;
960
+
961
+ sources?: Array<Results.Source>;
962
+
963
+ total_traversal_time_ms?: number | null;
964
+ }
965
+
966
+ export namespace Results {
967
+ /**
968
+ * An entity activated during memory traversal with its profile.
969
+ *
970
+ * Represents a conceptual node in memory that was activated by the query. Contains
971
+ * the full EntityProfile (gestalt) filtered by relevance.
972
+ */
973
+ export interface Entity {
974
+ id: string;
975
+
976
+ name: string;
977
+
978
+ activation_score?: number;
979
+
980
+ category?: string | null;
981
+
982
+ profile?: unknown;
983
+ }
984
+
985
+ /**
986
+ * An episodic nodegroup activated during memory traversal.
987
+ *
988
+ * Represents a cluster of temporally related facts/events discovered during graph
989
+ * traversal.
990
+ */
991
+ export interface Episodic {
992
+ id: string;
993
+
994
+ name: string;
995
+
996
+ activation_score?: number;
997
+
998
+ category?: string;
999
+
1000
+ description?: string | null;
1001
+
1002
+ entity_names?: Array<string>;
1003
+
1004
+ evidence_ids?: Array<string>;
1005
+
1006
+ member_semantic_ids?: Array<string>;
1007
+
1008
+ n_facts?: number;
1009
+
1010
+ status?: string | null;
1011
+
1012
+ t_last?: string | null;
1013
+
1014
+ t_start?: string | null;
1015
+ }
1016
+
1017
+ /**
1018
+ * A lightweight inference artifact returned alongside MemoryRecall.
1019
+ *
1020
+ * These are _not_ asserted facts. They are "evidence + weak hints" that may have
1021
+ * influenced retrieval (e.g. query expansion) or may be useful for UI
1022
+ * transparency.
1023
+ */
1024
+ export interface InferenceHint {
1025
+ object: string;
1026
+
1027
+ predicate: string;
1028
+
1029
+ term: string;
1030
+
1031
+ confidence?: number | null;
1032
+
1033
+ inference_metadata?: { [key: string]: unknown } | null;
1034
+
1035
+ inferred?: boolean;
1036
+
1037
+ ledger_p_stable?: number | null;
1038
+
1039
+ ledger_p_true?: number | null;
1040
+
1041
+ ledger_p_use?: number | null;
1042
+
1043
+ metadata?: { [key: string]: unknown } | null;
1044
+
1045
+ object_id?: string | null;
1046
+
1047
+ relationship_id?: string | null;
1048
+
1049
+ subject_id?: string | null;
1050
+
1051
+ usable_for_rewrite?: boolean;
1052
+
1053
+ used_for_rewrite?: boolean;
1054
+ }
1055
+
1056
+ /**
1057
+ * A procedure (user preference) activated during memory traversal.
1058
+ *
1059
+ * Procedures are prescriptive -- they describe what the user prefers, likes,
1060
+ * dislikes, or habitually does. Distinct from facts which are descriptive
1061
+ * assertions.
1062
+ */
1063
+ export interface Procedural {
1064
+ id: string;
1065
+
1066
+ statement: string;
1067
+
1068
+ activation_score?: number;
1069
+
1070
+ belief_kind?: string | null;
1071
+
1072
+ confidence?: number;
1073
+
1074
+ derivation_type?: string;
1075
+
1076
+ entity_id?: string | null;
1077
+
1078
+ entity_name?: string | null;
1079
+
1080
+ is_negated?: boolean;
1081
+
1082
+ metadata?: { [key: string]: unknown } | null;
1083
+ }
1084
+
1085
+ /**
1086
+ * A semantic item activated during memory traversal.
1087
+ *
1088
+ * Represents a structured assertion (fact, inference, or task) that was found
1089
+ * relevant to the query. Links back to its entity and source utterances for
1090
+ * provenance.
1091
+ */
1092
+ export interface Semantic {
1093
+ id: string;
1094
+
1095
+ predicate: string;
1096
+
1097
+ subject: string;
1098
+
1099
+ value: string;
1100
+
1101
+ activation_score?: number;
1102
+
1103
+ belief_kind?: string | null;
1104
+
1105
+ category?: string;
1106
+
1107
+ corroboration_count?: number;
1108
+
1109
+ description?: string | null;
1110
+
1111
+ entity_id?: string | null;
1112
+
1113
+ entity_name?: string | null;
1114
+
1115
+ evidence_ids?: Array<string>;
1116
+
1117
+ evidence_refs?: Array<Semantic.EvidenceRef>;
1118
+
1119
+ extraction_confidence?: number;
1120
+
1121
+ is_current?: boolean | null;
1122
+
1123
+ reasoning?: string | null;
1124
+
1125
+ resolved_at?: string | null;
1126
+
1127
+ source_nodegroup_ids?: Array<string>;
1128
+
1129
+ stability_confidence?: number | null;
1130
+
1131
+ temporal_precision?: string | null;
1132
+
1133
+ temporal_validity?: unknown;
1134
+
1135
+ truth_confidence?: number | null;
1136
+
1137
+ use_confidence?: number | null;
1138
+ }
1139
+
1140
+ export namespace Semantic {
1141
+ /**
1142
+ * Tagged reference to a source of evidence.
1143
+ */
1144
+ export interface EvidenceRef {
1145
+ ref_type: 'chunk' | 'table_artifact';
1146
+
1147
+ artifact_id?: string | null;
1148
+
1149
+ chunk_id?: string | null;
1150
+
1151
+ collection_id?: string | null;
1152
+
1153
+ column_names?: Array<string> | null;
1154
+
1155
+ row_indices?: Array<number> | null;
1156
+
1157
+ table_name?: string | null;
1158
+ }
1159
+ }
1160
+
1161
+ /**
1162
+ * A source that grounds facts in episodic memory.
1163
+ *
1164
+ * This is the raw source material that supports the structured knowledge. Provides
1165
+ * the exact quotes and context for verification.
1166
+ *
1167
+ * `evidence_ref` carries typed provenance so the client can distinguish
1168
+ * chunk-backed sources from table-artifact-backed sources (or future modalities)
1169
+ * without parsing opaque metadata.
1170
+ */
1171
+ export interface Source {
1172
+ id: string;
1173
+
1174
+ text: string;
1175
+
1176
+ activation_score?: number;
1177
+
1178
+ display_name?: string | null;
1179
+
1180
+ engram_id?: string | null;
1181
+
1182
+ /**
1183
+ * Tagged reference to a source of evidence.
1184
+ */
1185
+ evidence_ref?: Source.EvidenceRef | null;
1186
+
1187
+ metadata?: { [key: string]: unknown } | null;
1188
+
1189
+ owner_id?: string | null;
1190
+
1191
+ page_number?: number | null;
1192
+
1193
+ section_path?: Array<string> | null;
1194
+
1195
+ source_role?: string | null;
1196
+
1197
+ speaker?: string | null;
1198
+
1199
+ speaker_id?: string | null;
1200
+
1201
+ structure_label?: string | null;
1202
+
1203
+ supporting_fact_ids?: Array<string>;
1204
+
1205
+ timestamp?: string | null;
1206
+ }
1207
+
1208
+ export namespace Source {
1209
+ /**
1210
+ * Tagged reference to a source of evidence.
1211
+ */
1212
+ export interface EvidenceRef {
1213
+ ref_type: 'chunk' | 'table_artifact';
1214
+
1215
+ artifact_id?: string | null;
1216
+
1217
+ chunk_id?: string | null;
1218
+
1219
+ collection_id?: string | null;
1220
+
1221
+ column_names?: Array<string> | null;
1222
+
1223
+ row_indices?: Array<number> | null;
1224
+
1225
+ table_name?: string | null;
1226
+ }
1227
+ }
1228
+ }
1229
+ }
1230
+
1231
+ export interface NebulaResultsSnapshotSearchResult {
1232
+ /**
1233
+ * Stateless snapshot-search response shape.
1234
+ */
1235
+ results: NebulaResultsSnapshotSearchResult.Results;
1236
+ }
1237
+
1238
+ export namespace NebulaResultsSnapshotSearchResult {
1239
+ /**
1240
+ * Stateless snapshot-search response shape.
1241
+ */
1242
+ export interface Results {
1243
+ entities?: Array<Results.Entity>;
1244
+
1245
+ relationships?: Array<Results.Relationship>;
1246
+ }
1247
+
1248
+ export namespace Results {
1249
+ export interface Entity {
1250
+ id: string;
1251
+
1252
+ name: string;
1253
+
1254
+ score: number;
1255
+
1256
+ category?: string | null;
1257
+
1258
+ description?: string | null;
1259
+ }
1260
+
1261
+ export interface Relationship {
1262
+ id: string;
1263
+
1264
+ object_id: string;
1265
+
1266
+ predicate: string;
1267
+
1268
+ subject_id: string;
1269
+
1270
+ description?: string | null;
1271
+
1272
+ weight?: number | null;
1273
+ }
1274
+ }
1275
+ }
1276
+ }
1277
+
1278
+ export interface MemoryCreateParams {
1279
+ /**
1280
+ * Pre-chunked text for document type
1281
+ */
1282
+ chunks?: Array<string> | null;
1283
+
1284
+ /**
1285
+ * Collection UUID (mutually exclusive with snapshot)
1286
+ */
1287
+ collection_id?: string | null;
1288
+
1289
+ /**
1290
+ * Multimodal content parts (text, images, audio, documents) for document type.
1291
+ */
1292
+ content_parts?: Array<
1293
+ | MemoryCreateParams.TextContentRequest
1294
+ | MemoryCreateParams.FileContentRequest
1295
+ | MemoryCreateParams.S3FileReferenceRequest
1296
+ > | null;
1297
+
1298
+ /**
1299
+ * Batch content strings for snapshot mode
1300
+ */
1301
+ contents?: Array<string> | null;
1302
+
1303
+ /**
1304
+ * Type of memory to create
1305
+ */
1306
+ engram_type?: 'document' | 'conversation';
1307
+
1308
+ /**
1309
+ * Public ingestion config accepted by memory-ingestion endpoints.
1310
+ *
1311
+ * This mirrors the supported request payload shape while staying independent from
1312
+ * the runtime provider config, which also carries internal-only fields such as
1313
+ * `app` and `extra_fields`.
1314
+ */
1315
+ ingestion_config?: MemoryCreateParams.IngestionConfig | null;
1316
+
1317
+ /**
1318
+ * Ingestion mode for documents
1319
+ */
1320
+ ingestion_mode?: 'hi-res' | 'ocr' | 'fast' | 'custom' | null;
1321
+
1322
+ /**
1323
+ * Messages for conversation type
1324
+ */
1325
+ messages?: Array<MemoryCreateParams.Message> | null;
1326
+
1327
+ /**
1328
+ * Metadata for the memory
1329
+ */
1330
+ metadata?: { [key: string]: unknown } | null;
1331
+
1332
+ /**
1333
+ * Optional name for the memory
1334
+ */
1335
+ name?: string | null;
1336
+
1337
+ /**
1338
+ * Raw text content for document type
1339
+ */
1340
+ raw_text?: string | null;
1341
+
1342
+ /**
1343
+ * Portable full snapshot owned by the client.
1344
+ */
1345
+ snapshot?: MemoryCreateParams.Snapshot | null;
1346
+
1347
+ /**
1348
+ * UUID of the SourceRole entity creating this memory
1349
+ */
1350
+ speaker_id?: string | null;
1351
+
1352
+ /**
1353
+ * Display name of the speaker/agent creating this memory
1354
+ */
1355
+ speaker_name?: string | null;
1356
+ }
1357
+
1358
+ export namespace MemoryCreateParams {
1359
+ /**
1360
+ * Text content block.
1361
+ */
1362
+ export interface TextContentRequest {
1363
+ /**
1364
+ * Text content
1365
+ */
1366
+ text: string;
1367
+
1368
+ type?: 'text';
1369
+ }
1370
+
1371
+ /**
1372
+ * Unified file content for multimodal messages.
1373
+ */
1374
+ export interface FileContentRequest {
1375
+ /**
1376
+ * Base64 encoded file data
1377
+ */
1378
+ data: string;
1379
+
1380
+ /**
1381
+ * Duration in seconds (for audio)
1382
+ */
1383
+ duration_seconds?: number | null;
1384
+
1385
+ /**
1386
+ * Original filename
1387
+ */
1388
+ filename?: string | null;
1389
+
1390
+ /**
1391
+ * MIME type
1392
+ */
1393
+ media_type?: string;
1394
+
1395
+ /**
1396
+ * Content kind: file, image, audio, or document.
1397
+ */
1398
+ type?: 'file' | 'image' | 'audio' | 'document';
1399
+ }
1400
+
1401
+ /**
1402
+ * Reference to a file uploaded to S3 (for large files).
1403
+ */
1404
+ export interface S3FileReferenceRequest {
1405
+ /**
1406
+ * S3 object key
1407
+ */
1408
+ s3_key: string;
1409
+
1410
+ /**
1411
+ * S3 bucket (uses default if not specified)
1412
+ */
1413
+ bucket?: string | null;
1414
+
1415
+ /**
1416
+ * Original filename
1417
+ */
1418
+ filename?: string | null;
1419
+
1420
+ /**
1421
+ * MIME type
1422
+ */
1423
+ media_type?: string;
1424
+
1425
+ /**
1426
+ * File size in bytes
1427
+ */
1428
+ size_bytes?: number | null;
1429
+
1430
+ type?: 's3_ref';
1431
+ }
1432
+
1433
+ /**
1434
+ * Public ingestion config accepted by memory-ingestion endpoints.
1435
+ *
1436
+ * This mirrors the supported request payload shape while staying independent from
1437
+ * the runtime provider config, which also carries internal-only fields such as
1438
+ * `app` and `extra_fields`.
1439
+ */
1440
+ export interface IngestionConfig {
1441
+ audio_transcription_model?: string | null;
1442
+
1443
+ automatic_extraction?: boolean;
1444
+
1445
+ /**
1446
+ * Settings for chunk enrichment.
1447
+ *
1448
+ * Model selection for the enrichment LLM call lives in
1449
+ * `app.task_llms.chunk_enrichment`; the legacy `generation_config` field was
1450
+ * removed in the per-task LLM cleanup pass.
1451
+ */
1452
+ chunk_enrichment_settings?: IngestionConfig.ChunkEnrichmentSettings;
1453
+
1454
+ chunk_overlap?: number;
1455
+
1456
+ chunk_size?: number;
1457
+
1458
+ chunking_strategy?: string;
1459
+
1460
+ excluded_parsers?: Array<string>;
1461
+
1462
+ extra_parsers?: { [key: string]: unknown };
1463
+
1464
+ max_concurrent_vlm_tasks?: number;
1465
+
1466
+ parser_overrides?: { [key: string]: string };
1467
+
1468
+ provider?: string;
1469
+
1470
+ vlm?: string | null;
1471
+
1472
+ vlm_batch_size?: number;
1473
+
1474
+ vlm_max_tokens_to_sample?: number;
1475
+
1476
+ vlm_ocr_one_page_per_chunk?: boolean;
1477
+ }
1478
+
1479
+ export namespace IngestionConfig {
1480
+ /**
1481
+ * Settings for chunk enrichment.
1482
+ *
1483
+ * Model selection for the enrichment LLM call lives in
1484
+ * `app.task_llms.chunk_enrichment`; the legacy `generation_config` field was
1485
+ * removed in the per-task LLM cleanup pass.
1486
+ */
1487
+ export interface ChunkEnrichmentSettings {
1488
+ /**
1489
+ * The prompt to use for chunk enrichment
1490
+ */
1491
+ chunk_enrichment_prompt?: string | null;
1492
+
1493
+ /**
1494
+ * Whether to enable chunk enrichment or not
1495
+ */
1496
+ enable_chunk_enrichment?: boolean;
1497
+
1498
+ /**
1499
+ * The number of preceding and succeeding chunks to include. Defaults to 2.
1500
+ */
1501
+ n_chunks?: number;
1502
+ }
1503
+ }
1504
+
1505
+ /**
1506
+ * A message in a conversation with multimodal support.
1507
+ */
1508
+ export interface Message {
1509
+ /**
1510
+ * Message content. Use a string for text-only messages or a list of content parts
1511
+ * for multimodal content.
1512
+ */
1513
+ content:
1514
+ | string
1515
+ | Array<Message.TextContentRequest | Message.FileContentRequest | Message.S3FileReferenceRequest>;
1516
+
1517
+ /**
1518
+ * Role: 'user', 'assistant', or 'system'
1519
+ */
1520
+ role: 'user' | 'assistant' | 'system';
1521
+
1522
+ /**
1523
+ * Optional authority score
1524
+ */
1525
+ authority?: number | null;
1526
+
1527
+ /**
1528
+ * Optional message-level metadata
1529
+ */
1530
+ metadata?: { [key: string]: unknown } | null;
1531
+
1532
+ /**
1533
+ * Semantic timestamp for when the message was authored. Drives chunk timestamps,
1534
+ * the extraction LLM's temporal anchor, and episodic grouping. Without it,
1535
+ * relative phrases ('this morning') resolve against ingestion wall-clock and
1536
+ * episodes collapse.
1537
+ */
1538
+ timestamp?: string | null;
1539
+ }
1540
+
1541
+ export namespace Message {
1542
+ /**
1543
+ * Text content block.
1544
+ */
1545
+ export interface TextContentRequest {
1546
+ /**
1547
+ * Text content
1548
+ */
1549
+ text: string;
1550
+
1551
+ type?: 'text';
1552
+ }
1553
+
1554
+ /**
1555
+ * Unified file content for multimodal messages.
1556
+ */
1557
+ export interface FileContentRequest {
1558
+ /**
1559
+ * Base64 encoded file data
1560
+ */
1561
+ data: string;
1562
+
1563
+ /**
1564
+ * Duration in seconds (for audio)
1565
+ */
1566
+ duration_seconds?: number | null;
1567
+
1568
+ /**
1569
+ * Original filename
1570
+ */
1571
+ filename?: string | null;
1572
+
1573
+ /**
1574
+ * MIME type
1575
+ */
1576
+ media_type?: string;
1577
+
1578
+ /**
1579
+ * Content kind: file, image, audio, or document.
1580
+ */
1581
+ type?: 'file' | 'image' | 'audio' | 'document';
1582
+ }
1583
+
1584
+ /**
1585
+ * Reference to a file uploaded to S3 (for large files).
1586
+ */
1587
+ export interface S3FileReferenceRequest {
1588
+ /**
1589
+ * S3 object key
1590
+ */
1591
+ s3_key: string;
1592
+
1593
+ /**
1594
+ * S3 bucket (uses default if not specified)
1595
+ */
1596
+ bucket?: string | null;
1597
+
1598
+ /**
1599
+ * Original filename
1600
+ */
1601
+ filename?: string | null;
1602
+
1603
+ /**
1604
+ * MIME type
1605
+ */
1606
+ media_type?: string;
1607
+
1608
+ /**
1609
+ * File size in bytes
1610
+ */
1611
+ size_bytes?: number | null;
1612
+
1613
+ type?: 's3_ref';
1614
+ }
1615
+ }
1616
+
1617
+ /**
1618
+ * Portable full snapshot owned by the client.
1619
+ */
1620
+ export interface Snapshot {
1621
+ collection_id: string;
1622
+
1623
+ root_hash: string;
1624
+
1625
+ created_at?: string;
1626
+
1627
+ format_version?: number;
1628
+
1629
+ generation?: number;
1630
+
1631
+ /**
1632
+ * A complete graph payload or a context subgraph payload.
1633
+ */
1634
+ graph?: Snapshot.Graph;
1635
+ }
1636
+
1637
+ export namespace Snapshot {
1638
+ /**
1639
+ * A complete graph payload or a context subgraph payload.
1640
+ */
1641
+ export interface Graph {
1642
+ entities?: Array<Graph.Entity>;
1643
+
1644
+ /**
1645
+ * A positionally-aligned masked embedding matrix.
1646
+ */
1647
+ entity_description_embeddings?: Graph.EntityDescriptionEmbeddings;
1648
+
1649
+ /**
1650
+ * A positionally-aligned masked embedding matrix.
1651
+ */
1652
+ relationship_description_embeddings?: Graph.RelationshipDescriptionEmbeddings;
1653
+
1654
+ /**
1655
+ * A positionally-aligned masked embedding matrix.
1656
+ */
1657
+ relationship_relation_embeddings?: Graph.RelationshipRelationEmbeddings;
1658
+
1659
+ relationships?: Array<Graph.Relationship>;
1660
+ }
1661
+
1662
+ export namespace Graph {
1663
+ /**
1664
+ * Canonical entity record used in snapshots, WAL ops, and segments.
1665
+ */
1666
+ export interface Entity {
1667
+ id: string;
1668
+
1669
+ created_at: string;
1670
+
1671
+ engram_id: string;
1672
+
1673
+ name: string;
1674
+
1675
+ updated_at: string;
1676
+
1677
+ category?: string | null;
1678
+
1679
+ chunk_ids?: Array<string>;
1680
+
1681
+ collection_id?: string;
1682
+
1683
+ description?: string | null;
1684
+
1685
+ fts_terms?: { [key: string]: number } | null;
1686
+
1687
+ metadata?: { [key: string]: unknown };
1688
+
1689
+ relationship_count?: number;
1690
+ }
1691
+
1692
+ /**
1693
+ * A positionally-aligned masked embedding matrix.
1694
+ */
1695
+ export interface EntityDescriptionEmbeddings {
1696
+ dim?: number;
1697
+
1698
+ encoding?: 'npy-base64';
1699
+
1700
+ mask_b64?: string;
1701
+
1702
+ values_b64?: string;
1703
+ }
1704
+
1705
+ /**
1706
+ * A positionally-aligned masked embedding matrix.
1707
+ */
1708
+ export interface RelationshipDescriptionEmbeddings {
1709
+ dim?: number;
1710
+
1711
+ encoding?: 'npy-base64';
1712
+
1713
+ mask_b64?: string;
1714
+
1715
+ values_b64?: string;
1716
+ }
1717
+
1718
+ /**
1719
+ * A positionally-aligned masked embedding matrix.
1720
+ */
1721
+ export interface RelationshipRelationEmbeddings {
1722
+ dim?: number;
1723
+
1724
+ encoding?: 'npy-base64';
1725
+
1726
+ mask_b64?: string;
1727
+
1728
+ values_b64?: string;
1729
+ }
1730
+
1731
+ /**
1732
+ * Canonical relationship record used in snapshots, WAL ops, and segments.
1733
+ */
1734
+ export interface Relationship {
1735
+ id: string;
1736
+
1737
+ created_at: string;
1738
+
1739
+ object_id: string;
1740
+
1741
+ subject_id: string;
1742
+
1743
+ updated_at: string;
1744
+
1745
+ category?: string | null;
1746
+
1747
+ chunk_ids?: Array<string>;
1748
+
1749
+ collection_id?: string;
1750
+
1751
+ description?: string | null;
1752
+
1753
+ engram_id?: string | null;
1754
+
1755
+ inference_metadata?: { [key: string]: unknown } | null;
1756
+
1757
+ metadata?: { [key: string]: unknown };
1758
+
1759
+ object?: string | null;
1760
+
1761
+ predicate?: string;
1762
+
1763
+ relationship_type?: string | null;
1764
+
1765
+ subject?: string | null;
1766
+
1767
+ temporal_precision?: string | null;
1768
+
1769
+ valid_span?: { [key: string]: unknown } | null;
1770
+
1771
+ weight?: number | null;
1772
+ }
1773
+ }
1774
+ }
1775
+ }
1776
+
1777
+ export interface MemoryUpdateParams {
1778
+ /**
1779
+ * Query param: Collection context for copy-on-write. If provided and engram is
1780
+ * shared, creates a copy before modification.
1781
+ */
1782
+ collection_id?: string | null;
1783
+
1784
+ /**
1785
+ * Body param: New collection associations
1786
+ */
1787
+ collection_ids?: Array<string> | null;
1788
+
1789
+ /**
1790
+ * Body param: Merge with existing metadata
1791
+ */
1792
+ merge_metadata?: boolean;
1793
+
1794
+ /**
1795
+ * Body param: Metadata to update
1796
+ */
1797
+ metadata?: { [key: string]: unknown } | null;
1798
+
1799
+ /**
1800
+ * Body param: New name for the memory
1801
+ */
1802
+ name?: string | null;
1803
+ }
1804
+
1805
+ export interface MemoryListParams {
1806
+ /**
1807
+ * Maximum chunks to inline per engram. Defaults to all chunks for backwards
1808
+ * compatibility; pass 0 to skip chunk hydration.
1809
+ */
1810
+ chunks_limit?: number | null;
1811
+
1812
+ /**
1813
+ * Optional list of collection IDs to filter engrams by. If provided, exactly one
1814
+ * collection ID must be specified.
1815
+ */
1816
+ collection_ids?: Array<string> | null;
1817
+
1818
+ /**
1819
+ * A list of engram IDs to retrieve. If not provided, all engrams will be returned.
1820
+ */
1821
+ ids?: Array<string>;
1822
+
1823
+ /**
1824
+ * Specifies a limit on the number of objects to return, ranging between 1 and 100.
1825
+ * Defaults to 100.
1826
+ */
1827
+ limit?: number;
1828
+
1829
+ /**
1830
+ * JSON string for metadata filtering. Example: '{"metadata.source": {"$eq":
1831
+ * "playground"}}'
1832
+ */
1833
+ metadata_filters?: string | null;
1834
+
1835
+ /**
1836
+ * Specifies the number of objects to skip. Defaults to 0.
1837
+ */
1838
+ offset?: number;
1839
+
1840
+ /**
1841
+ * If true, only returns engrams owned by the user, not all accessible engrams.
1842
+ */
1843
+ owner_only?: boolean;
1844
+ }
1845
+
1846
+ export interface MemoryAppendParams {
1847
+ /**
1848
+ * Target collection ID for the appended content.
1849
+ */
1850
+ collection_id: string;
1851
+
1852
+ /**
1853
+ * Pre-processed text chunks to append for document memories.
1854
+ */
1855
+ chunks?: Array<string> | null;
1856
+
1857
+ /**
1858
+ * Public ingestion config accepted by memory-ingestion endpoints.
1859
+ *
1860
+ * This mirrors the supported request payload shape while staying independent from
1861
+ * the runtime provider config, which also carries internal-only fields such as
1862
+ * `app` and `extra_fields`.
1863
+ */
1864
+ ingestion_config?: MemoryAppendParams.IngestionConfig | null;
1865
+
1866
+ /**
1867
+ * Ingestion mode for document content.
1868
+ */
1869
+ ingestion_mode?: 'hi-res' | 'ocr' | 'fast' | 'custom';
1870
+
1871
+ /**
1872
+ * Messages to append for conversation memories. Each message has content, role,
1873
+ * and optional metadata.
1874
+ */
1875
+ messages?: Array<MemoryAppendParams.Message> | null;
1876
+
1877
+ /**
1878
+ * Additional metadata for the appended content.
1879
+ */
1880
+ metadata?: { [key: string]: unknown } | null;
1881
+
1882
+ /**
1883
+ * Raw text content to append for document memories.
1884
+ */
1885
+ raw_text?: string | null;
1886
+ }
1887
+
1888
+ export namespace MemoryAppendParams {
1889
+ /**
1890
+ * Public ingestion config accepted by memory-ingestion endpoints.
1891
+ *
1892
+ * This mirrors the supported request payload shape while staying independent from
1893
+ * the runtime provider config, which also carries internal-only fields such as
1894
+ * `app` and `extra_fields`.
1895
+ */
1896
+ export interface IngestionConfig {
1897
+ audio_transcription_model?: string | null;
1898
+
1899
+ automatic_extraction?: boolean;
1900
+
1901
+ /**
1902
+ * Settings for chunk enrichment.
1903
+ *
1904
+ * Model selection for the enrichment LLM call lives in
1905
+ * `app.task_llms.chunk_enrichment`; the legacy `generation_config` field was
1906
+ * removed in the per-task LLM cleanup pass.
1907
+ */
1908
+ chunk_enrichment_settings?: IngestionConfig.ChunkEnrichmentSettings;
1909
+
1910
+ chunk_overlap?: number;
1911
+
1912
+ chunk_size?: number;
1913
+
1914
+ chunking_strategy?: string;
1915
+
1916
+ excluded_parsers?: Array<string>;
1917
+
1918
+ extra_parsers?: { [key: string]: unknown };
1919
+
1920
+ max_concurrent_vlm_tasks?: number;
1921
+
1922
+ parser_overrides?: { [key: string]: string };
1923
+
1924
+ provider?: string;
1925
+
1926
+ vlm?: string | null;
1927
+
1928
+ vlm_batch_size?: number;
1929
+
1930
+ vlm_max_tokens_to_sample?: number;
1931
+
1932
+ vlm_ocr_one_page_per_chunk?: boolean;
1933
+ }
1934
+
1935
+ export namespace IngestionConfig {
1936
+ /**
1937
+ * Settings for chunk enrichment.
1938
+ *
1939
+ * Model selection for the enrichment LLM call lives in
1940
+ * `app.task_llms.chunk_enrichment`; the legacy `generation_config` field was
1941
+ * removed in the per-task LLM cleanup pass.
1942
+ */
1943
+ export interface ChunkEnrichmentSettings {
1944
+ /**
1945
+ * The prompt to use for chunk enrichment
1946
+ */
1947
+ chunk_enrichment_prompt?: string | null;
1948
+
1949
+ /**
1950
+ * Whether to enable chunk enrichment or not
1951
+ */
1952
+ enable_chunk_enrichment?: boolean;
1953
+
1954
+ /**
1955
+ * The number of preceding and succeeding chunks to include. Defaults to 2.
1956
+ */
1957
+ n_chunks?: number;
1958
+ }
1959
+ }
1960
+
1961
+ export interface Message {
1962
+ /**
1963
+ * Message content. Use a string for text-only messages or a list of content parts
1964
+ * for multimodal content.
1965
+ */
1966
+ content:
1967
+ | string
1968
+ | Array<Message.TextContentRequest | Message.FileContentRequest | Message.S3FileReferenceRequest>;
1969
+
1970
+ /**
1971
+ * Role: 'user', 'assistant', or 'system'
1972
+ */
1973
+ role: 'user' | 'assistant' | 'system';
1974
+
1975
+ /**
1976
+ * Optional authority score
1977
+ */
1978
+ authority?: number | null;
1979
+
1980
+ /**
1981
+ * Optional message-level metadata
1982
+ */
1983
+ metadata?: { [key: string]: unknown } | null;
1984
+
1985
+ /**
1986
+ * Optional parent message ID
1987
+ */
1988
+ parent_id?: string | null;
1989
+
1990
+ /**
1991
+ * Optional SourceRole entity ID
1992
+ */
1993
+ source_role_id?: string | null;
1994
+
1995
+ /**
1996
+ * Semantic timestamp for when the message was authored. Drives chunk timestamps,
1997
+ * the extraction LLM's temporal anchor, and episodic grouping. Without it,
1998
+ * relative phrases ('this morning') resolve against ingestion wall-clock and
1999
+ * episodes collapse.
2000
+ */
2001
+ timestamp?: string | null;
2002
+ }
2003
+
2004
+ export namespace Message {
2005
+ /**
2006
+ * Text content block.
2007
+ */
2008
+ export interface TextContentRequest {
2009
+ /**
2010
+ * Text content
2011
+ */
2012
+ text: string;
2013
+
2014
+ type?: 'text';
2015
+ }
2016
+
2017
+ /**
2018
+ * Unified file content for multimodal messages.
2019
+ */
2020
+ export interface FileContentRequest {
2021
+ /**
2022
+ * Base64 encoded file data
2023
+ */
2024
+ data: string;
2025
+
2026
+ /**
2027
+ * Duration in seconds (for audio)
2028
+ */
2029
+ duration_seconds?: number | null;
2030
+
2031
+ /**
2032
+ * Original filename
2033
+ */
2034
+ filename?: string | null;
2035
+
2036
+ /**
2037
+ * MIME type
2038
+ */
2039
+ media_type?: string;
2040
+
2041
+ /**
2042
+ * Content kind: file, image, audio, or document.
2043
+ */
2044
+ type?: 'file' | 'image' | 'audio' | 'document';
2045
+ }
2046
+
2047
+ /**
2048
+ * Reference to a file uploaded to S3 (for large files).
2049
+ */
2050
+ export interface S3FileReferenceRequest {
2051
+ /**
2052
+ * S3 object key
2053
+ */
2054
+ s3_key: string;
2055
+
2056
+ /**
2057
+ * S3 bucket (uses default if not specified)
2058
+ */
2059
+ bucket?: string | null;
2060
+
2061
+ /**
2062
+ * Original filename
2063
+ */
2064
+ filename?: string | null;
2065
+
2066
+ /**
2067
+ * MIME type
2068
+ */
2069
+ media_type?: string;
2070
+
2071
+ /**
2072
+ * File size in bytes
2073
+ */
2074
+ size_bytes?: number | null;
2075
+
2076
+ type?: 's3_ref';
2077
+ }
2078
+ }
2079
+ }
2080
+
2081
+ export interface MemoryCreateUploadParams {
2082
+ /**
2083
+ * MIME type (e.g., 'image/jpeg', 'application/pdf')
2084
+ */
2085
+ content_type: string;
2086
+
2087
+ /**
2088
+ * Expected file size in bytes (max 100MB)
2089
+ */
2090
+ file_size: number;
2091
+
2092
+ /**
2093
+ * Original filename (e.g., 'image.jpg')
2094
+ */
2095
+ filename: string;
2096
+ }
2097
+
2098
+ export type MemoryDeleteManyParams = MemoryDeleteManyParams.Variant0 | MemoryDeleteManyParams.Variant1;
2099
+
2100
+ export declare namespace MemoryDeleteManyParams {
2101
+ export interface Variant0 {
2102
+ body: string;
2103
+ }
2104
+
2105
+ export interface Variant1 {
2106
+ body: Array<string>;
2107
+ }
2108
+ }
2109
+
2110
+ export interface MemoryDeleteUploadParams {
2111
+ /**
2112
+ * S3 key of the file to delete (returned by POST /memories/upload)
2113
+ */
2114
+ s3_key: string;
2115
+ }
2116
+
2117
+ export interface MemorySearchParams {
2118
+ /**
2119
+ * Optional list of collection UUIDs or names to scope the search.
2120
+ */
2121
+ collection_ids?: Array<string> | null;
2122
+
2123
+ /**
2124
+ * Compute effort budget for memory search.
2125
+ *
2126
+ * Effort controls traversal compute (exploration budgets, depth, fanout), not the
2127
+ * size of the returned MemoryRecall projection.
2128
+ */
2129
+ effort?: 'auto' | 'low' | 'medium' | 'high' | null;
2130
+
2131
+ /**
2132
+ * Optional filters to apply to the search.
2133
+ */
2134
+ filters?: { [key: string]: unknown } | null;
2135
+
2136
+ /**
2137
+ * Pre-written NQL script. Executes directly without planner compilation. Mutually
2138
+ * exclusive with `query`.
2139
+ */
2140
+ nql?: string | null;
2141
+
2142
+ /**
2143
+ * Natural-language search query. Mutually exclusive with `nql`.
2144
+ */
2145
+ query?: string | null;
2146
+
2147
+ /**
2148
+ * Advanced search settings for fine-tuning search behavior.
2149
+ *
2150
+ * Note: Core parameters (query, collection_ids, filters) are now top-level API
2151
+ * parameters. This class contains advanced tuning options plus internal fields
2152
+ * used by the retrieval service.
2153
+ *
2154
+ * Memory search uses `effort` (auto/low/medium/high) to control compute.
2155
+ */
2156
+ search_settings?: MemorySearchParams.SearchSettings | null;
2157
+
2158
+ /**
2159
+ * Portable full snapshot owned by the client.
2160
+ */
2161
+ snapshot?: MemorySearchParams.Snapshot | null;
2162
+ }
2163
+
2164
+ export namespace MemorySearchParams {
2165
+ /**
2166
+ * Advanced search settings for fine-tuning search behavior.
2167
+ *
2168
+ * Note: Core parameters (query, collection_ids, filters) are now top-level API
2169
+ * parameters. This class contains advanced tuning options plus internal fields
2170
+ * used by the retrieval service.
2171
+ *
2172
+ * Memory search uses `effort` (auto/low/medium/high) to control compute.
2173
+ */
2174
+ export interface SearchSettings {
2175
+ /**
2176
+ * Compute effort budget (auto/low/medium/high). Controls traversal compute for
2177
+ * memory search, not MemoryRecall size.
2178
+ */
2179
+ effort?: 'auto' | 'low' | 'medium' | 'high';
2180
+
2181
+ /**
2182
+ * Enable conceptual expansion for cross-domain discovery through overlapping
2183
+ * concepts
2184
+ */
2185
+ enable_conceptual_expansion?: boolean;
2186
+
2187
+ /**
2188
+ * Internal: Filters populated by the API router
2189
+ */
2190
+ filters?: { [key: string]: unknown };
2191
+
2192
+ /**
2193
+ * Weight for fulltext search in hybrid mode (0-1). Set to 0 for pure semantic
2194
+ * search.
2195
+ */
2196
+ fulltext_weight?: number;
2197
+
2198
+ /**
2199
+ * Internal: Graph traversal settings (bfs_max_depth, semantic_threshold, etc.)
2200
+ */
2201
+ graph_settings?: { [key: string]: unknown };
2202
+
2203
+ /**
2204
+ * Internal: Set by select_search_filters when an owner_id $in partition-pruning
2205
+ * wrapper has been added around the filter tree. Used by the in-memory graph read
2206
+ * engine to strip the Postgres-only wrapper before evaluating delegation.
2207
+ */
2208
+ has_pruning_gate?: boolean;
2209
+
2210
+ /**
2211
+ * Whether to include search score values in the search results
2212
+ */
2213
+ include_scores?: boolean;
2214
+
2215
+ /**
2216
+ * Weight for semantic search in hybrid mode (0-1). Set to 0 for pure fulltext
2217
+ * search.
2218
+ */
2219
+ semantic_weight?: number;
2220
+
2221
+ /**
2222
+ * Include full internal metadata, UUIDs, and confidence fields in MemoryRecall
2223
+ * responses. When False, returns compact LLM-optimized format.
2224
+ */
2225
+ verbose?: boolean;
2226
+ }
2227
+
2228
+ /**
2229
+ * Portable full snapshot owned by the client.
2230
+ */
2231
+ export interface Snapshot {
2232
+ collection_id: string;
2233
+
2234
+ root_hash: string;
2235
+
2236
+ created_at?: string;
2237
+
2238
+ format_version?: number;
2239
+
2240
+ generation?: number;
2241
+
2242
+ /**
2243
+ * A complete graph payload or a context subgraph payload.
2244
+ */
2245
+ graph?: Snapshot.Graph;
2246
+ }
2247
+
2248
+ export namespace Snapshot {
2249
+ /**
2250
+ * A complete graph payload or a context subgraph payload.
2251
+ */
2252
+ export interface Graph {
2253
+ entities?: Array<Graph.Entity>;
2254
+
2255
+ /**
2256
+ * A positionally-aligned masked embedding matrix.
2257
+ */
2258
+ entity_description_embeddings?: Graph.EntityDescriptionEmbeddings;
2259
+
2260
+ /**
2261
+ * A positionally-aligned masked embedding matrix.
2262
+ */
2263
+ relationship_description_embeddings?: Graph.RelationshipDescriptionEmbeddings;
2264
+
2265
+ /**
2266
+ * A positionally-aligned masked embedding matrix.
2267
+ */
2268
+ relationship_relation_embeddings?: Graph.RelationshipRelationEmbeddings;
2269
+
2270
+ relationships?: Array<Graph.Relationship>;
2271
+ }
2272
+
2273
+ export namespace Graph {
2274
+ /**
2275
+ * Canonical entity record used in snapshots, WAL ops, and segments.
2276
+ */
2277
+ export interface Entity {
2278
+ id: string;
2279
+
2280
+ created_at: string;
2281
+
2282
+ engram_id: string;
2283
+
2284
+ name: string;
2285
+
2286
+ updated_at: string;
2287
+
2288
+ category?: string | null;
2289
+
2290
+ chunk_ids?: Array<string>;
2291
+
2292
+ collection_id?: string;
2293
+
2294
+ description?: string | null;
2295
+
2296
+ fts_terms?: { [key: string]: number } | null;
2297
+
2298
+ metadata?: { [key: string]: unknown };
2299
+
2300
+ relationship_count?: number;
2301
+ }
2302
+
2303
+ /**
2304
+ * A positionally-aligned masked embedding matrix.
2305
+ */
2306
+ export interface EntityDescriptionEmbeddings {
2307
+ dim?: number;
2308
+
2309
+ encoding?: 'npy-base64';
2310
+
2311
+ mask_b64?: string;
2312
+
2313
+ values_b64?: string;
2314
+ }
2315
+
2316
+ /**
2317
+ * A positionally-aligned masked embedding matrix.
2318
+ */
2319
+ export interface RelationshipDescriptionEmbeddings {
2320
+ dim?: number;
2321
+
2322
+ encoding?: 'npy-base64';
2323
+
2324
+ mask_b64?: string;
2325
+
2326
+ values_b64?: string;
2327
+ }
2328
+
2329
+ /**
2330
+ * A positionally-aligned masked embedding matrix.
2331
+ */
2332
+ export interface RelationshipRelationEmbeddings {
2333
+ dim?: number;
2334
+
2335
+ encoding?: 'npy-base64';
2336
+
2337
+ mask_b64?: string;
2338
+
2339
+ values_b64?: string;
2340
+ }
2341
+
2342
+ /**
2343
+ * Canonical relationship record used in snapshots, WAL ops, and segments.
2344
+ */
2345
+ export interface Relationship {
2346
+ id: string;
2347
+
2348
+ created_at: string;
2349
+
2350
+ object_id: string;
2351
+
2352
+ subject_id: string;
2353
+
2354
+ updated_at: string;
2355
+
2356
+ category?: string | null;
2357
+
2358
+ chunk_ids?: Array<string>;
2359
+
2360
+ collection_id?: string;
2361
+
2362
+ description?: string | null;
2363
+
2364
+ engram_id?: string | null;
2365
+
2366
+ inference_metadata?: { [key: string]: unknown } | null;
2367
+
2368
+ metadata?: { [key: string]: unknown };
2369
+
2370
+ object?: string | null;
2371
+
2372
+ predicate?: string;
2373
+
2374
+ relationship_type?: string | null;
2375
+
2376
+ subject?: string | null;
2377
+
2378
+ temporal_precision?: string | null;
2379
+
2380
+ valid_span?: { [key: string]: unknown } | null;
2381
+
2382
+ weight?: number | null;
2383
+ }
2384
+ }
2385
+ }
2386
+ }
2387
+
2388
+ export declare namespace Memories {
2389
+ export {
2390
+ type MemoryCreateResponse as MemoryCreateResponse,
2391
+ type MemoryRetrieveResponse as MemoryRetrieveResponse,
2392
+ type MemoryUpdateResponse as MemoryUpdateResponse,
2393
+ type MemoryListResponse as MemoryListResponse,
2394
+ type MemoryDeleteResponse as MemoryDeleteResponse,
2395
+ type MemoryAppendResponse as MemoryAppendResponse,
2396
+ type MemoryCreateUploadResponse as MemoryCreateUploadResponse,
2397
+ type MemoryDeleteManyResponse as MemoryDeleteManyResponse,
2398
+ type MemoryDeleteUploadResponse as MemoryDeleteUploadResponse,
2399
+ type MemorySearchResponse as MemorySearchResponse,
2400
+ type MemoryCreateParams as MemoryCreateParams,
2401
+ type MemoryUpdateParams as MemoryUpdateParams,
2402
+ type MemoryListParams as MemoryListParams,
2403
+ type MemoryAppendParams as MemoryAppendParams,
2404
+ type MemoryCreateUploadParams as MemoryCreateUploadParams,
2405
+ type MemoryDeleteManyParams as MemoryDeleteManyParams,
2406
+ type MemoryDeleteUploadParams as MemoryDeleteUploadParams,
2407
+ type MemorySearchParams as MemorySearchParams,
2408
+ };
2409
+ }