@getzep/zep-cloud 1.0.11 → 2.0.0-rc.1

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 (439) hide show
  1. package/Client.d.ts +6 -0
  2. package/Client.js +12 -2
  3. package/LICENSE +201 -0
  4. package/README.md +15 -3
  5. package/api/resources/document/client/Client.d.ts +9 -9
  6. package/api/resources/document/client/Client.js +20 -20
  7. package/api/resources/graph/client/Client.d.ts +62 -0
  8. package/api/resources/graph/client/Client.js +225 -0
  9. package/api/resources/graph/client/index.d.ts +1 -0
  10. package/{dist/langchain → api/resources/graph/client}/index.js +1 -3
  11. package/api/resources/graph/client/requests/AddDataRequest.d.ts +14 -0
  12. package/api/resources/graph/client/requests/GraphSearchQuery.d.ts +30 -0
  13. package/api/resources/graph/client/requests/index.d.ts +2 -0
  14. package/api/resources/graph/client/requests/index.js +2 -0
  15. package/api/resources/graph/index.d.ts +2 -0
  16. package/{langchain → api/resources/graph}/index.js +2 -3
  17. package/api/resources/graph/resources/edge/client/Client.d.ts +78 -0
  18. package/api/resources/graph/resources/edge/client/Client.js +361 -0
  19. package/api/resources/graph/resources/edge/client/index.d.ts +1 -0
  20. package/api/resources/graph/resources/edge/client/index.js +2 -0
  21. package/api/resources/graph/resources/edge/index.d.ts +1 -0
  22. package/api/resources/graph/resources/edge/index.js +17 -0
  23. package/api/resources/graph/resources/episode/client/Client.d.ts +66 -0
  24. package/api/resources/graph/resources/episode/client/Client.js +293 -0
  25. package/api/resources/graph/resources/episode/client/index.d.ts +1 -0
  26. package/api/resources/graph/resources/episode/client/index.js +17 -0
  27. package/api/resources/graph/resources/episode/client/requests/EpisodeGetByGroupIdRequest.d.ts +13 -0
  28. package/api/resources/graph/resources/episode/client/requests/EpisodeGetByUserIdRequest.d.ts +13 -0
  29. package/api/resources/graph/resources/episode/client/requests/index.d.ts +2 -0
  30. package/api/resources/graph/resources/episode/client/requests/index.js +2 -0
  31. package/api/resources/graph/resources/episode/index.d.ts +1 -0
  32. package/api/resources/graph/resources/episode/index.js +17 -0
  33. package/api/resources/graph/resources/index.d.ts +4 -0
  34. package/api/resources/graph/resources/index.js +33 -0
  35. package/api/resources/graph/resources/node/client/Client.d.ts +65 -0
  36. package/api/resources/graph/resources/node/client/Client.js +288 -0
  37. package/api/resources/graph/resources/node/client/index.d.ts +1 -0
  38. package/api/resources/graph/resources/node/client/index.js +2 -0
  39. package/api/resources/graph/resources/node/index.d.ts +1 -0
  40. package/api/resources/graph/resources/node/index.js +17 -0
  41. package/api/resources/group/client/Client.d.ts +52 -0
  42. package/api/resources/group/client/Client.js +216 -0
  43. package/api/resources/group/client/index.d.ts +1 -0
  44. package/api/resources/group/client/index.js +17 -0
  45. package/api/resources/group/client/requests/CreateGroupRequest.d.ts +12 -0
  46. package/api/resources/group/client/requests/index.d.ts +1 -0
  47. package/api/resources/group/client/requests/index.js +2 -0
  48. package/api/resources/group/index.d.ts +1 -0
  49. package/api/resources/group/index.js +17 -0
  50. package/api/resources/index.d.ts +4 -0
  51. package/api/resources/index.js +5 -1
  52. package/api/resources/memory/client/Client.d.ts +22 -12
  53. package/api/resources/memory/client/Client.js +45 -38
  54. package/api/resources/memory/client/requests/AddFactsRequest.d.ts +1 -1
  55. package/api/resources/memory/client/requests/AddMemoryRequest.d.ts +6 -3
  56. package/api/resources/memory/client/requests/CreateSessionRequest.d.ts +3 -2
  57. package/api/resources/memory/client/requests/MemoryGetRequest.d.ts +0 -5
  58. package/api/resources/memory/client/requests/MemoryGetSessionFactsRequest.d.ts +1 -1
  59. package/api/resources/memory/client/requests/ModelsMessageMetadataUpdate.d.ts +3 -1
  60. package/api/resources/memory/client/requests/SessionSearchQuery.d.ts +12 -3
  61. package/api/resources/memory/client/requests/UpdateSessionRequest.d.ts +3 -1
  62. package/api/resources/user/client/Client.d.ts +13 -0
  63. package/api/resources/user/client/Client.js +79 -6
  64. package/{dist/api/types/DocumentResponse.d.ts → api/types/ApidataDocument.d.ts} +1 -1
  65. package/api/types/{DocumentCollectionResponse.d.ts → ApidataDocumentCollection.d.ts} +1 -3
  66. package/api/types/{DocumentSearchResultPage.d.ts → ApidataDocumentSearchResponse.d.ts} +2 -2
  67. package/api/types/{DocumentSearchResult.d.ts → ApidataDocumentWithScore.d.ts} +1 -1
  68. package/api/types/EndSessionResponse.d.ts +1 -1
  69. package/api/types/EntityEdge.d.ts +25 -0
  70. package/api/types/EntityNode.d.ts +15 -0
  71. package/api/types/Episode.d.ts +12 -0
  72. package/api/types/EpisodeResponse.d.ts +7 -0
  73. package/api/types/EpisodeResponse.js +5 -0
  74. package/api/types/Fact.d.ts +9 -3
  75. package/api/types/GraphDataType.d.ts +9 -0
  76. package/api/types/GraphDataType.js +11 -0
  77. package/api/types/GraphSearchResults.d.ts +8 -0
  78. package/api/types/GraphSearchResults.js +5 -0
  79. package/api/types/GraphSearchScope.d.ts +8 -0
  80. package/api/types/GraphSearchScope.js +10 -0
  81. package/api/types/Group.d.ts +12 -0
  82. package/api/types/Group.js +5 -0
  83. package/api/types/Memory.d.ts +4 -5
  84. package/api/types/Message.d.ts +2 -2
  85. package/api/types/{AddedFact.d.ts → NewFact.d.ts} +1 -1
  86. package/api/types/NewFact.js +5 -0
  87. package/api/types/Reranker.d.ts +10 -0
  88. package/api/types/Reranker.js +12 -0
  89. package/api/types/Session.d.ts +1 -2
  90. package/api/types/{ClassifySessionResponse.d.ts → SessionClassification.d.ts} +2 -2
  91. package/api/types/SessionClassification.js +5 -0
  92. package/api/types/SessionFactRatingExamples.d.ts +8 -0
  93. package/api/types/SessionFactRatingExamples.js +5 -0
  94. package/api/types/SessionFactRatingInstruction.d.ts +21 -0
  95. package/api/types/SessionFactRatingInstruction.js +5 -0
  96. package/api/types/index.d.ts +24 -14
  97. package/api/types/index.js +24 -14
  98. package/dist/Client.d.ts +6 -0
  99. package/dist/Client.js +12 -2
  100. package/dist/api/resources/document/client/Client.d.ts +9 -9
  101. package/dist/api/resources/document/client/Client.js +20 -20
  102. package/dist/api/resources/graph/client/Client.d.ts +62 -0
  103. package/dist/api/resources/graph/client/Client.js +225 -0
  104. package/dist/api/resources/graph/client/index.d.ts +1 -0
  105. package/dist/api/resources/graph/client/index.js +17 -0
  106. package/dist/api/resources/graph/client/requests/AddDataRequest.d.ts +14 -0
  107. package/dist/api/resources/graph/client/requests/AddDataRequest.js +5 -0
  108. package/dist/api/resources/graph/client/requests/GraphSearchQuery.d.ts +30 -0
  109. package/dist/api/resources/graph/client/requests/GraphSearchQuery.js +5 -0
  110. package/dist/api/resources/graph/client/requests/index.d.ts +2 -0
  111. package/dist/api/resources/graph/client/requests/index.js +2 -0
  112. package/dist/api/resources/graph/index.d.ts +2 -0
  113. package/dist/api/resources/graph/index.js +18 -0
  114. package/dist/api/resources/graph/resources/edge/client/Client.d.ts +78 -0
  115. package/dist/api/resources/graph/resources/edge/client/Client.js +361 -0
  116. package/dist/api/resources/graph/resources/edge/client/index.d.ts +1 -0
  117. package/dist/api/resources/graph/resources/edge/client/index.js +2 -0
  118. package/dist/api/resources/graph/resources/edge/index.d.ts +1 -0
  119. package/dist/api/resources/graph/resources/edge/index.js +17 -0
  120. package/dist/api/resources/graph/resources/episode/client/Client.d.ts +66 -0
  121. package/dist/api/resources/graph/resources/episode/client/Client.js +293 -0
  122. package/dist/api/resources/graph/resources/episode/client/index.d.ts +1 -0
  123. package/dist/api/resources/graph/resources/episode/client/index.js +17 -0
  124. package/dist/api/resources/graph/resources/episode/client/requests/EpisodeGetByGroupIdRequest.d.ts +13 -0
  125. package/dist/api/resources/graph/resources/episode/client/requests/EpisodeGetByGroupIdRequest.js +5 -0
  126. package/dist/api/resources/graph/resources/episode/client/requests/EpisodeGetByUserIdRequest.d.ts +13 -0
  127. package/dist/api/resources/graph/resources/episode/client/requests/EpisodeGetByUserIdRequest.js +5 -0
  128. package/dist/api/resources/graph/resources/episode/client/requests/index.d.ts +2 -0
  129. package/dist/api/resources/graph/resources/episode/client/requests/index.js +2 -0
  130. package/dist/api/resources/graph/resources/episode/index.d.ts +1 -0
  131. package/dist/api/resources/graph/resources/episode/index.js +17 -0
  132. package/dist/api/resources/graph/resources/index.d.ts +4 -0
  133. package/dist/api/resources/graph/resources/index.js +33 -0
  134. package/dist/api/resources/graph/resources/node/client/Client.d.ts +65 -0
  135. package/dist/api/resources/graph/resources/node/client/Client.js +288 -0
  136. package/dist/api/resources/graph/resources/node/client/index.d.ts +1 -0
  137. package/dist/api/resources/graph/resources/node/client/index.js +2 -0
  138. package/dist/api/resources/graph/resources/node/index.d.ts +1 -0
  139. package/dist/api/resources/graph/resources/node/index.js +17 -0
  140. package/dist/api/resources/group/client/Client.d.ts +52 -0
  141. package/dist/api/resources/group/client/Client.js +216 -0
  142. package/dist/api/resources/group/client/index.d.ts +1 -0
  143. package/dist/api/resources/group/client/index.js +17 -0
  144. package/dist/api/resources/group/client/requests/CreateGroupRequest.d.ts +12 -0
  145. package/dist/api/resources/group/client/requests/CreateGroupRequest.js +5 -0
  146. package/dist/api/resources/group/client/requests/index.d.ts +1 -0
  147. package/dist/api/resources/group/client/requests/index.js +2 -0
  148. package/dist/api/resources/group/index.d.ts +1 -0
  149. package/dist/api/resources/group/index.js +17 -0
  150. package/dist/api/resources/index.d.ts +4 -0
  151. package/dist/api/resources/index.js +5 -1
  152. package/dist/api/resources/memory/client/Client.d.ts +22 -12
  153. package/dist/api/resources/memory/client/Client.js +45 -38
  154. package/dist/api/resources/memory/client/requests/AddFactsRequest.d.ts +1 -1
  155. package/dist/api/resources/memory/client/requests/AddMemoryRequest.d.ts +6 -3
  156. package/dist/api/resources/memory/client/requests/CreateSessionRequest.d.ts +3 -2
  157. package/dist/api/resources/memory/client/requests/MemoryGetRequest.d.ts +0 -5
  158. package/dist/api/resources/memory/client/requests/MemoryGetSessionFactsRequest.d.ts +1 -1
  159. package/dist/api/resources/memory/client/requests/ModelsMessageMetadataUpdate.d.ts +3 -1
  160. package/dist/api/resources/memory/client/requests/SessionSearchQuery.d.ts +12 -3
  161. package/dist/api/resources/memory/client/requests/UpdateSessionRequest.d.ts +3 -1
  162. package/dist/api/resources/user/client/Client.d.ts +13 -0
  163. package/dist/api/resources/user/client/Client.js +79 -6
  164. package/{api/types/DocumentResponse.d.ts → dist/api/types/ApidataDocument.d.ts} +1 -1
  165. package/dist/api/types/ApidataDocument.js +5 -0
  166. package/dist/api/types/{DocumentCollectionResponse.d.ts → ApidataDocumentCollection.d.ts} +1 -3
  167. package/dist/api/types/ApidataDocumentCollection.js +5 -0
  168. package/dist/api/types/{DocumentSearchResultPage.d.ts → ApidataDocumentSearchResponse.d.ts} +2 -2
  169. package/dist/api/types/ApidataDocumentSearchResponse.js +5 -0
  170. package/dist/api/types/{DocumentSearchResult.d.ts → ApidataDocumentWithScore.d.ts} +1 -1
  171. package/dist/api/types/ApidataDocumentWithScore.js +5 -0
  172. package/dist/api/types/EndSessionResponse.d.ts +1 -1
  173. package/dist/api/types/EntityEdge.d.ts +25 -0
  174. package/dist/api/types/EntityEdge.js +5 -0
  175. package/dist/api/types/EntityNode.d.ts +15 -0
  176. package/dist/api/types/EntityNode.js +5 -0
  177. package/dist/api/types/Episode.d.ts +12 -0
  178. package/dist/api/types/Episode.js +5 -0
  179. package/dist/api/types/EpisodeResponse.d.ts +7 -0
  180. package/dist/api/types/EpisodeResponse.js +5 -0
  181. package/dist/api/types/Fact.d.ts +9 -3
  182. package/dist/api/types/GraphDataType.d.ts +9 -0
  183. package/dist/api/types/GraphDataType.js +11 -0
  184. package/dist/api/types/GraphSearchResults.d.ts +8 -0
  185. package/dist/api/types/GraphSearchResults.js +5 -0
  186. package/dist/api/types/GraphSearchScope.d.ts +8 -0
  187. package/dist/api/types/GraphSearchScope.js +10 -0
  188. package/dist/api/types/Group.d.ts +12 -0
  189. package/dist/api/types/Group.js +5 -0
  190. package/dist/api/types/Memory.d.ts +4 -5
  191. package/dist/api/types/Message.d.ts +2 -2
  192. package/dist/api/types/{AddedFact.d.ts → NewFact.d.ts} +1 -1
  193. package/dist/api/types/NewFact.js +5 -0
  194. package/dist/api/types/Reranker.d.ts +10 -0
  195. package/dist/api/types/Reranker.js +12 -0
  196. package/dist/api/types/Session.d.ts +1 -2
  197. package/dist/api/types/{ClassifySessionResponse.d.ts → SessionClassification.d.ts} +2 -2
  198. package/dist/api/types/SessionClassification.js +5 -0
  199. package/dist/api/types/SessionFactRatingExamples.d.ts +8 -0
  200. package/dist/api/types/SessionFactRatingExamples.js +5 -0
  201. package/dist/api/types/SessionFactRatingInstruction.d.ts +21 -0
  202. package/dist/api/types/SessionFactRatingInstruction.js +5 -0
  203. package/dist/api/types/index.d.ts +24 -14
  204. package/dist/api/types/index.js +24 -14
  205. package/dist/serialization/resources/document/client/addDocuments.d.ts +2 -2
  206. package/dist/serialization/resources/document/client/addDocuments.js +1 -1
  207. package/dist/serialization/resources/document/client/batchGetDocuments.d.ts +3 -3
  208. package/dist/serialization/resources/document/client/batchGetDocuments.js +2 -2
  209. package/dist/serialization/resources/document/client/listCollections.d.ts +3 -3
  210. package/dist/serialization/resources/document/client/listCollections.js +2 -2
  211. package/dist/serialization/resources/graph/client/index.d.ts +1 -0
  212. package/dist/serialization/resources/graph/client/index.js +17 -0
  213. package/dist/serialization/resources/graph/client/requests/AddDataRequest.d.ts +16 -0
  214. package/dist/serialization/resources/graph/client/requests/AddDataRequest.js +37 -0
  215. package/dist/serialization/resources/graph/client/requests/GraphSearchQuery.d.ts +22 -0
  216. package/dist/serialization/resources/graph/client/requests/GraphSearchQuery.js +43 -0
  217. package/dist/serialization/resources/graph/client/requests/index.d.ts +2 -0
  218. package/dist/serialization/resources/graph/client/requests/index.js +7 -0
  219. package/dist/serialization/resources/graph/index.d.ts +2 -0
  220. package/dist/serialization/resources/graph/index.js +18 -0
  221. package/dist/serialization/resources/graph/resources/edge/client/getByGroupId.d.ts +11 -0
  222. package/dist/serialization/resources/graph/resources/edge/client/getByGroupId.js +32 -0
  223. package/dist/serialization/resources/graph/resources/edge/client/getByUserId.d.ts +11 -0
  224. package/dist/serialization/resources/graph/resources/edge/client/getByUserId.js +32 -0
  225. package/dist/serialization/resources/graph/resources/edge/client/index.d.ts +2 -0
  226. package/dist/serialization/resources/graph/resources/edge/client/index.js +28 -0
  227. package/dist/serialization/resources/graph/resources/edge/index.d.ts +1 -0
  228. package/dist/serialization/resources/graph/resources/edge/index.js +17 -0
  229. package/dist/serialization/resources/graph/resources/index.d.ts +2 -0
  230. package/dist/serialization/resources/graph/resources/index.js +28 -0
  231. package/dist/serialization/resources/graph/resources/node/client/getByGroupId.d.ts +11 -0
  232. package/dist/serialization/resources/graph/resources/node/client/getByGroupId.js +32 -0
  233. package/dist/serialization/resources/graph/resources/node/client/getByUserId.d.ts +11 -0
  234. package/dist/serialization/resources/graph/resources/node/client/getByUserId.js +32 -0
  235. package/dist/serialization/resources/graph/resources/node/client/index.d.ts +2 -0
  236. package/dist/serialization/resources/graph/resources/node/client/index.js +28 -0
  237. package/dist/serialization/resources/graph/resources/node/index.d.ts +1 -0
  238. package/dist/serialization/resources/graph/resources/node/index.js +17 -0
  239. package/dist/serialization/resources/group/client/index.d.ts +1 -0
  240. package/dist/serialization/resources/group/client/index.js +17 -0
  241. package/dist/serialization/resources/group/client/requests/CreateGroupRequest.d.ts +14 -0
  242. package/dist/serialization/resources/group/client/requests/CreateGroupRequest.js +35 -0
  243. package/dist/serialization/resources/group/client/requests/index.d.ts +1 -0
  244. package/dist/serialization/resources/group/client/requests/index.js +5 -0
  245. package/dist/serialization/resources/group/index.d.ts +1 -0
  246. package/dist/serialization/resources/group/index.js +17 -0
  247. package/dist/serialization/resources/index.d.ts +4 -0
  248. package/dist/serialization/resources/index.js +5 -1
  249. package/dist/serialization/resources/memory/client/requests/AddFactsRequest.d.ts +2 -2
  250. package/dist/serialization/resources/memory/client/requests/AddFactsRequest.js +2 -2
  251. package/dist/serialization/resources/memory/client/requests/CreateSessionRequest.d.ts +1 -1
  252. package/dist/serialization/resources/memory/client/requests/CreateSessionRequest.js +1 -1
  253. package/dist/serialization/resources/memory/client/requests/SessionSearchQuery.d.ts +1 -1
  254. package/dist/serialization/resources/memory/client/requests/SessionSearchQuery.js +1 -1
  255. package/{serialization/types/DocumentResponse.d.ts → dist/serialization/types/ApidataDocument.d.ts} +2 -2
  256. package/{serialization/types/DocumentResponse.js → dist/serialization/types/ApidataDocument.js} +2 -2
  257. package/dist/serialization/types/{DocumentCollectionResponse.d.ts → ApidataDocumentCollection.d.ts} +2 -2
  258. package/{serialization/types/DocumentCollectionResponse.js → dist/serialization/types/ApidataDocumentCollection.js} +2 -2
  259. package/dist/serialization/types/{DocumentSearchResultPage.d.ts → ApidataDocumentSearchResponse.d.ts} +4 -4
  260. package/dist/serialization/types/{DocumentSearchResultPage.js → ApidataDocumentSearchResponse.js} +4 -4
  261. package/dist/serialization/types/{DocumentSearchResult.d.ts → ApidataDocumentWithScore.d.ts} +2 -2
  262. package/dist/serialization/types/{DocumentSearchResult.js → ApidataDocumentWithScore.js} +2 -2
  263. package/dist/serialization/types/EndSessionResponse.d.ts +2 -2
  264. package/dist/serialization/types/EndSessionResponse.js +2 -2
  265. package/dist/serialization/types/EntityEdge.d.ts +21 -0
  266. package/dist/serialization/types/EntityEdge.js +42 -0
  267. package/dist/serialization/types/EntityNode.d.ts +16 -0
  268. package/dist/serialization/types/EntityNode.js +37 -0
  269. package/dist/serialization/types/Episode.d.ts +18 -0
  270. package/dist/serialization/types/Episode.js +39 -0
  271. package/dist/serialization/types/EpisodeResponse.d.ts +13 -0
  272. package/dist/serialization/types/EpisodeResponse.js +34 -0
  273. package/dist/serialization/types/Fact.d.ts +9 -3
  274. package/dist/serialization/types/Fact.js +9 -3
  275. package/dist/serialization/types/GraphDataType.d.ts +10 -0
  276. package/dist/serialization/types/{MemoryType.js → GraphDataType.js} +2 -2
  277. package/dist/serialization/types/GraphSearchResults.d.ts +15 -0
  278. package/dist/serialization/types/GraphSearchResults.js +36 -0
  279. package/dist/serialization/types/GraphSearchScope.d.ts +10 -0
  280. package/{serialization/types/MemoryType.js → dist/serialization/types/GraphSearchScope.js} +2 -2
  281. package/dist/serialization/types/Group.d.ts +18 -0
  282. package/dist/serialization/types/Group.js +39 -0
  283. package/dist/serialization/types/Memory.d.ts +0 -1
  284. package/dist/serialization/types/Memory.js +0 -1
  285. package/dist/serialization/types/Message.d.ts +2 -2
  286. package/dist/serialization/types/Message.js +2 -2
  287. package/dist/serialization/types/{AddedFact.d.ts → NewFact.d.ts} +2 -2
  288. package/{serialization/types/AddedFact.js → dist/serialization/types/NewFact.js} +2 -2
  289. package/dist/serialization/types/Reranker.d.ts +10 -0
  290. package/dist/serialization/types/Reranker.js +36 -0
  291. package/dist/serialization/types/Session.d.ts +2 -3
  292. package/dist/serialization/types/Session.js +2 -3
  293. package/dist/serialization/types/{ClassifySessionResponse.d.ts → SessionClassification.d.ts} +3 -3
  294. package/{serialization/types/ClassifySessionResponse.js → dist/serialization/types/SessionClassification.js} +3 -3
  295. package/dist/serialization/types/SessionFactRatingExamples.d.ts +14 -0
  296. package/dist/serialization/types/SessionFactRatingExamples.js +35 -0
  297. package/dist/serialization/types/SessionFactRatingInstruction.d.ts +14 -0
  298. package/dist/serialization/types/SessionFactRatingInstruction.js +35 -0
  299. package/dist/serialization/types/index.d.ts +24 -14
  300. package/dist/serialization/types/index.js +24 -14
  301. package/examples/graph/conversations.ts +297 -0
  302. package/examples/graph/group_graph_example.ts +61 -0
  303. package/examples/graph/user_graph_example.ts +158 -0
  304. package/package.json +5 -5
  305. package/serialization/resources/document/client/addDocuments.d.ts +2 -2
  306. package/serialization/resources/document/client/addDocuments.js +1 -1
  307. package/serialization/resources/document/client/batchGetDocuments.d.ts +3 -3
  308. package/serialization/resources/document/client/batchGetDocuments.js +2 -2
  309. package/serialization/resources/document/client/listCollections.d.ts +3 -3
  310. package/serialization/resources/document/client/listCollections.js +2 -2
  311. package/serialization/resources/graph/client/index.d.ts +1 -0
  312. package/serialization/resources/graph/client/index.js +17 -0
  313. package/serialization/resources/graph/client/requests/AddDataRequest.d.ts +16 -0
  314. package/serialization/resources/graph/client/requests/AddDataRequest.js +37 -0
  315. package/serialization/resources/graph/client/requests/GraphSearchQuery.d.ts +22 -0
  316. package/serialization/resources/graph/client/requests/GraphSearchQuery.js +43 -0
  317. package/serialization/resources/graph/client/requests/index.d.ts +2 -0
  318. package/serialization/resources/graph/client/requests/index.js +7 -0
  319. package/serialization/resources/graph/index.d.ts +2 -0
  320. package/serialization/resources/graph/index.js +18 -0
  321. package/serialization/resources/graph/resources/edge/client/getByGroupId.d.ts +11 -0
  322. package/serialization/resources/graph/resources/edge/client/getByGroupId.js +32 -0
  323. package/serialization/resources/graph/resources/edge/client/getByUserId.d.ts +11 -0
  324. package/serialization/resources/graph/resources/edge/client/getByUserId.js +32 -0
  325. package/serialization/resources/graph/resources/edge/client/index.d.ts +2 -0
  326. package/serialization/resources/graph/resources/edge/client/index.js +28 -0
  327. package/serialization/resources/graph/resources/edge/index.d.ts +1 -0
  328. package/serialization/resources/graph/resources/edge/index.js +17 -0
  329. package/serialization/resources/graph/resources/index.d.ts +2 -0
  330. package/serialization/resources/graph/resources/index.js +28 -0
  331. package/serialization/resources/graph/resources/node/client/getByGroupId.d.ts +11 -0
  332. package/serialization/resources/graph/resources/node/client/getByGroupId.js +32 -0
  333. package/serialization/resources/graph/resources/node/client/getByUserId.d.ts +11 -0
  334. package/serialization/resources/graph/resources/node/client/getByUserId.js +32 -0
  335. package/serialization/resources/graph/resources/node/client/index.d.ts +2 -0
  336. package/serialization/resources/graph/resources/node/client/index.js +28 -0
  337. package/serialization/resources/graph/resources/node/index.d.ts +1 -0
  338. package/serialization/resources/graph/resources/node/index.js +17 -0
  339. package/serialization/resources/group/client/index.d.ts +1 -0
  340. package/serialization/resources/group/client/index.js +17 -0
  341. package/serialization/resources/group/client/requests/CreateGroupRequest.d.ts +14 -0
  342. package/serialization/resources/group/client/requests/CreateGroupRequest.js +35 -0
  343. package/serialization/resources/group/client/requests/index.d.ts +1 -0
  344. package/serialization/resources/group/client/requests/index.js +5 -0
  345. package/serialization/resources/group/index.d.ts +1 -0
  346. package/serialization/resources/group/index.js +17 -0
  347. package/serialization/resources/index.d.ts +4 -0
  348. package/serialization/resources/index.js +5 -1
  349. package/serialization/resources/memory/client/requests/AddFactsRequest.d.ts +2 -2
  350. package/serialization/resources/memory/client/requests/AddFactsRequest.js +2 -2
  351. package/serialization/resources/memory/client/requests/CreateSessionRequest.d.ts +1 -1
  352. package/serialization/resources/memory/client/requests/CreateSessionRequest.js +1 -1
  353. package/serialization/resources/memory/client/requests/SessionSearchQuery.d.ts +1 -1
  354. package/serialization/resources/memory/client/requests/SessionSearchQuery.js +1 -1
  355. package/{dist/serialization/types/DocumentResponse.d.ts → serialization/types/ApidataDocument.d.ts} +2 -2
  356. package/{dist/serialization/types/DocumentResponse.js → serialization/types/ApidataDocument.js} +2 -2
  357. package/serialization/types/{DocumentCollectionResponse.d.ts → ApidataDocumentCollection.d.ts} +2 -2
  358. package/{dist/serialization/types/DocumentCollectionResponse.js → serialization/types/ApidataDocumentCollection.js} +2 -2
  359. package/serialization/types/{DocumentSearchResultPage.d.ts → ApidataDocumentSearchResponse.d.ts} +4 -4
  360. package/serialization/types/{DocumentSearchResultPage.js → ApidataDocumentSearchResponse.js} +4 -4
  361. package/serialization/types/{DocumentSearchResult.d.ts → ApidataDocumentWithScore.d.ts} +2 -2
  362. package/serialization/types/{DocumentSearchResult.js → ApidataDocumentWithScore.js} +2 -2
  363. package/serialization/types/EndSessionResponse.d.ts +2 -2
  364. package/serialization/types/EndSessionResponse.js +2 -2
  365. package/serialization/types/EntityEdge.d.ts +21 -0
  366. package/serialization/types/EntityEdge.js +42 -0
  367. package/serialization/types/EntityNode.d.ts +16 -0
  368. package/serialization/types/EntityNode.js +37 -0
  369. package/serialization/types/Episode.d.ts +18 -0
  370. package/serialization/types/Episode.js +39 -0
  371. package/serialization/types/EpisodeResponse.d.ts +13 -0
  372. package/serialization/types/EpisodeResponse.js +34 -0
  373. package/serialization/types/Fact.d.ts +9 -3
  374. package/serialization/types/Fact.js +9 -3
  375. package/serialization/types/GraphDataType.d.ts +10 -0
  376. package/serialization/types/GraphDataType.js +31 -0
  377. package/serialization/types/GraphSearchResults.d.ts +15 -0
  378. package/serialization/types/GraphSearchResults.js +36 -0
  379. package/serialization/types/GraphSearchScope.d.ts +10 -0
  380. package/serialization/types/GraphSearchScope.js +31 -0
  381. package/serialization/types/Group.d.ts +18 -0
  382. package/serialization/types/Group.js +39 -0
  383. package/serialization/types/Memory.d.ts +0 -1
  384. package/serialization/types/Memory.js +0 -1
  385. package/serialization/types/Message.d.ts +2 -2
  386. package/serialization/types/Message.js +2 -2
  387. package/serialization/types/{AddedFact.d.ts → NewFact.d.ts} +2 -2
  388. package/{dist/serialization/types/AddedFact.js → serialization/types/NewFact.js} +2 -2
  389. package/serialization/types/Reranker.d.ts +10 -0
  390. package/serialization/types/Reranker.js +36 -0
  391. package/serialization/types/Session.d.ts +2 -3
  392. package/serialization/types/Session.js +2 -3
  393. package/serialization/types/{ClassifySessionResponse.d.ts → SessionClassification.d.ts} +3 -3
  394. package/{dist/serialization/types/ClassifySessionResponse.js → serialization/types/SessionClassification.js} +3 -3
  395. package/serialization/types/SessionFactRatingExamples.d.ts +14 -0
  396. package/serialization/types/SessionFactRatingExamples.js +35 -0
  397. package/serialization/types/SessionFactRatingInstruction.d.ts +14 -0
  398. package/serialization/types/SessionFactRatingInstruction.js +35 -0
  399. package/serialization/types/index.d.ts +24 -14
  400. package/serialization/types/index.js +24 -14
  401. package/api/types/MemoryType.d.ts +0 -9
  402. package/api/types/MemoryType.js +0 -11
  403. package/dist/api/types/MemoryType.d.ts +0 -9
  404. package/dist/api/types/MemoryType.js +0 -11
  405. package/dist/langchain/index.d.ts +0 -3
  406. package/dist/langchain/message_history.d.ts +0 -39
  407. package/dist/langchain/message_history.js +0 -109
  408. package/dist/langchain/utils.d.ts +0 -4
  409. package/dist/langchain/utils.js +0 -43
  410. package/dist/langchain/vector_store.d.ts +0 -142
  411. package/dist/langchain/vector_store.js +0 -327
  412. package/dist/langchain/zep_memory.d.ts +0 -78
  413. package/dist/langchain/zep_memory.js +0 -174
  414. package/dist/serialization/types/MemoryType.d.ts +0 -10
  415. package/examples/langchain/message_history_example.ts +0 -60
  416. package/examples/langchain/message_history_vector_store_example.ts +0 -122
  417. package/examples/langchain/vector_store_example.ts +0 -71
  418. package/langchain/index.d.ts +0 -3
  419. package/langchain/message_history.d.ts +0 -39
  420. package/langchain/message_history.js +0 -109
  421. package/langchain/utils.d.ts +0 -4
  422. package/langchain/utils.js +0 -43
  423. package/langchain/vector_store.d.ts +0 -142
  424. package/langchain/vector_store.js +0 -327
  425. package/langchain/zep_memory.d.ts +0 -78
  426. package/langchain/zep_memory.js +0 -174
  427. package/serialization/types/MemoryType.d.ts +0 -10
  428. /package/api/{types/AddedFact.js → resources/graph/client/requests/AddDataRequest.js} +0 -0
  429. /package/api/{types/ClassifySessionResponse.js → resources/graph/client/requests/GraphSearchQuery.js} +0 -0
  430. /package/api/{types/DocumentCollectionResponse.js → resources/graph/resources/episode/client/requests/EpisodeGetByGroupIdRequest.js} +0 -0
  431. /package/api/{types/DocumentResponse.js → resources/graph/resources/episode/client/requests/EpisodeGetByUserIdRequest.js} +0 -0
  432. /package/api/{types/DocumentSearchResult.js → resources/group/client/requests/CreateGroupRequest.js} +0 -0
  433. /package/api/types/{DocumentSearchResultPage.js → ApidataDocument.js} +0 -0
  434. /package/{dist/api/types/AddedFact.js → api/types/ApidataDocumentCollection.js} +0 -0
  435. /package/{dist/api/types/ClassifySessionResponse.js → api/types/ApidataDocumentSearchResponse.js} +0 -0
  436. /package/{dist/api/types/DocumentCollectionResponse.js → api/types/ApidataDocumentWithScore.js} +0 -0
  437. /package/{dist/api/types/DocumentResponse.js → api/types/EntityEdge.js} +0 -0
  438. /package/{dist/api/types/DocumentSearchResult.js → api/types/EntityNode.js} +0 -0
  439. /package/{dist/api/types/DocumentSearchResultPage.js → api/types/Episode.js} +0 -0
