usecortex-ai 0.3.5__py3-none-any.whl → 0.4.0__py3-none-any.whl

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 (103) hide show
  1. usecortex_ai/__init__.py +84 -66
  2. usecortex_ai/client.py +25 -23
  3. usecortex_ai/dashboard/client.py +448 -0
  4. usecortex_ai/{user_memory → dashboard}/raw_client.py +371 -530
  5. usecortex_ai/embeddings/client.py +229 -102
  6. usecortex_ai/embeddings/raw_client.py +323 -211
  7. usecortex_ai/errors/__init__.py +2 -0
  8. usecortex_ai/errors/bad_request_error.py +1 -2
  9. usecortex_ai/errors/forbidden_error.py +1 -2
  10. usecortex_ai/errors/internal_server_error.py +1 -2
  11. usecortex_ai/errors/not_found_error.py +1 -2
  12. usecortex_ai/errors/service_unavailable_error.py +1 -2
  13. usecortex_ai/errors/too_many_requests_error.py +11 -0
  14. usecortex_ai/errors/unauthorized_error.py +1 -2
  15. usecortex_ai/fetch/client.py +350 -29
  16. usecortex_ai/fetch/raw_client.py +919 -65
  17. usecortex_ai/raw_client.py +8 -2
  18. usecortex_ai/search/client.py +293 -257
  19. usecortex_ai/search/raw_client.py +445 -346
  20. usecortex_ai/search/types/alpha.py +1 -1
  21. usecortex_ai/sources/client.py +29 -216
  22. usecortex_ai/sources/raw_client.py +51 -589
  23. usecortex_ai/tenant/client.py +155 -118
  24. usecortex_ai/tenant/raw_client.py +227 -350
  25. usecortex_ai/types/__init__.py +78 -62
  26. usecortex_ai/types/add_memory_response.py +39 -0
  27. usecortex_ai/types/{relations.py → api_key_info.py} +25 -5
  28. usecortex_ai/types/app_sources_upload_data.py +15 -6
  29. usecortex_ai/types/{file_upload_result.py → collection_stats.py} +5 -5
  30. usecortex_ai/types/custom_property_definition.py +75 -0
  31. usecortex_ai/types/dashboard_apis_response.py +33 -0
  32. usecortex_ai/types/dashboard_sources_response.py +33 -0
  33. usecortex_ai/types/dashboard_tenants_response.py +33 -0
  34. usecortex_ai/types/{list_sources_response.py → delete_result.py} +10 -7
  35. usecortex_ai/types/delete_user_memory_response.py +1 -1
  36. usecortex_ai/types/entity.py +4 -4
  37. usecortex_ai/types/fetch_mode.py +5 -0
  38. usecortex_ai/types/graph_context.py +26 -0
  39. usecortex_ai/types/{delete_sources.py → infra.py} +4 -3
  40. usecortex_ai/types/{fetch_content_data.py → insert_result.py} +12 -8
  41. usecortex_ai/types/memory_item.py +82 -0
  42. usecortex_ai/types/memory_result_item.py +47 -0
  43. usecortex_ai/types/milvus_data_type.py +21 -0
  44. usecortex_ai/types/{related_chunk.py → path_triplet.py} +6 -5
  45. usecortex_ai/types/processing_status.py +3 -2
  46. usecortex_ai/types/processing_status_indexing_status.py +7 -0
  47. usecortex_ai/types/qn_a_search_response.py +49 -0
  48. usecortex_ai/types/{retrieve_response.py → raw_embedding_document.py} +11 -8
  49. usecortex_ai/types/raw_embedding_search_result.py +47 -0
  50. usecortex_ai/types/{user_memory.py → raw_embedding_vector.py} +6 -6
  51. usecortex_ai/types/relation_evidence.py +20 -0
  52. usecortex_ai/types/retrieval_result.py +26 -0
  53. usecortex_ai/types/scored_path_response.py +26 -0
  54. usecortex_ai/types/search_mode.py +5 -0
  55. usecortex_ai/types/{batch_upload_data.py → source_delete_response.py} +8 -8
  56. usecortex_ai/types/{list_user_memories_response.py → source_delete_result_item.py} +11 -7
  57. usecortex_ai/types/source_fetch_response.py +70 -0
  58. usecortex_ai/types/{graph_relations_response.py → source_graph_relations_response.py} +3 -3
  59. usecortex_ai/types/{single_upload_data.py → source_list_response.py} +7 -10
  60. usecortex_ai/types/source_model.py +11 -1
  61. usecortex_ai/types/source_status.py +5 -0
  62. usecortex_ai/types/source_upload_response.py +35 -0
  63. usecortex_ai/types/source_upload_result_item.py +38 -0
  64. usecortex_ai/types/supported_llm_providers.py +5 -0
  65. usecortex_ai/types/{embeddings_create_collection_data.py → tenant_create_response.py} +9 -7
  66. usecortex_ai/types/{extended_context.py → tenant_info.py} +13 -4
  67. usecortex_ai/types/{embeddings_search_data.py → tenant_metadata_schema_info.py} +8 -9
  68. usecortex_ai/types/{tenant_create_data.py → tenant_stats_response.py} +9 -8
  69. usecortex_ai/types/{triple_with_evidence.py → triplet_with_evidence.py} +1 -1
  70. usecortex_ai/types/user_assistant_pair.py +4 -0
  71. usecortex_ai/types/{search_chunk.py → vector_store_chunk.py} +3 -9
  72. usecortex_ai/upload/__init__.py +3 -0
  73. usecortex_ai/upload/client.py +233 -1937
  74. usecortex_ai/upload/raw_client.py +364 -4401
  75. usecortex_ai/upload/types/__init__.py +7 -0
  76. usecortex_ai/upload/types/body_upload_app_ingestion_upload_app_post_app_sources.py +7 -0
  77. {usecortex_ai-0.3.5.dist-info → usecortex_ai-0.4.0.dist-info}/METADATA +2 -2
  78. usecortex_ai-0.4.0.dist-info/RECORD +113 -0
  79. {usecortex_ai-0.3.5.dist-info → usecortex_ai-0.4.0.dist-info}/WHEEL +1 -1
  80. usecortex_ai/document/client.py +0 -139
  81. usecortex_ai/document/raw_client.py +0 -312
  82. usecortex_ai/types/add_user_memory_response.py +0 -41
  83. usecortex_ai/types/body_scrape_webpage_upload_scrape_webpage_post.py +0 -17
  84. usecortex_ai/types/body_update_scrape_job_upload_update_webpage_patch.py +0 -17
  85. usecortex_ai/types/delete_memory_request.py +0 -32
  86. usecortex_ai/types/delete_sub_tenant_data.py +0 -42
  87. usecortex_ai/types/embeddings_delete_data.py +0 -37
  88. usecortex_ai/types/embeddings_get_data.py +0 -37
  89. usecortex_ai/types/markdown_upload_request.py +0 -41
  90. usecortex_ai/types/retrieve_user_memory_response.py +0 -38
  91. usecortex_ai/types/source.py +0 -52
  92. usecortex_ai/types/sub_tenant_ids_data.py +0 -47
  93. usecortex_ai/types/tenant_stats.py +0 -42
  94. usecortex_ai/types/webpage_scrape_request.py +0 -27
  95. usecortex_ai/user/__init__.py +0 -4
  96. usecortex_ai/user/client.py +0 -145
  97. usecortex_ai/user/raw_client.py +0 -316
  98. usecortex_ai/user_memory/__init__.py +0 -4
  99. usecortex_ai/user_memory/client.py +0 -515
  100. usecortex_ai-0.3.5.dist-info/RECORD +0 -108
  101. /usecortex_ai/{document → dashboard}/__init__.py +0 -0
  102. {usecortex_ai-0.3.5.dist-info → usecortex_ai-0.4.0.dist-info}/licenses/LICENSE +0 -0
  103. {usecortex_ai-0.3.5.dist-info → usecortex_ai-0.4.0.dist-info}/top_level.txt +0 -0