@@ -0,0 +1,297 @@
1
+ import { RoleType } from "../../src/api/";
2
+
3
+ export const history: {
4
+ role: string;
5
+ role_type: RoleType;
6
+ content: string;
7
+ }[][] = [
8
+ // Conversation 1: Japan
9
+ [
10
+ {
11
+ role: "Paul",
12
+ role_type: "user",
13
+ content: "Hi, I'm planning a vacation to Japan. Can you give me some advice?",
14
+ },
15
+ {
16
+ role: "assistant",
17
+ role_type: "assistant",
18
+ content: "Of course! Japan is a fascinating destination. Are you more interested in modern cities like Tokyo, or historical sites like Kyoto?",
19
+ },
20
+ {
21
+ role: "Paul",
22
+ role_type: "user",
23
+ content: "I think I'd like to experience both. Can you suggest an itinerary?",
24
+ },
25
+ {
26
+ role: "assistant",
27
+ role_type: "assistant",
28
+ content: "Certainly! You could start with 3 days in Tokyo, then take the bullet train to Kyoto for 3 days. This way, you'll experience both the modern and traditional aspects of Japan.",
29
+ },
30
+ {
31
+ role: "Paul",
32
+ role_type: "user",
33
+ content: "That sounds perfect! What are some must-visit places in Tokyo?",
34
+ },
35
+ ],
36
+ // Conversation 2: Italy
37
+ [
38
+ {
39
+ role: "Paul",
40
+ role_type: "user",
41
+ content: "I'm thinking about visiting Italy next summer. Any recommendations?",
42
+ },
43
+ {
44
+ role: "assistant",
45
+ role_type: "assistant",
46
+ content: "Italy is a wonderful choice! Are you more interested in art and history, or would you prefer to focus on food and wine experiences?",
47
+ },
48
+ {
49
+ role: "Paul",
50
+ role_type: "user",
51
+ content: "I love both, but I think I'm leaning towards the food and wine experiences.",
52
+ },
53
+ {
54
+ role: "assistant",
55
+ role_type: "assistant",
56
+ content: "Great! In that case, you might want to consider regions like Tuscany or Emilia-Romagna. Would you like more information about these areas?",
57
+ },
58
+ {
59
+ role: "Paul",
60
+ role_type: "user",
61
+ content: "Yes, please tell me more about Tuscany. What are some must-try dishes and wines there?",
62
+ },
63
+ ],
64
+ [
65
+ {
66
+ role: "Paul",
67
+ role_type: "user",
68
+ content: "Apples are my favorite fruit",
69
+ },
70
+ {
71
+ role: "Paul",
72
+ role_type: "user",
73
+ content: "now bananas are my favorite fruit",
74
+ },
75
+ {
76
+ role: "Paul",
77
+ role_type: "user",
78
+ content: "Eric Clapton is my favorite guitarist",
79
+ },
80
+ ],
81
+ // Conversation 3: US Road Trip
82
+ [
83
+ {
84
+ role: "Paul",
85
+ role_type: "user",
86
+ content: "I'm thinking about taking a road trip across the United States. Any suggestions?",
87
+ },
88
+ {
89
+ role: "assistant",
90
+ role_type: "assistant",
91
+ content: "That sounds exciting! A cross-country road trip can be an amazing experience. Do you have any specific regions or landmarks you'd like to see?",
92
+ },
93
+ {
94
+ role: "Paul",
95
+ role_type: "user",
96
+ content: "I'd love to see some national parks and maybe hit a few major cities. I'm starting from New York.",
97
+ },
98
+ {
99
+ role: "assistant",
100
+ role_type: "assistant",
101
+ content: "Great! How about a route that takes you through some major cities and national parks? We could plan a route from New York to California, hitting spots like Chicago, Yellowstone, and the Grand Canyon along the way.",
102
+ },
103
+ {
104
+ role: "Paul",
105
+ role_type: "user",
106
+ content: "That sounds perfect! How long do you think a trip like that would take?",
107
+ },
108
+ {
109
+ role: "assistant",
110
+ role_type: "assistant",
111
+ content: "A trip like that could take anywhere from 2-4 weeks, depending on how much time you want to spend at each location. Would you prefer a faster-paced trip or a more leisurely one?",
112
+ },
113
+ {
114
+ role: "Paul",
115
+ role_type: "user",
116
+ content: "I think I'd prefer a more leisurely pace. Let's aim for about 3 weeks. Can you break down a potential itinerary?",
117
+ },
118
+ {
119
+ role: "assistant",
120
+ role_type: "assistant",
121
+ content: "Certainly! Here's a rough 3-week itinerary: Days 1-2: New York to Chicago, Days 3-4: Chicago, Days 5-7: Drive to and explore Yellowstone, Days 8-10: Drive to and explore Grand Canyon, Days 11-13: Las Vegas and Death Valley, Days 14-16: Drive to and explore Yosemite, Days 17-19: San Francisco, Days 20-21: Drive down the Pacific Coast Highway to Los Angeles.",
122
+ },
123
+ {
124
+ role: "Paul",
125
+ role_type: "user",
126
+ content: "That sounds amazing! What kind of vehicle would you recommend for a trip like this?",
127
+ },
128
+ {
129
+ role: "assistant",
130
+ role_type: "assistant",
131
+ content: "For a long road trip like this, comfort and reliability are key. A mid-size SUV could be a good choice. It offers space for luggage, comfort for long drives, and can handle various road conditions you might encounter in national parks.",
132
+ },
133
+ {
134
+ role: "Paul",
135
+ role_type: "user",
136
+ content: "Good idea. Are there any specific preparations I should make for the national parks?",
137
+ },
138
+ {
139
+ role: "assistant",
140
+ role_type: "assistant",
141
+ content: "Absolutely! For national parks, it's a good idea to get an America the Beautiful Pass, which covers entrance fees to all national parks for a year. Also, make reservations for campsites or lodges well in advance, especially for popular parks like Yellowstone and Yosemite.",
142
+ },
143
+ {
144
+ role: "Paul",
145
+ role_type: "user",
146
+ content: "Great tip about the pass! What about food? Should I plan to cook or eat out mostly?",
147
+ },
148
+ {
149
+ role: "assistant",
150
+ role_type: "assistant",
151
+ content: "A mix of both can be good. In cities, you'll want to try local cuisines. For national parks, having some cooking equipment can save money and be convenient. Maybe plan to cook simple meals while camping and eat out in cities or when you want to treat yourself.",
152
+ },
153
+ {
154
+ role: "Paul",
155
+ role_type: "user",
156
+ content: "That makes sense. Are there any must-try foods in the cities we'll be visiting?",
157
+ },
158
+ {
159
+ role: "assistant",
160
+ role_type: "assistant",
161
+ content: "Absolutely! In Chicago, try deep-dish pizza and a Chicago-style hot dog. In San Francisco, don't miss the clam chowder in a sourdough bread bowl at Fisherman's Wharf. Las Vegas has world-class restaurants from celebrity chefs. And in Los Angeles, try some authentic tacos or Korean BBQ.",
162
+ },
163
+ {
164
+ role: "Paul",
165
+ role_type: "user",
166
+ content: "Yum! Now, what about budgeting? How much should I expect to spend on a trip like this?",
167
+ },
168
+ {
169
+ role: "assistant",
170
+ role_type: "assistant",
171
+ content: "Budget can vary widely, but for a 3-week trip, you might budget around $4000-$6000 for one person. This would cover gas, accommodations, food, and some activities. You can save by camping in national parks and cooking some meals, or spend more for hotels and restaurants.",
172
+ },
173
+ {
174
+ role: "Paul",
175
+ role_type: "user",
176
+ content: "That's helpful, thanks. Last question: what are some essential items I shouldn't forget to pack?",
177
+ },
178
+ {
179
+ role: "assistant",
180
+ role_type: "assistant",
181
+ content: "Great question! Don't forget: a good map or GPS, first-aid kit, flashlight, multi-tool, reusable water bottles, sunscreen, insect repellent, comfortable hiking shoes, and layers of clothing for various climates. Also, a camera to capture memories, and portable chargers for your devices.",
182
+ },
183
+ {
184
+ role: "Paul",
185
+ role_type: "user",
186
+ content: "Perfect, I think I'm all set to start planning in detail. Thanks for all your help!",
187
+ },
188
+ {
189
+ role: "assistant",
190
+ role_type: "assistant",
191
+ content: "You're welcome, Paul! Enjoy your epic road trip across the US. Don't hesitate to ask if you need any more advice as you plan. Safe travels!",
192
+ },
193
+ ],
194
+ // Conversation 4: Alex's personal information
195
+ [
196
+ {
197
+ role: "Alex",
198
+ role_type: "user",
199
+ content: "Hi there! I thought I'd share some facts about myself today.",
200
+ },
201
+ {
202
+ role: "assistant",
203
+ role_type: "assistant",
204
+ content: "That's great, Alex! I'd love to learn more about you. Please, go ahead and share whatever you're comfortable with.",
205
+ },
206
+ {
207
+ role: "Alex",
208
+ role_type: "user",
209
+ content: "Well, I'm 28 years old and I work as a software engineer at a tech startup.",
210
+ },
211
+ {
212
+ role: "assistant",
213
+ role_type: "assistant",
214
+ content: "That's interesting! Software engineering is a dynamic field. How long have you been working in this role?",
215
+ },
216
+ {
217
+ role: "Alex",
218
+ role_type: "user",
219
+ content: "I've been in this role for about 3 years now. Before that, I studied Computer Science at UCLA.",
220
+ },
221
+ {
222
+ role: "assistant",
223
+ role_type: "assistant",
224
+ content: "UCLA is a great school! Do you have any hobbies or interests outside of work?",
225
+ },
226
+ {
227
+ role: "Alex",
228
+ role_type: "user",
229
+ content: "Yes, I'm really into rock climbing. I try to go to the climbing gym at least twice a week, and I love outdoor climbing trips when I can manage them.",
230
+ },
231
+ {
232
+ role: "assistant",
233
+ role_type: "assistant",
234
+ content: "Rock climbing sounds exciting! It's a great way to stay active and challenge yourself. Have you been on any memorable climbing trips recently?",
235
+ },
236
+ {
237
+ role: "Alex",
238
+ role_type: "user",
239
+ content: "Actually, yes! I just got back from a trip to Joshua Tree National Park. The rock formations there are amazing for bouldering.",
240
+ },
241
+ {
242
+ role: "assistant",
243
+ role_type: "assistant",
244
+ content: "Joshua Tree is beautiful! It's wonderful that you can combine your love for the outdoors with your hobby. Do you have any other interests or things you're passionate about?",
245
+ },
246
+ {
247
+ role: "Alex",
248
+ role_type: "user",
249
+ content: "I'm also really into cooking. I love trying out new recipes, especially dishes from different cultures. Last week, I attempted to make sushi for the first time!",
250
+ },
251
+ {
252
+ role: "assistant",
253
+ role_type: "assistant",
254
+ content: "Cooking is a great skill to have! How did your sushi-making attempt go? It can be quite challenging for beginners.",
255
+ },
256
+ {
257
+ role: "Alex",
258
+ role_type: "user",
259
+ content: "It was definitely a learning experience! The rolls weren't as tight as I'd like, but the flavor was good. I'm determined to keep practicing.",
260
+ },
261
+ {
262
+ role: "assistant",
263
+ role_type: "assistant",
264
+ content: "That's a great attitude! Practice makes perfect. Is there anything else you'd like to share about yourself?",
265
+ },
266
+ {
267
+ role: "Alex",
268
+ role_type: "user",
269
+ content: "Well, I'm originally from Boston, but I moved to San Francisco for work about 5 years ago. I love the tech scene here, but I do miss the changing seasons back east.",
270
+ },
271
+ {
272
+ role: "assistant",
273
+ role_type: "assistant",
274
+ content: "Moving across the country is a big change! San Francisco and Boston are quite different. Do you get to visit your hometown often?",
275
+ },
276
+ {
277
+ role: "Alex",
278
+ role_type: "user",
279
+ content: "I try to go back for the holidays each year. Oh, and I should mention, I have a rescue dog named Pixel. She's a mix of who-knows-what, but she's the best companion I could ask for.",
280
+ },
281
+ {
282
+ role: "assistant",
283
+ role_type: "assistant",
284
+ content: "Pixel sounds lovely! Rescue dogs often make the most loyal companions. Does she join you on any of your outdoor adventures?",
285
+ },
286
+ {
287
+ role: "Alex",
288
+ role_type: "user",
289
+ content: "She does! Pixel loves hiking, and she's even been camping with me a few times. She's not much for rock climbing though - she prefers to watch from the ground.",
290
+ },
291
+ {
292
+ role: "assistant",
293
+ role_type: "assistant",
294
+ content: "It's great that you and Pixel can share outdoor experiences together. Thank you for sharing all these interesting facts about yourself, Alex. You seem to lead a rich and varied life!",
295
+ },
296
+ ],
297
+ ];
@@ -0,0 +1,61 @@
1
+ import { v4 as uuidv4 } from 'uuid';
2
+ import { ZepClient } from '../../src';
3
+
4
+ const API_KEY = process.env.ZEP_API_KEY;
5
+
6
+ async function main() {
7
+ const client = new ZepClient({
8
+ apiKey: API_KEY,
9
+ });
10
+
11
+ const groupId = uuidv4();
12
+ console.log(`Creating group ${groupId}...`);
13
+ const group = await client.group.add({
14
+ groupId: groupId,
15
+ name: "My Group",
16
+ description: "This is my group",
17
+ });
18
+ console.log(`Group ${groupId} created`, group);
19
+
20
+ console.log(`Adding episode to group ${groupId}...`);
21
+ await client.graph.add({
22
+ groupId: groupId,
23
+ type: "text",
24
+ data: "This is a test episode",
25
+ });
26
+
27
+ console.log(`Adding more meaningful episode to group ${groupId}...`);
28
+ await client.graph.add({
29
+ groupId: groupId,
30
+ type: "text",
31
+ data: "Eric Clapton is a rock star",
32
+ });
33
+
34
+ console.log(`Adding a JSON episode to group ${groupId}...`);
35
+ const jsonString = '{"name": "Eric Clapton", "age": 78, "genre": "Rock"}';
36
+ await client.graph.add({
37
+ groupId: groupId,
38
+ type: "json",
39
+ data: jsonString,
40
+ });
41
+
42
+ console.log("Waiting for the graph to be updated...");
43
+ await new Promise(resolve => setTimeout(resolve, 10000));
44
+
45
+ console.log(`Getting nodes from group ${groupId}...`);
46
+ const nodes = await client.graph.node.getByGroupId(groupId);
47
+ console.log(`Nodes from group ${groupId}`, nodes);
48
+
49
+ console.log(`Getting edges from group ${groupId}...`);
50
+ const edges = await client.graph.edge.getByGroupId(groupId);
51
+ console.log(`Edges from group ${groupId}`, edges);
52
+
53
+ console.log(`Searching group ${groupId}...`);
54
+ const searchResults = await client.graph.search({
55
+ groupId: groupId,
56
+ query: "Eric Clapton",
57
+ });
58
+ console.log(`Search results from group ${groupId}`, searchResults);
59
+ }
60
+
61
+ main().catch(console.error);
@@ -0,0 +1,158 @@
1
+ import { v4 as uuidv4 } from 'uuid';
2
+ import { ZepClient } from '../../src';
3
+ import { CreateUserRequest, Message } from '../../src/api';
4
+
5
+ import { history } from './conversations';
6
+
7
+ const API_KEY = process.env.ZEP_API_KEY
8
+
9
+ async function main() {
10
+ const client = new ZepClient({
11
+ apiKey: API_KEY,
12
+ });
13
+
14
+ const userId = uuidv4();
15
+ const sessionId = uuidv4();
16
+
17
+ // Create a user
18
+ const userRequest: CreateUserRequest = {
19
+ userId: userId,
20
+ firstName: 'Paul',
21
+ };
22
+ await client.user.add(userRequest);
23
+ console.log(`User ${userId} created`);
24
+
25
+ // Create a session
26
+ await client.memory.addSession({
27
+ sessionId: sessionId,
28
+ userId: userId,
29
+ });
30
+ console.log(`Session ${sessionId} created`);
31
+
32
+ // Add messages to the session
33
+ for (const message of history[2]) {
34
+ await client.memory.add(sessionId, {
35
+ messages: [
36
+ {
37
+ role: message.role,
38
+ roleType: message.role_type,
39
+ content: message.content,
40
+ } as Message,
41
+ ],
42
+ });
43
+ }
44
+
45
+ console.log("Waiting for the graph to be updated...");
46
+ await new Promise(resolve => setTimeout(resolve, 10000));
47
+
48
+ console.log("Getting memory for session");
49
+ const sessionMemory = await client.memory.get(sessionId);
50
+ console.log(sessionMemory);
51
+
52
+ console.log("Searching user memory...");
53
+ const searchResults = await client.memory.searchSessions({
54
+ userId: userId,
55
+ text: "What is the weather in San Francisco?",
56
+ searchScope: "facts",
57
+ });
58
+ console.log(searchResults);
59
+
60
+ console.log("Getting episodes for user");
61
+ const episodeResult = await client.graph.episode.getByUserId(userId, { lastn: 3 });
62
+ const episodes = episodeResult.episodes;
63
+ console.log(`Episodes for user ${userId}:`);
64
+ console.log(episodes);
65
+
66
+ if (episodes && episodes.length > 0) {
67
+ const episode = await client.graph.episode.get(episodes[0].uuid!);
68
+ console.log(episode);
69
+ }
70
+
71
+ const edges = await client.graph.edge.getByUserId(userId);
72
+ console.log(`Edges for user ${userId}:`);
73
+ console.log(edges);
74
+
75
+ if (edges && edges.length > 0) {
76
+ const edge = await client.graph.edge.get(edges[0].uuid);
77
+ console.log(edge);
78
+ }
79
+
80
+ const nodes = await client.graph.node.getByUserId(userId);
81
+ console.log(`Nodes for user ${userId}:`);
82
+ console.log(nodes);
83
+
84
+ if (nodes && nodes.length > 0) {
85
+ const node = await client.graph.node.get(nodes[0].uuid);
86
+ console.log(node);
87
+ }
88
+
89
+ console.log("Searching user graph memory...");
90
+ const graphSearchResults = await client.graph.search({
91
+ userId: userId,
92
+ query: "What is the weather in San Francisco?",
93
+ });
94
+ console.log(graphSearchResults.edges);
95
+
96
+ console.log("Adding a new text episode to the graph...");
97
+ await client.graph.add({
98
+ userId: userId,
99
+ type: "text",
100
+ data: "The user is an avid fan of Eric Clapton",
101
+ });
102
+ console.log("Text episode added");
103
+
104
+ console.log("Adding a new JSON episode to the graph...");
105
+ const jsonString = '{"name": "Eric Clapton", "age": 78, "genre": "Rock"}';
106
+ await client.graph.add({
107
+ userId: userId,
108
+ type: "json",
109
+ data: jsonString,
110
+ });
111
+ console.log("JSON episode added");
112
+
113
+ console.log("Adding a new message episode to the graph...");
114
+ const message = "Paul (user): I went to Eric Clapton concert last night";
115
+ await client.graph.add({
116
+ userId: userId,
117
+ type: "message",
118
+ data: message,
119
+ });
120
+ console.log("Message episode added");
121
+
122
+ console.log("Waiting for the graph to be updated...");
123
+ await new Promise(resolve => setTimeout(resolve, 30000));
124
+
125
+ console.log("Getting nodes from the graph...");
126
+ const updatedNodes = await client.graph.node.getByUserId(userId);
127
+ console.log(updatedNodes);
128
+
129
+ console.log("Finding Eric Clapton in the graph...");
130
+ const claptonNode = updatedNodes.find(node => node.name === "Eric Clapton");
131
+ console.log(claptonNode);
132
+
133
+ if (claptonNode) {
134
+ console.log("Performing Eric Clapton centered edge search...");
135
+ const edgeSearchResults = await client.graph.search({
136
+ userId: userId,
137
+ query: "Eric Clapton",
138
+ centerNodeUuid: claptonNode.uuid,
139
+ scope: "edges",
140
+ });
141
+ console.log(edgeSearchResults.edges);
142
+
143
+ console.log("Performing Eric Clapton centered node search...");
144
+ const nodeSearchResults = await client.graph.search({
145
+ userId: userId,
146
+ query: "Eric Clapton",
147
+ centerNodeUuid: claptonNode.uuid,
148
+ scope: "nodes",
149
+ });
150
+ console.log(nodeSearchResults.nodes);
151
+ }
152
+
153
+ console.log("Getting all user facts");
154
+ const userFacts = await client.user.getFacts(userId);
155
+ console.log(userFacts.facts);
156
+ }
157
+
158
+ main().catch(console.error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getzep/zep-cloud",
3
- "version": "1.0.11",
3
+ "version": "2.0.0-rc.1",
4
4
  "private": false,
5
5
  "repository": "https://github.com/getzep/zep-js",
6
6
  "description": "Zep: Fast, scalable building blocks for production LLM apps",
@@ -20,8 +20,8 @@
20
20
  "zod": "^3.23.8"
21
21
  },