@@ -1,515 +0,0 @@
1
- # This file was auto-generated by Fern from our API Definition.
2
-
3
- import typing
4
-
5
- from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
6
- from ..core.request_options import RequestOptions
7
- from ..types.add_user_memory_response import AddUserMemoryResponse
8
- from ..types.delete_user_memory_response import DeleteUserMemoryResponse
9
- from ..types.list_user_memories_response import ListUserMemoriesResponse
10
- from ..types.retrieve_user_memory_response import RetrieveUserMemoryResponse
11
- from ..types.user_assistant_pair import UserAssistantPair
12
- from .raw_client import AsyncRawUserMemoryClient, RawUserMemoryClient
13
-
14
- # this is used as the default value for optional parameters
15
- OMIT = typing.cast(typing.Any, ...)
16
-
17
-
18
- class UserMemoryClient:
19
- def __init__(self, *, client_wrapper: SyncClientWrapper):
20
- self._raw_client = RawUserMemoryClient(client_wrapper=client_wrapper)
21
-
22
- @property
23
- def with_raw_response(self) -> RawUserMemoryClient:
24
- """
25
- Retrieves a raw implementation of this client that returns raw responses.
26
-
27
- Returns
28
- -------
29
- RawUserMemoryClient
30
- """
31
- return self._raw_client
32
-
33
- def list_user_memories(
34
- self,
35
- *,
36
- tenant_id: str,
37
- sub_tenant_id: typing.Optional[str] = None,
38
- request_options: typing.Optional[RequestOptions] = None,
39
- ) -> ListUserMemoriesResponse:
40
- """
41
- Retrieve all stored user memories for your tenant.
42
-
43
- This endpoint returns a comprehensive list of all user memories that have been stored,
44
- whether they were added manually or generated through AI. User memories help personalize
45
- your experience by storing context, preferences, and important information.
46
-
47
- You can optionally specify a sub-tenant to filter memories within that specific scope.
48
-
49
- Parameters
50
- ----------
51
- tenant_id : str
52
- Unique identifier for the tenant/organization
53
-
54
- sub_tenant_id : typing.Optional[str]
55
- Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
56
-
57
- request_options : typing.Optional[RequestOptions]
58
- Request-specific configuration.
59
-
60
- Returns
61
- -------
62
- ListUserMemoriesResponse
63
- Successful Response
64
-
65
- Examples
66
- --------
67
- from usecortex-ai import CortexAI
68
-
69
- client = CortexAI(token="YOUR_TOKEN", )
70
- client.user_memory.list_user_memories(tenant_id='tenant_1234', sub_tenant_id='sub_tenant_4567', )
71
- """
72
- _response = self._raw_client.list_user_memories(
73
- tenant_id=tenant_id, sub_tenant_id=sub_tenant_id, request_options=request_options
74
- )
75
- return _response.data
76
-
77
- def delete_user_memory(
78
- self,
79
- *,
80
- tenant_id: str,
81
- memory_id: str,
82
- sub_tenant_id: typing.Optional[str] = None,
83
- request_options: typing.Optional[RequestOptions] = None,
84
- ) -> DeleteUserMemoryResponse:
85
- """
86
- Permanently remove a specific user memory from storage.
87
-
88
- This endpoint allows you to delete a user memory by its unique identifier.
89
- Once deleted, the memory cannot be recovered, so use this operation carefully.
90
-
91
- The memory will be removed from your tenant's storage and will no longer
92
- appear in search results or memory listings.
93
-
94
- Parameters
95
- ----------
96
- tenant_id : str
97
- Unique identifier for the tenant/organization
98
-
99
- memory_id : str
100
- Unique identifier of the memory to delete
101
-
102
- sub_tenant_id : typing.Optional[str]
103
- Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
104
-
105
- request_options : typing.Optional[RequestOptions]
106
- Request-specific configuration.
107
-
108
- Returns
109
- -------
110
- DeleteUserMemoryResponse
111
- Successful Response
112
-
113
- Examples
114
- --------
115
- from usecortex-ai import CortexAI
116
-
117
- client = CortexAI(token="YOUR_TOKEN", )
118
- client.user_memory.delete_user_memory(tenant_id='tenant_1234', memory_id='memory_1234', sub_tenant_id='sub_tenant_4567', )
119
- """
120
- _response = self._raw_client.delete_user_memory(
121
- tenant_id=tenant_id, memory_id=memory_id, sub_tenant_id=sub_tenant_id, request_options=request_options
122
- )
123
- return _response.data
124
-
125
- def retrieve_user_memory(
126
- self,
127
- *,
128
- tenant_id: str,
129
- query: str,
130
- sub_tenant_id: typing.Optional[str] = None,
131
- max_count: typing.Optional[int] = None,
132
- user_name: typing.Optional[str] = OMIT,
133
- request_options: typing.Optional[RequestOptions] = None,
134
- ) -> RetrieveUserMemoryResponse:
135
- """
136
- Find relevant user memories using semantic search and knowledge graph.
137
-
138
- This endpoint performs parallel searches:
139
- 1. Semantic search in Weaviate across all stored user memories
140
- 2. Entity-based search in the knowledge graph for memory entities
141
-
142
- Results from both sources are combined and ranked by relevance to provide
143
- comprehensive memory retrieval.
144
-
145
- Parameters
146
- ----------
147
- tenant_id : str
148
- Unique identifier for the tenant/organization
149
-
150
- query : str
151
- Search query to find relevant user memories
152
-
153
- sub_tenant_id : typing.Optional[str]
154
- Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
155
-
156
- max_count : typing.Optional[int]
157
- Maximum number of memories to return (default: 5)
158
-
159
- user_name : typing.Optional[str]
160
- User's name to enhance personalisation
161
-
162
- request_options : typing.Optional[RequestOptions]
163
- Request-specific configuration.
164
-
165
- Returns
166
- -------
167
- RetrieveUserMemoryResponse
168
- Successful Response
169
-
170
- Examples
171
- --------
172
- from usecortex-ai import CortexAI
173
-
174
- client = CortexAI(token="YOUR_TOKEN", )
175
- client.user_memory.retrieve_user_memory(tenant_id='tenant_1234', sub_tenant_id='sub_tenant_4567', max_count=5, query='Which mode does user prefer', )
176
- """
177
- _response = self._raw_client.retrieve_user_memory(
178
- tenant_id=tenant_id,
179
- query=query,
180
- sub_tenant_id=sub_tenant_id,
181
- max_count=max_count,
182
- user_name=user_name,
183
- request_options=request_options,
184
- )
185
- return _response.data
186
-
187
- def add_user_memory(
188
- self,
189
- *,
190
- tenant_id: str,
191
- sub_tenant_id: typing.Optional[str] = None,
192
- raw_text: typing.Optional[str] = OMIT,
193
- user_assistant_pairs: typing.Optional[typing.Sequence[UserAssistantPair]] = OMIT,
194
- expiry_time: typing.Optional[int] = OMIT,
195
- infer: typing.Optional[bool] = OMIT,
196
- custom_instructions: typing.Optional[str] = OMIT,
197
- request_options: typing.Optional[RequestOptions] = None,
198
- ) -> AddUserMemoryResponse:
199
- """
200
- Store new user memories for future reference.
201
-
202
- This endpoint allows you to add memories in two formats:
203
- 1. Raw text string - A single text-based memory
204
- 2. User/Assistant pairs array - Conversation pairs that will be chunked as a single memory
205
-
206
- The stored memories will be chunked, indexed in both Weaviate and the knowledge graph,
207
- and made available for semantic search and graph-based retrieval.
208
-
209
- Parameters
210
- ----------
211
- tenant_id : str
212
- Unique identifier for the tenant/organization
213
-
214
- sub_tenant_id : typing.Optional[str]
215
- Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
216
-
217
- raw_text : typing.Optional[str]
218
- Single raw text memory to store
219
-
220
- user_assistant_pairs : typing.Optional[typing.Sequence[UserAssistantPair]]
221
- Array of user/assistant conversation pairs to store as a single memory
222
-
223
- expiry_time : typing.Optional[int]
224
- Expiry time in seconds for the memory (optional)
225
-
226
- infer : typing.Optional[bool]
227
- If true, process and compress chunks into inferred representations before indexing (default: False)
228
-
229
- custom_instructions : typing.Optional[str]
230
- Custom instructions to guide cortex
231
-
232
- request_options : typing.Optional[RequestOptions]
233
- Request-specific configuration.
234
-
235
- Returns
236
- -------
237
- AddUserMemoryResponse
238
- Successful Response
239
-
240
- Examples
241
- --------
242
- from usecortex-ai import CortexAI
243
-
244
- client = CortexAI(token="YOUR_TOKEN", )
245
- client.user_memory.add_user_memory(tenant_id='tenant_1234', sub_tenant_id='sub_tenant_4567', )
246
- """
247
- _response = self._raw_client.add_user_memory(
248
- tenant_id=tenant_id,
249
- sub_tenant_id=sub_tenant_id,
250
- raw_text=raw_text,
251
- user_assistant_pairs=user_assistant_pairs,
252
- expiry_time=expiry_time,
253
- infer=infer,
254
- custom_instructions=custom_instructions,
255
- request_options=request_options,
256
- )
257
- return _response.data
258
-
259
-
260
- class AsyncUserMemoryClient:
261
- def __init__(self, *, client_wrapper: AsyncClientWrapper):
262
- self._raw_client = AsyncRawUserMemoryClient(client_wrapper=client_wrapper)
263
-
264
- @property
265
- def with_raw_response(self) -> AsyncRawUserMemoryClient:
266
- """
267
- Retrieves a raw implementation of this client that returns raw responses.
268
-
269
- Returns
270
- -------
271
- AsyncRawUserMemoryClient
272
- """
273
- return self._raw_client
274
-
275
- async def list_user_memories(
276
- self,
277
- *,
278
- tenant_id: str,
279
- sub_tenant_id: typing.Optional[str] = None,
280
- request_options: typing.Optional[RequestOptions] = None,
281
- ) -> ListUserMemoriesResponse:
282
- """
283
- Retrieve all stored user memories for your tenant.
284
-
285
- This endpoint returns a comprehensive list of all user memories that have been stored,
286
- whether they were added manually or generated through AI. User memories help personalize
287
- your experience by storing context, preferences, and important information.
288
-
289
- You can optionally specify a sub-tenant to filter memories within that specific scope.
290
-
291
- Parameters
292
- ----------
293
- tenant_id : str
294
- Unique identifier for the tenant/organization
295
-
296
- sub_tenant_id : typing.Optional[str]
297
- Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
298
-
299
- request_options : typing.Optional[RequestOptions]
300
- Request-specific configuration.
301
-
302
- Returns
303
- -------
304
- ListUserMemoriesResponse
305
- Successful Response
306
-
307
- Examples
308
- --------
309
- import asyncio
310
-
311
- from usecortex-ai import AsyncCortexAI
312
-
313
- client = AsyncCortexAI(token="YOUR_TOKEN", )
314
- async def main() -> None:
315
- await client.user_memory.list_user_memories(tenant_id='tenant_1234', sub_tenant_id='sub_tenant_4567', )
316
- asyncio.run(main())
317
- """
318
- _response = await self._raw_client.list_user_memories(
319
- tenant_id=tenant_id, sub_tenant_id=sub_tenant_id, request_options=request_options
320
- )
321
- return _response.data
322
-
323
- async def delete_user_memory(
324
- self,
325
- *,
326
- tenant_id: str,
327
- memory_id: str,
328
- sub_tenant_id: typing.Optional[str] = None,
329
- request_options: typing.Optional[RequestOptions] = None,
330
- ) -> DeleteUserMemoryResponse:
331
- """
332
- Permanently remove a specific user memory from storage.
333
-
334
- This endpoint allows you to delete a user memory by its unique identifier.
335
- Once deleted, the memory cannot be recovered, so use this operation carefully.
336
-
337
- The memory will be removed from your tenant's storage and will no longer
338
- appear in search results or memory listings.
339
-
340
- Parameters
341
- ----------
342
- tenant_id : str
343
- Unique identifier for the tenant/organization
344
-
345
- memory_id : str
346
- Unique identifier of the memory to delete
347
-
348
- sub_tenant_id : typing.Optional[str]
349
- Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
350
-
351
- request_options : typing.Optional[RequestOptions]
352
- Request-specific configuration.
353
-
354
- Returns
355
- -------
356
- DeleteUserMemoryResponse
357
- Successful Response
358
-
359
- Examples
360
- --------
361
- import asyncio
362
-
363
- from usecortex-ai import AsyncCortexAI
364
-
365
- client = AsyncCortexAI(token="YOUR_TOKEN", )
366
- async def main() -> None:
367
- await client.user_memory.delete_user_memory(tenant_id='tenant_1234', memory_id='memory_1234', sub_tenant_id='sub_tenant_4567', )
368
- asyncio.run(main())
369
- """
370
- _response = await self._raw_client.delete_user_memory(
371
- tenant_id=tenant_id, memory_id=memory_id, sub_tenant_id=sub_tenant_id, request_options=request_options
372
- )
373
- return _response.data
374
-
375
- async def retrieve_user_memory(
376
- self,
377
- *,
378
- tenant_id: str,
379
- query: str,
380
- sub_tenant_id: typing.Optional[str] = None,
381
- max_count: typing.Optional[int] = None,
382
- user_name: typing.Optional[str] = OMIT,
383
- request_options: typing.Optional[RequestOptions] = None,
384
- ) -> RetrieveUserMemoryResponse:
385
- """
386
- Find relevant user memories using semantic search and knowledge graph.
387
-
388
- This endpoint performs parallel searches:
389
- 1. Semantic search in Weaviate across all stored user memories
390
- 2. Entity-based search in the knowledge graph for memory entities
391
-
392
- Results from both sources are combined and ranked by relevance to provide
393
- comprehensive memory retrieval.
394
-
395
- Parameters
396
- ----------
397
- tenant_id : str
398
- Unique identifier for the tenant/organization
399
-
400
- query : str
401
- Search query to find relevant user memories
402
-
403
- sub_tenant_id : typing.Optional[str]
404
- Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
405
-
406
- max_count : typing.Optional[int]
407
- Maximum number of memories to return (default: 5)
408
-
409
- user_name : typing.Optional[str]
410
- User's name to enhance personalisation
411
-
412
- request_options : typing.Optional[RequestOptions]
413
- Request-specific configuration.
414
-
415
- Returns
416
- -------
417
- RetrieveUserMemoryResponse
418
- Successful Response
419
-
420
- Examples
421
- --------
422
- import asyncio
423
-
424
- from usecortex-ai import AsyncCortexAI
425
-
426
- client = AsyncCortexAI(token="YOUR_TOKEN", )
427
- async def main() -> None:
428
- await client.user_memory.retrieve_user_memory(tenant_id='tenant_1234', sub_tenant_id='sub_tenant_4567', max_count=5, query='Which mode does user prefer', )
429
- asyncio.run(main())
430
- """
431
- _response = await self._raw_client.retrieve_user_memory(
432
- tenant_id=tenant_id,
433
- query=query,
434
- sub_tenant_id=sub_tenant_id,
435
- max_count=max_count,
436
- user_name=user_name,
437
- request_options=request_options,
438
- )
439
- return _response.data
440
-
441
- async def add_user_memory(
442
- self,
443
- *,
444
- tenant_id: str,
445
- sub_tenant_id: typing.Optional[str] = None,
446
- raw_text: typing.Optional[str] = OMIT,
447
- user_assistant_pairs: typing.Optional[typing.Sequence[UserAssistantPair]] = OMIT,
448
- expiry_time: typing.Optional[int] = OMIT,
449
- infer: typing.Optional[bool] = OMIT,
450
- custom_instructions: typing.Optional[str] = OMIT,
451
- request_options: typing.Optional[RequestOptions] = None,
452
- ) -> AddUserMemoryResponse:
453
- """
454
- Store new user memories for future reference.
455
-
456
- This endpoint allows you to add memories in two formats:
457
- 1. Raw text string - A single text-based memory
458
- 2. User/Assistant pairs array - Conversation pairs that will be chunked as a single memory
459
-
460
- The stored memories will be chunked, indexed in both Weaviate and the knowledge graph,
461
- and made available for semantic search and graph-based retrieval.
462
-
463
- Parameters
464
- ----------
465
- tenant_id : str
466
- Unique identifier for the tenant/organization
467
-
468
- sub_tenant_id : typing.Optional[str]
469
- Optional sub-tenant identifier used to organize data within a tenant. If omitted, the default sub-tenant created during tenant setup will be used.
470
-
471
- raw_text : typing.Optional[str]
472
- Single raw text memory to store
473
-
474
- user_assistant_pairs : typing.Optional[typing.Sequence[UserAssistantPair]]
475
- Array of user/assistant conversation pairs to store as a single memory
476
-
477
- expiry_time : typing.Optional[int]
478
- Expiry time in seconds for the memory (optional)
479
-
480
- infer : typing.Optional[bool]
481
- If true, process and compress chunks into inferred representations before indexing (default: False)
482
-
483
- custom_instructions : typing.Optional[str]
484
- Custom instructions to guide cortex
485
-
486
- request_options : typing.Optional[RequestOptions]
487
- Request-specific configuration.
488
-
489
- Returns
490
- -------
491
- AddUserMemoryResponse
492
- Successful Response
493
-
494
- Examples
495
- --------
496
- import asyncio
497
-
498
- from usecortex-ai import AsyncCortexAI
499
-
500
- client = AsyncCortexAI(token="YOUR_TOKEN", )
501
- async def main() -> None:
502
- await client.user_memory.add_user_memory(tenant_id='tenant_1234', sub_tenant_id='sub_tenant_4567', )
503
- asyncio.run(main())
504
- """
505
- _response = await self._raw_client.add_user_memory(
506
- tenant_id=tenant_id,
507
- sub_tenant_id=sub_tenant_id,
508
- raw_text=raw_text,
509
- user_assistant_pairs=user_assistant_pairs,
510
- expiry_time=expiry_time,
511
- infer=infer,
512
- custom_instructions=custom_instructions,
513
- request_options=request_options,
514
- )
515
- return _response.data
@@ -1,108 +0,0 @@
1
- usecortex_ai/__init__.py,sha256=ihocaNv75jejXPhW9QucLfwC9SLhZbu_T_xHZAWop-g,3234
2
- usecortex_ai/client.py,sha256=i-1RW54MMmplowh9sDAm3W-Nw_mlQyBWHSFmc4XsOKA,9865
3
- usecortex_ai/environment.py,sha256=IZ0X7CTz4V0TzNaMrw6E5GJklcTLxGJmrWEyH-LtYsc,162
4
- usecortex_ai/raw_client.py,sha256=Z2zedJhFwHoO_Zmm2enC_s-gd8SM_itaWZOfL0rSobE,3532
5
- usecortex_ai/core/__init__.py,sha256=lTcqUPXcx4112yLDd70RAPeqq6tu3eFMe1pKOqkW9JQ,1562
6
- usecortex_ai/core/api_error.py,sha256=44vPoTyWN59gonCIZMdzw7M1uspygiLnr3GNFOoVL2Q,614
7
- usecortex_ai/core/client_wrapper.py,sha256=50sko9nNjHmtUmiWiGjJZ3cT9RITCKzfOgvJ55QlwQQ,2681
8
- usecortex_ai/core/datetime_utils.py,sha256=nBys2IsYrhPdszxGKCNRPSOCwa-5DWOHG95FB8G9PKo,1047
9
- usecortex_ai/core/file.py,sha256=d4NNbX8XvXP32z8KpK2Xovv33nFfruIrpz0QWxlgpZk,2663
10
- usecortex_ai/core/force_multipart.py,sha256=cH981xLy0kZVKiZZkFoeUjgJ2Zuq7KXB2aRAnmHzRDc,477
11
- usecortex_ai/core/http_client.py,sha256=QurkBvCZZz2Z1d8znp4M2YbOXebBUPcPXRhPIS84Wvk,21214
12
- usecortex_ai/core/http_response.py,sha256=A6URkoTBCiryctAA-m9EiDWOsHgM5oYAlcYVc_YOiiI,1330
13
- usecortex_ai/core/jsonable_encoder.py,sha256=hGgcEEeX11sqxxsll7h15pO3pTNVxk_n79Kcn0laoWA,3655
14
- usecortex_ai/core/pydantic_utilities.py,sha256=alHZbJORJ1RxtFlr4Aohw47_QAtCeMbcGPgCvxKsfPM,10830
15
- usecortex_ai/core/query_encoder.py,sha256=ekulqNd0j8TgD7ox-Qbz7liqX8-KP9blvT9DsRCenYM,2144
16
- usecortex_ai/core/remove_none_from_dict.py,sha256=EU9SGgYidWq7SexuJbNs4-PZ-5Bl3Vppd864mS6vQZw,342
17
- usecortex_ai/core/request_options.py,sha256=h0QUNCFVdCW_7GclVySCAY2w4NhtXVBUCmHgmzaxpcg,1681
18
- usecortex_ai/core/serialization.py,sha256=ECL3bvv_0i7U4uvPidZCNel--MUbA0iq0aGcNKi3kws,9818
19
- usecortex_ai/document/__init__.py,sha256=_VhToAyIt_5axN6CLJwtxg3-CO7THa_23pbUzqhXJa4,85
20
- usecortex_ai/document/client.py,sha256=byPqef0y0txIaXxFje8eoBkqsU1SkWrvCmPBae1uL5M,4757
21
- usecortex_ai/document/raw_client.py,sha256=VsnkEH-HGz3u2c6tSbQyyz-28LzpnCmakLiR1RGXXN8,12555
22
- usecortex_ai/embeddings/__init__.py,sha256=_VhToAyIt_5axN6CLJwtxg3-CO7THa_23pbUzqhXJa4,85
23
- usecortex_ai/embeddings/client.py,sha256=LWX1zzZjicVb2vYTa-HJJc0VRFY8DSXLfqCPy2hH80Y,13585
24
- usecortex_ai/embeddings/raw_client.py,sha256=YEWMcsWyLOXM3NRKvEAIarSlqumZgAK9QLY1WZZzG-w,44614
25
- usecortex_ai/errors/__init__.py,sha256=PS842uUNhpA1vS6eb6QYEAPq3tbg4_pLujUebJu3dLk,648
26
- usecortex_ai/errors/bad_request_error.py,sha256=VdKbyoKQhQoaKa0UvQz-9_xMvvI1wVgpghH975VS0Tk,392
27
- usecortex_ai/errors/forbidden_error.py,sha256=OFKc3DYjz7Ybiu2MTHhGFfe6PRawyVqKV1qKWAf_iMI,391
28
- usecortex_ai/errors/internal_server_error.py,sha256=7Q3V1RVFccNJ8gwak_83qc7wP-n2U6dV6QSlo4lZogY,396
29
- usecortex_ai/errors/not_found_error.py,sha256=LL12suWtwnSbfeDhA42vsQKQp3epxbWsxOpYtWBmXSI,390
30
- usecortex_ai/errors/service_unavailable_error.py,sha256=SPY3eX47JsLLSrYse65vxdYgpc0Ov4v-bjau02zii9s,400
31
- usecortex_ai/errors/unauthorized_error.py,sha256=bWAey6G90kY_sxDwz39g6z293zRKW_gAVOjQLlfcn-M,394
32
- usecortex_ai/errors/unprocessable_entity_error.py,sha256=JqxtzIhvjkpQDqbT9Q-go1n-gyv9PsYqq0ng_ZYyBMo,347
33
- usecortex_ai/fetch/__init__.py,sha256=_VhToAyIt_5axN6CLJwtxg3-CO7THa_23pbUzqhXJa4,85
34
- usecortex_ai/fetch/client.py,sha256=fWj3cWX5hoiBC1iXXLb3LG5-6YROxwOrZGYJI0-b8co,3970
35
- usecortex_ai/fetch/raw_client.py,sha256=FCBFr34T4yIzudw3FBDWPZ2FdV1yWMsORrrjkLVyLTg,11734
36
- usecortex_ai/search/__init__.py,sha256=iA8ksy3OzGPGNq_g8cVXsEiZuWyAEAnKI6fHUFWEE-A,131
37
- usecortex_ai/search/client.py,sha256=O9XbLKH5WDTvueBjlZT_Js6uZHes9MQpDUm5URu3yt4,21957
38
- usecortex_ai/search/raw_client.py,sha256=FJ0qGnyhQSGMSdsbQVabLwl2WtbgxYMIXXnlJe1kCPM,46069
39
- usecortex_ai/search/types/__init__.py,sha256=T0zQrrDzfvgmw2Deo_iYanUoxcVhZ9jDO_fS3CpSU9M,131
40
- usecortex_ai/search/types/alpha.py,sha256=afIpOT9uMdYdUZB_biXoggzRnZlnr00miVPDgxDRFIA,113
41
- usecortex_ai/sources/__init__.py,sha256=_VhToAyIt_5axN6CLJwtxg3-CO7THa_23pbUzqhXJa4,85
42
- usecortex_ai/sources/client.py,sha256=W_G8kefb_6Bi7SeYvi9dy_41xKaPP3nVTCjE4vPQjA8,11606
43
- usecortex_ai/sources/raw_client.py,sha256=oWggwYuje1xcaonWxz8Bm24LcmyYkFPfviEUNhYmj7o,34572
44
- usecortex_ai/tenant/__init__.py,sha256=_VhToAyIt_5axN6CLJwtxg3-CO7THa_23pbUzqhXJa4,85
45
- usecortex_ai/tenant/client.py,sha256=IhVoy4lN2UTO8nvkT5NJXhExb6DrqP7CG51mm647akA,8764
46
- usecortex_ai/tenant/raw_client.py,sha256=aUBX_Fk09hHga_ezEr6iMD5G1xTnBO0RR4RYksGHZdw,31494
47
- usecortex_ai/types/__init__.py,sha256=rmAFjTmlisLyaxRTLFezRzkyqlMbUAdg1fB19O4YTuc,3763
48
- usecortex_ai/types/actual_error_response.py,sha256=EBit_JO3u0FQrVAXDg0UXQktlULLPLtX8FF8J9mZSvY,580
49
- usecortex_ai/types/add_user_memory_response.py,sha256=7JjjeNn7wmWGBWp-LmLZOQifouNKfQGPCzGU3K1mlis,1088
50
- usecortex_ai/types/app_sources_upload_data.py,sha256=XIXK7hRxNsqddHrtiF8RzEt4aqQPaLISiVn69AMAB6w,854
51
- usecortex_ai/types/attachment_model.py,sha256=gyIlSbj2fz8VJ6fo03-2FntXd0zZ5w53Ij-LN3PhjYg,1600
52
- usecortex_ai/types/batch_upload_data.py,sha256=C7e4MHoYleXTDOHfJz2gBWa7Lcl837An1XEZFfRZ380,850
53
- usecortex_ai/types/bm_25_operator_type.py,sha256=wiromvB4YjgxKQcS1-1BNBZ7MqKP1JzBEbY1R8K-wq4,153
54
- usecortex_ai/types/body_scrape_webpage_upload_scrape_webpage_post.py,sha256=7mnML_5krrZ8obOW_2HavWAjP2rxYQ-pETP0GnKsfDI,532
55
- usecortex_ai/types/body_update_scrape_job_upload_update_webpage_patch.py,sha256=7WtD74CYa-RkkuqluiBzoQjWqvbzUcK2p1cZZr0YgWo,535
56
- usecortex_ai/types/content_model.py,sha256=7KsEMncTZK90gWsjjVfrmOxOndM2HODIOUHclQU6ysE,1738
57
- usecortex_ai/types/delete_memory_request.py,sha256=4IoGwsZcGLg4_cJ_HqMsBseSk13exDnXMxpVFb5_PWo,957
58
- usecortex_ai/types/delete_sources.py,sha256=3Kl4YxQmiCNLiR1O7ZHP0xZgaQ54JTuyofbYS-MWjeM,589
59
- usecortex_ai/types/delete_sub_tenant_data.py,sha256=QrXEimInAWCgOzkgUTP8M6oKVVqoJZ50SBHsMkjamJw,1104
60
- usecortex_ai/types/delete_user_memory_response.py,sha256=GuqmekTZu6P3xk6L5tSwLbHXYF3CDh2eie8vIMjDWsE,833
61
- usecortex_ai/types/embeddings_create_collection_data.py,sha256=z6PQYZOcFEac03aWDfL0Faj2mwl-nY1Pm1fVZjS-Uqs,1027
62
- usecortex_ai/types/embeddings_delete_data.py,sha256=3DzQa0Gukog56XPlQe9zaUtvdIhIYWOLPGjlB6suTlU,1116
63
- usecortex_ai/types/embeddings_get_data.py,sha256=R9ukkUXidR4Q6_k0uT4GsEHjGXxgO-yArLGSVdKfw_U,1125
64
- usecortex_ai/types/embeddings_search_data.py,sha256=61UYdgEpsi-pYkGuMwSLc04-hrDjHXJPGBjoOKERRPM,1056
65
- usecortex_ai/types/entity.py,sha256=Q7gxZIFiT5jX78TfRO8id1KFh2vmTo_1-wWZZCoZOd4,1082
66
- usecortex_ai/types/error_response.py,sha256=7_MuOTWE3zj6kg6UptuYBFMAhV3KZGEkpsyirFvHJzA,633
67
- usecortex_ai/types/extended_context.py,sha256=urzqcO8__inNlBU2NwiCLMKfAfQuyMP3Q08wh_Pstp8,715
68
- usecortex_ai/types/fetch_content_data.py,sha256=kIBb282-npL1O1vhAMIX0m3KvV3H2Bk-mifBUcbO3e8,1004
69
- usecortex_ai/types/file_upload_result.py,sha256=UIqPc63K0MKf-nYsy8fxsui4IKTJ-BxVAetesnKiuzA,738
70
- usecortex_ai/types/graph_relations_response.py,sha256=psSKouHYvmMp5nkbRRcIDe87c3vP81Tl4gvqAkeNWbg,966
71
- usecortex_ai/types/http_validation_error.py,sha256=NNTK9AbbHXm0n9m1YcsG5zEaSn1n6RghohUX5R8LGzw,623
72
- usecortex_ai/types/list_sources_response.py,sha256=ybvnupTDVoZfDRsS3YdzbLemmqQqf4F31ODP-Fcj0n4,930
73
- usecortex_ai/types/list_user_memories_response.py,sha256=gsx9pxp2Rsaz0tX2pbGqFFThYF_20XpzwF7BWwOXAGA,906
74
- usecortex_ai/types/markdown_upload_request.py,sha256=I1Mot_08BgSQyNzgplPHypb_dBKeGKoMuA9MXBqfL7M,1477
75
- usecortex_ai/types/processing_status.py,sha256=rwrLBAMexNxRPMCd8PUSs4PHv4lba_0mkUot8iPJWEc,1153
76
- usecortex_ai/types/related_chunk.py,sha256=Ed7pzlEbycX5kmjvzF5-c9QvwOzyGozTsX9uAQMsDCI,613
77
- usecortex_ai/types/relation_evidence.py,sha256=tBpJD6QKDjuWiLUzBLdNHPclgRu8WjQAx4NE44JMAjw,1551
78
- usecortex_ai/types/relations.py,sha256=wcnG2_3dfypUkBLSMRxM4ACaQvVA1KhmOY4YwBbJu24,863
79
- usecortex_ai/types/retrieve_mode.py,sha256=s2nGRBzRRCu5OPIdXi5hhPZ18qBTVz6_T4qU8PoGJr4,156
80
- usecortex_ai/types/retrieve_response.py,sha256=QmeQDqRl_Ts3f9O0RRz6ZkbRDHJRy1iLSfol9dewWyk,1135
81
- usecortex_ai/types/retrieve_user_memory_response.py,sha256=c8-foOfPfoEUYg9lwkUQO5ONREjmSHU5dCtH52VvDuc,1170
82
- usecortex_ai/types/search_chunk.py,sha256=t9e9Db0N3Dgj7jKUDlMPxpDDlUeJEcA04rbT8AzzAPM,2423
83
- usecortex_ai/types/single_upload_data.py,sha256=VmuWSY_9zeKrtbj5_WPOZXIJDmqvWqL0Iz7bdq5n6w8,785
84
- usecortex_ai/types/source.py,sha256=z8RQ4q-ZweoMJ6DR1dGa4YBlXHjMX7-tfk6l_R3EFMw,1411
85
- usecortex_ai/types/source_model.py,sha256=HM5jA8UmLDQk8UfPt3J3ZNAA3eT6k19WwZ20m-TzWOk,2874
86
- usecortex_ai/types/sub_tenant_ids_data.py,sha256=D8uiE1JwPx8KJd-Y_tm6FVooSM_QO9JQBBDpz_Lnz8o,1271
87
- usecortex_ai/types/tenant_create_data.py,sha256=wpg53JzFfquwtNAsz0B4eG3NP39jmGvVZ0SiBwk2_n4,988
88
- usecortex_ai/types/tenant_stats.py,sha256=NMjla1aHriQIB7qiOa5amL9WYFz4vwDFWHHHpyA1ndg,1156
89
- usecortex_ai/types/triple_with_evidence.py,sha256=-0bKCUWqvI66874mP20TdsY7tdxP6Xtj9AN4sjxFs_4,922
90
- usecortex_ai/types/user_assistant_pair.py,sha256=gg2F3JPsR0WgeeqYa8y8G3_IpyOf9lNSQVGUon9sEhk,698
91
- usecortex_ai/types/user_memory.py,sha256=_lAM0qXL5cAwfLeeWs4_m8VZ2BtkFrGBYk5dip7k7KI,778
92
- usecortex_ai/types/validation_error.py,sha256=Ou-GSQTdmDFWIFlP_y9ka_EUAavqFEFLonU9srAkJdc,642
93
- usecortex_ai/types/validation_error_loc_item.py,sha256=LAtjCHIllWRBFXvAZ5QZpp7CPXjdtN9EB7HrLVo6EP0,128
94
- usecortex_ai/types/webpage_scrape_request.py,sha256=7tAPVdqnjQ549kJB9ztKF7RtGWUOHo2Tmbp02PMWwWw,794
95
- usecortex_ai/upload/__init__.py,sha256=_VhToAyIt_5axN6CLJwtxg3-CO7THa_23pbUzqhXJa4,85
96
- usecortex_ai/upload/client.py,sha256=MeJ9M03ZZsuMjYjXhd3lag48FJ8wAYouKY6wIjy17WU,91473
97
- usecortex_ai/upload/raw_client.py,sha256=wroi3PVe5J37TWpJmbw9Uo6U1XXEGBUgVjOKYqo44Z0,229362
98
- usecortex_ai/user/__init__.py,sha256=_VhToAyIt_5axN6CLJwtxg3-CO7THa_23pbUzqhXJa4,85
99
- usecortex_ai/user/client.py,sha256=w11KTvMzLB862OY46FgoRhVde5SvcaXLbEmnxxryk80,4802
100
- usecortex_ai/user/raw_client.py,sha256=RnloKJVojvAknaylQknMUY9kS0HwP6_QjcmMuFvviAs,12740
101
- usecortex_ai/user_memory/__init__.py,sha256=_VhToAyIt_5axN6CLJwtxg3-CO7THa_23pbUzqhXJa4,85
102
- usecortex_ai/user_memory/client.py,sha256=MX9D_RoibzFIMCZsMObLqxFgwQvj8E6cxTK128u3gq4,18652
103
- usecortex_ai/user_memory/raw_client.py,sha256=kCZ1J06tK-dVH7HCs3RrkkFYfuG48jPQiO0ikzARPBk,49796
104
- usecortex_ai-0.3.5.dist-info/licenses/LICENSE,sha256=Y4M0dr3NLw8mFQQ2MBdnC0YsrmcJ93WZ7-DgCliupK8,1245
105
- usecortex_ai-0.3.5.dist-info/METADATA,sha256=oboQXFbCxRdcgcyyw1sXGVIB463vimB1SJSqe9nzYaQ,7950
106
- usecortex_ai-0.3.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
107
- usecortex_ai-0.3.5.dist-info/top_level.txt,sha256=TQ77el6hL0CvN7BTXJVFTqZ5ot1_kHKo2ZnEcOvZsjo,13
108
- usecortex_ai-0.3.5.dist-info/RECORD,,
File without changes