22
22
  "peerDependencies": {
23
- "@langchain/core": ">=0.1.29 <0.3.0",
24
- "langchain": ">=0.1.19 <0.3.0"
23
+ "@langchain/core": ">=0.1.29 <0.4.0",
24
+ "langchain": ">=0.1.19 <0.4.0"
25
25
  },
26
26
  "peerDependenciesMeta": {
27
27
  "langchain": {
@@ -33,7 +33,6 @@
33
33
  },
34
34
  "devDependencies": {
35
35
  "@faker-js/faker": "^8.4.1",
36
- "@langchain/openai": "0.0.28",
37
36
  "@types/jest": "^29.5.12",
38
37
  "@types/node": "17.0.33",
39
38
  "@types/node-fetch": "2.6.9",
@@ -41,10 +40,11 @@
41
40
  "@types/url-join": "4.0.1",
42
41
  "jest": "^29.7.0",
43
42
  "langchain": "0.1.19",
43
+ "@langchain/openai": "0.0.28",
44
44
  "nock": "^13.5.4",
45
45
  "prettier": "2.7.1",
46
46
  "ts-jest": "^29.1.4",
47
47
  "ts-node": "^10.9.2",
48
48
  "typescript": "4.6.4"
49
49
  }
50
- }
50
+ }
@@ -9,7 +9,7 @@ export declare const Request: core.serialization.Schema<serializers.document.add
9
9
  export declare namespace Request {
10
10
  type Raw = CreateDocumentRequest.Raw[];
11
11
  }
12
- export declare const Response: core.serialization.Schema<serializers.document.addDocuments.Response.Raw, string[]>;
12
+ export declare const Response: core.serialization.Schema<serializers.document.addDocuments.Response.Raw, string[][]>;
13
13
  export declare namespace Response {
14
- type Raw = string[];
14
+ type Raw = string[][];
15
15
  }
@@ -30,4 +30,4 @@ exports.Response = exports.Request = void 0;
30
30
  const core = __importStar(require("../../../../core"));
31
31
  const CreateDocumentRequest_1 = require("../../../types/CreateDocumentRequest");
32
32
  exports.Request = core.serialization.list(CreateDocumentRequest_1.CreateDocumentRequest);
33
- exports.Response = core.serialization.list(core.serialization.string());
33
+ exports.Response = core.serialization.list(core.serialization.list(core.serialization.string()));
@@ -4,8 +4,8 @@
4
4
  import * as serializers from "../../../index";
5
5
  import * as Zep from "../../../../api/index";
6
6
  import * as core from "../../../../core";
7
- import { DocumentResponse } from "../../../types/DocumentResponse";
8
- export declare const Response: core.serialization.Schema<serializers.document.batchGetDocuments.Response.Raw, Zep.DocumentResponse[]>;
7
+ import { ApidataDocument } from "../../../types/ApidataDocument";
8
+ export declare const Response: core.serialization.Schema<serializers.document.batchGetDocuments.Response.Raw, Zep.ApidataDocument[][]>;
9
9
  export declare namespace Response {
10
- type Raw = DocumentResponse.Raw[];
10
+ type Raw = ApidataDocument.Raw[][];
11
11
  }
@@ -28,5 +28,5 @@ var __importStar = (this && this.__importStar) || function (mod) {
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
29
  exports.Response = void 0;
30
30
  const core = __importStar(require("../../../../core"));
31
- const DocumentResponse_1 = require("../../../types/DocumentResponse");
32
- exports.Response = core.serialization.list(DocumentResponse_1.DocumentResponse);
31
+ const ApidataDocument_1 = require("../../../types/ApidataDocument");
32
+ exports.Response = core.serialization.list(core.serialization.list(ApidataDocument_1.ApidataDocument));
@@ -4,8 +4,8 @@
4
4
  import * as serializers from "../../../index";
5
5
  import * as Zep from "../../../../api/index";
6
6
  import * as core from "../../../../core";
7
- import { DocumentCollectionResponse } from "../../../types/DocumentCollectionResponse";
8
- export declare const Response: core.serialization.Schema<serializers.document.listCollections.Response.Raw, Zep.DocumentCollectionResponse[][]>;
7
+ import { ApidataDocumentCollection } from "../../../types/ApidataDocumentCollection";
8
+ export declare const Response: core.serialization.Schema<serializers.document.listCollections.Response.Raw, Zep.ApidataDocumentCollection[][]>;
9
9
  export declare namespace Response {
10
- type Raw = DocumentCollectionResponse.Raw[][];
10
+ type Raw = ApidataDocumentCollection.Raw[][];
11
11
  }
@@ -28,5 +28,5 @@ var __importStar = (this && this.__importStar) || function (mod) {
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
29
  exports.Response = void 0;
30
30
  const core = __importStar(require("../../../../core"));
31
- const DocumentCollectionResponse_1 = require("../../../types/DocumentCollectionResponse");
32
- exports.Response = core.serialization.list(core.serialization.list(DocumentCollectionResponse_1.DocumentCollectionResponse));
31
+ const ApidataDocumentCollection_1 = require("../../../types/ApidataDocumentCollection");
32
+ exports.Response = core.serialization.list(core.serialization.list(ApidataDocumentCollection_1.ApidataDocumentCollection));
@@ -0,0 +1 @@
1
+ export * from "./requests";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./requests"), exports);
@@ -0,0 +1,16 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as serializers from "../../../../index";
5
+ import * as Zep from "../../../../../api/index";
6
+ import * as core from "../../../../../core";
7
+ import { GraphDataType } from "../../../../types/GraphDataType";
8
+ export declare const AddDataRequest: core.serialization.Schema<serializers.AddDataRequest.Raw, Zep.AddDataRequest>;
9
+ export declare namespace AddDataRequest {
10
+ interface Raw {
11
+ data?: string | null;
12
+ group_id?: string | null;
13
+ type?: GraphDataType.Raw | null;
14
+ user_id?: string | null;
15
+ }
16
+ }