usecortex-ai 0.2.0__py3-none-any.whl → 0.2.2__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.
- usecortex_ai/__init__.py +20 -3
- usecortex_ai/client.py +7 -78
- usecortex_ai/core/client_wrapper.py +6 -8
- usecortex_ai/document/__init__.py +4 -0
- usecortex_ai/document/client.py +139 -0
- usecortex_ai/document/raw_client.py +312 -0
- usecortex_ai/embeddings/client.py +50 -82
- usecortex_ai/embeddings/raw_client.py +48 -80
- usecortex_ai/fetch/client.py +10 -0
- usecortex_ai/fetch/raw_client.py +10 -0
- usecortex_ai/search/client.py +74 -80
- usecortex_ai/search/raw_client.py +74 -80
- usecortex_ai/sources/client.py +28 -0
- usecortex_ai/sources/raw_client.py +28 -0
- usecortex_ai/tenant/client.py +152 -4
- usecortex_ai/tenant/raw_client.py +502 -4
- usecortex_ai/types/__init__.py +18 -2
- usecortex_ai/types/add_user_memory_response.py +36 -0
- usecortex_ai/types/app_sources_upload_data.py +10 -2
- usecortex_ai/types/attachment_model.py +34 -7
- usecortex_ai/types/batch_upload_data.py +10 -2
- usecortex_ai/types/body_scrape_webpage_upload_scrape_webpage_post.py +0 -2
- usecortex_ai/types/body_update_scrape_job_upload_update_webpage_patch.py +0 -2
- usecortex_ai/types/content_model.py +33 -6
- usecortex_ai/types/delete_memory_request.py +14 -3
- usecortex_ai/types/delete_sources.py +20 -0
- usecortex_ai/types/delete_sub_tenant_data.py +42 -0
- usecortex_ai/types/delete_user_memory_response.py +31 -0
- usecortex_ai/types/embeddings_create_collection_data.py +19 -4
- usecortex_ai/types/embeddings_delete_data.py +19 -4
- usecortex_ai/types/embeddings_get_data.py +19 -4
- usecortex_ai/types/embeddings_search_data.py +19 -4
- usecortex_ai/types/error_response.py +0 -1
- usecortex_ai/types/fetch_content_data.py +19 -5
- usecortex_ai/types/file_upload_result.py +9 -2
- usecortex_ai/types/generate_user_memory_response.py +32 -0
- usecortex_ai/types/list_sources_response.py +14 -3
- usecortex_ai/types/list_user_memories_response.py +32 -0
- usecortex_ai/types/markdown_upload_request.py +18 -3
- usecortex_ai/types/processing_status.py +14 -3
- usecortex_ai/types/relations.py +2 -2
- usecortex_ai/types/retrieve_user_memory_response.py +32 -0
- usecortex_ai/types/search_chunk.py +54 -16
- usecortex_ai/types/single_upload_data.py +10 -2
- usecortex_ai/types/source.py +34 -14
- usecortex_ai/types/source_model.py +63 -12
- usecortex_ai/types/sub_tenant_ids_data.py +42 -0
- usecortex_ai/types/tenant_create_data.py +19 -4
- usecortex_ai/types/tenant_stats.py +24 -5
- usecortex_ai/types/user_memory.py +31 -0
- usecortex_ai/upload/client.py +508 -132
- usecortex_ai/upload/raw_client.py +492 -152
- usecortex_ai/user/client.py +14 -6
- usecortex_ai/user/raw_client.py +14 -6
- usecortex_ai/user_memory/client.py +184 -50
- usecortex_ai/user_memory/raw_client.py +905 -88
- {usecortex_ai-0.2.0.dist-info → usecortex_ai-0.2.2.dist-info}/METADATA +1 -1
- usecortex_ai-0.2.2.dist-info/RECORD +100 -0
- usecortex_ai/raw_client.py +0 -90
- usecortex_ai/types/source_content.py +0 -26
- usecortex_ai-0.2.0.dist-info/RECORD +0 -90
- {usecortex_ai-0.2.0.dist-info → usecortex_ai-0.2.2.dist-info}/WHEEL +0 -0
- {usecortex_ai-0.2.0.dist-info → usecortex_ai-0.2.2.dist-info}/licenses/LICENSE +0 -0
- {usecortex_ai-0.2.0.dist-info → usecortex_ai-0.2.2.dist-info}/top_level.txt +0 -0
usecortex_ai/user/client.py
CHANGED
|
@@ -34,14 +34,18 @@ class UserClient:
|
|
|
34
34
|
request_options: typing.Optional[RequestOptions] = None,
|
|
35
35
|
) -> TenantCreateData:
|
|
36
36
|
"""
|
|
37
|
-
Create a
|
|
37
|
+
Create a tenant for your account.
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
Use this endpoint to initialize a tenant space you can use for ingestion, embeddings, and search. Optionally include a metadata schema to enforce consistent attributes across documents.
|
|
40
|
+
|
|
41
|
+
Expected outcome
|
|
42
|
+
- A tenant is created and returned with its identifier.
|
|
43
|
+
- If the tenant already exists, you receive a success message with the existing identifier.
|
|
41
44
|
|
|
42
45
|
Parameters
|
|
43
46
|
----------
|
|
44
47
|
tenant_id : typing.Optional[str]
|
|
48
|
+
Unique identifier for the tenant/organization
|
|
45
49
|
|
|
46
50
|
tenant_metadata_schema : typing.Optional[typing.Sequence[typing.Dict[str, typing.Optional[typing.Any]]]]
|
|
47
51
|
|
|
@@ -89,14 +93,18 @@ class AsyncUserClient:
|
|
|
89
93
|
request_options: typing.Optional[RequestOptions] = None,
|
|
90
94
|
) -> TenantCreateData:
|
|
91
95
|
"""
|
|
92
|
-
Create a
|
|
96
|
+
Create a tenant for your account.
|
|
97
|
+
|
|
98
|
+
Use this endpoint to initialize a tenant space you can use for ingestion, embeddings, and search. Optionally include a metadata schema to enforce consistent attributes across documents.
|
|
93
99
|
|
|
94
|
-
|
|
95
|
-
|
|
100
|
+
Expected outcome
|
|
101
|
+
- A tenant is created and returned with its identifier.
|
|
102
|
+
- If the tenant already exists, you receive a success message with the existing identifier.
|
|
96
103
|
|
|
97
104
|
Parameters
|
|
98
105
|
----------
|
|
99
106
|
tenant_id : typing.Optional[str]
|
|
107
|
+
Unique identifier for the tenant/organization
|
|
100
108
|
|
|
101
109
|
tenant_metadata_schema : typing.Optional[typing.Sequence[typing.Dict[str, typing.Optional[typing.Any]]]]
|
|
102
110
|
|
usecortex_ai/user/raw_client.py
CHANGED
|
@@ -34,14 +34,18 @@ class RawUserClient:
|
|
|
34
34
|
request_options: typing.Optional[RequestOptions] = None,
|
|
35
35
|
) -> HttpResponse[TenantCreateData]:
|
|
36
36
|
"""
|
|
37
|
-
Create a
|
|
37
|
+
Create a tenant for your account.
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
Use this endpoint to initialize a tenant space you can use for ingestion, embeddings, and search. Optionally include a metadata schema to enforce consistent attributes across documents.
|
|
40
|
+
|
|
41
|
+
Expected outcome
|
|
42
|
+
- A tenant is created and returned with its identifier.
|
|
43
|
+
- If the tenant already exists, you receive a success message with the existing identifier.
|
|
41
44
|
|
|
42
45
|
Parameters
|
|
43
46
|
----------
|
|
44
47
|
tenant_id : typing.Optional[str]
|
|
48
|
+
Unique identifier for the tenant/organization
|
|
45
49
|
|
|
46
50
|
tenant_metadata_schema : typing.Optional[typing.Sequence[typing.Dict[str, typing.Optional[typing.Any]]]]
|
|
47
51
|
|
|
@@ -173,14 +177,18 @@ class AsyncRawUserClient:
|
|
|
173
177
|
request_options: typing.Optional[RequestOptions] = None,
|
|
174
178
|
) -> AsyncHttpResponse[TenantCreateData]:
|
|
175
179
|
"""
|
|
176
|
-
Create a
|
|
180
|
+
Create a tenant for your account.
|
|
181
|
+
|
|
182
|
+
Use this endpoint to initialize a tenant space you can use for ingestion, embeddings, and search. Optionally include a metadata schema to enforce consistent attributes across documents.
|
|
177
183
|
|
|
178
|
-
|
|
179
|
-
|
|
184
|
+
Expected outcome
|
|
185
|
+
- A tenant is created and returned with its identifier.
|
|
186
|
+
- If the tenant already exists, you receive a success message with the existing identifier.
|
|
180
187
|
|
|
181
188
|
Parameters
|
|
182
189
|
----------
|
|
183
190
|
tenant_id : typing.Optional[str]
|
|
191
|
+
Unique identifier for the tenant/organization
|
|
184
192
|
|
|
185
193
|
tenant_metadata_schema : typing.Optional[typing.Sequence[typing.Dict[str, typing.Optional[typing.Any]]]]
|
|
186
194
|
|
|
@@ -4,8 +4,16 @@ import typing
|
|
|
4
4
|
|
|
5
5
|
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
6
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.generate_user_memory_response import GenerateUserMemoryResponse
|
|
10
|
+
from ..types.list_user_memories_response import ListUserMemoriesResponse
|
|
11
|
+
from ..types.retrieve_user_memory_response import RetrieveUserMemoryResponse
|
|
7
12
|
from .raw_client import AsyncRawUserMemoryClient, RawUserMemoryClient
|
|
8
13
|
|
|
14
|
+
# this is used as the default value for optional parameters
|
|
15
|
+
OMIT = typing.cast(typing.Any, ...)
|
|
16
|
+
|
|
9
17
|
|
|
10
18
|
class UserMemoryClient:
|
|
11
19
|
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
@@ -23,21 +31,35 @@ class UserMemoryClient:
|
|
|
23
31
|
return self._raw_client
|
|
24
32
|
|
|
25
33
|
def list_user_memories(
|
|
26
|
-
self,
|
|
27
|
-
|
|
34
|
+
self,
|
|
35
|
+
*,
|
|
36
|
+
tenant_id: str,
|
|
37
|
+
sub_tenant_id: typing.Optional[str] = None,
|
|
38
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
39
|
+
) -> ListUserMemoriesResponse:
|
|
28
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
|
+
|
|
29
49
|
Parameters
|
|
30
50
|
----------
|
|
31
51
|
tenant_id : str
|
|
52
|
+
Unique identifier for the tenant/organization
|
|
32
53
|
|
|
33
|
-
sub_tenant_id : str
|
|
54
|
+
sub_tenant_id : typing.Optional[str]
|
|
55
|
+
Optional sub-tenant identifier for organizing data within a tenant. If not provided, defaults to tenant_id
|
|
34
56
|
|
|
35
57
|
request_options : typing.Optional[RequestOptions]
|
|
36
58
|
Request-specific configuration.
|
|
37
59
|
|
|
38
60
|
Returns
|
|
39
61
|
-------
|
|
40
|
-
|
|
62
|
+
ListUserMemoriesResponse
|
|
41
63
|
Successful Response
|
|
42
64
|
|
|
43
65
|
Examples
|
|
@@ -45,7 +67,7 @@ class UserMemoryClient:
|
|
|
45
67
|
from usecortex-ai import CortexAI
|
|
46
68
|
|
|
47
69
|
client = CortexAI(token="YOUR_TOKEN", )
|
|
48
|
-
client.user_memory.list_user_memories(tenant_id='tenant_id',
|
|
70
|
+
client.user_memory.list_user_memories(tenant_id='tenant_id', )
|
|
49
71
|
"""
|
|
50
72
|
_response = self._raw_client.list_user_memories(
|
|
51
73
|
tenant_id=tenant_id, sub_tenant_id=sub_tenant_id, request_options=request_options
|
|
@@ -57,24 +79,35 @@ class UserMemoryClient:
|
|
|
57
79
|
*,
|
|
58
80
|
tenant_id: str,
|
|
59
81
|
memory_id: str,
|
|
60
|
-
sub_tenant_id: str,
|
|
82
|
+
sub_tenant_id: typing.Optional[str] = None,
|
|
61
83
|
request_options: typing.Optional[RequestOptions] = None,
|
|
62
|
-
) ->
|
|
84
|
+
) -> DeleteUserMemoryResponse:
|
|
63
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
|
+
|
|
64
94
|
Parameters
|
|
65
95
|
----------
|
|
66
96
|
tenant_id : str
|
|
97
|
+
Unique identifier for the tenant/organization
|
|
67
98
|
|
|
68
99
|
memory_id : str
|
|
100
|
+
Unique identifier of the memory to delete
|
|
69
101
|
|
|
70
|
-
sub_tenant_id : str
|
|
102
|
+
sub_tenant_id : typing.Optional[str]
|
|
103
|
+
Optional sub-tenant identifier for organizing data within a tenant. If not provided, defaults to tenant_id
|
|
71
104
|
|
|
72
105
|
request_options : typing.Optional[RequestOptions]
|
|
73
106
|
Request-specific configuration.
|
|
74
107
|
|
|
75
108
|
Returns
|
|
76
109
|
-------
|
|
77
|
-
|
|
110
|
+
DeleteUserMemoryResponse
|
|
78
111
|
Successful Response
|
|
79
112
|
|
|
80
113
|
Examples
|
|
@@ -82,7 +115,7 @@ class UserMemoryClient:
|
|
|
82
115
|
from usecortex-ai import CortexAI
|
|
83
116
|
|
|
84
117
|
client = CortexAI(token="YOUR_TOKEN", )
|
|
85
|
-
client.user_memory.delete_user_memory(tenant_id='tenant_id', memory_id='memory_id',
|
|
118
|
+
client.user_memory.delete_user_memory(tenant_id='tenant_id', memory_id='memory_id', )
|
|
86
119
|
"""
|
|
87
120
|
_response = self._raw_client.delete_user_memory(
|
|
88
121
|
tenant_id=tenant_id, memory_id=memory_id, sub_tenant_id=sub_tenant_id, request_options=request_options
|
|
@@ -94,27 +127,40 @@ class UserMemoryClient:
|
|
|
94
127
|
*,
|
|
95
128
|
tenant_id: str,
|
|
96
129
|
query: str,
|
|
97
|
-
sub_tenant_id: str,
|
|
130
|
+
sub_tenant_id: typing.Optional[str] = None,
|
|
98
131
|
max_count: typing.Optional[int] = None,
|
|
99
132
|
request_options: typing.Optional[RequestOptions] = None,
|
|
100
|
-
) ->
|
|
133
|
+
) -> RetrieveUserMemoryResponse:
|
|
101
134
|
"""
|
|
135
|
+
Find relevant user memories using semantic search.
|
|
136
|
+
|
|
137
|
+
This endpoint performs a semantic search across all your stored user memories
|
|
138
|
+
to find the most relevant ones based on your query. The results are ranked by
|
|
139
|
+
similarity score, with the most relevant memories returned first.
|
|
140
|
+
|
|
141
|
+
Use this to recall past preferences, context, or information that might be
|
|
142
|
+
relevant to your current task or query.
|
|
143
|
+
|
|
102
144
|
Parameters
|
|
103
145
|
----------
|
|
104
146
|
tenant_id : str
|
|
147
|
+
Unique identifier for the tenant/organization
|
|
105
148
|
|
|
106
149
|
query : str
|
|
150
|
+
Search query to find relevant user memories
|
|
107
151
|
|
|
108
|
-
sub_tenant_id : str
|
|
152
|
+
sub_tenant_id : typing.Optional[str]
|
|
153
|
+
Optional sub-tenant identifier for organizing data within a tenant. If not provided, defaults to tenant_id
|
|
109
154
|
|
|
110
155
|
max_count : typing.Optional[int]
|
|
156
|
+
Maximum number of memories to return (default: 5)
|
|
111
157
|
|
|
112
158
|
request_options : typing.Optional[RequestOptions]
|
|
113
159
|
Request-specific configuration.
|
|
114
160
|
|
|
115
161
|
Returns
|
|
116
162
|
-------
|
|
117
|
-
|
|
163
|
+
RetrieveUserMemoryResponse
|
|
118
164
|
Successful Response
|
|
119
165
|
|
|
120
166
|
Examples
|
|
@@ -122,7 +168,7 @@ class UserMemoryClient:
|
|
|
122
168
|
from usecortex-ai import CortexAI
|
|
123
169
|
|
|
124
170
|
client = CortexAI(token="YOUR_TOKEN", )
|
|
125
|
-
client.user_memory.retrieve_user_memory(tenant_id='tenant_id', query='query',
|
|
171
|
+
client.user_memory.retrieve_user_memory(tenant_id='tenant_id', query='query', )
|
|
126
172
|
"""
|
|
127
173
|
_response = self._raw_client.retrieve_user_memory(
|
|
128
174
|
tenant_id=tenant_id,
|
|
@@ -139,26 +185,39 @@ class UserMemoryClient:
|
|
|
139
185
|
tenant_id: str,
|
|
140
186
|
user_query: str,
|
|
141
187
|
user_name: str,
|
|
142
|
-
sub_tenant_id: str,
|
|
188
|
+
sub_tenant_id: typing.Optional[str] = None,
|
|
143
189
|
request_options: typing.Optional[RequestOptions] = None,
|
|
144
|
-
) ->
|
|
190
|
+
) -> GenerateUserMemoryResponse:
|
|
145
191
|
"""
|
|
192
|
+
Generate AI-powered user memories from your query and context.
|
|
193
|
+
|
|
194
|
+
This endpoint uses artificial intelligence to create personalized memories
|
|
195
|
+
based on your query and user context. The AI analyzes your input and generates
|
|
196
|
+
relevant, contextual memories that can help improve future interactions.
|
|
197
|
+
|
|
198
|
+
Generated memories are automatically stored and can be retrieved through
|
|
199
|
+
the standard memory search endpoints.
|
|
200
|
+
|
|
146
201
|
Parameters
|
|
147
202
|
----------
|
|
148
203
|
tenant_id : str
|
|
204
|
+
Unique identifier for the tenant/organization
|
|
149
205
|
|
|
150
206
|
user_query : str
|
|
207
|
+
Your query or context for AI memory generation
|
|
151
208
|
|
|
152
209
|
user_name : str
|
|
210
|
+
Your name to personalize the generated memories
|
|
153
211
|
|
|
154
|
-
sub_tenant_id : str
|
|
212
|
+
sub_tenant_id : typing.Optional[str]
|
|
213
|
+
Optional sub-tenant identifier for organizing data within a tenant. If not provided, defaults to tenant_id
|
|
155
214
|
|
|
156
215
|
request_options : typing.Optional[RequestOptions]
|
|
157
216
|
Request-specific configuration.
|
|
158
217
|
|
|
159
218
|
Returns
|
|
160
219
|
-------
|
|
161
|
-
|
|
220
|
+
GenerateUserMemoryResponse
|
|
162
221
|
Successful Response
|
|
163
222
|
|
|
164
223
|
Examples
|
|
@@ -166,7 +225,7 @@ class UserMemoryClient:
|
|
|
166
225
|
from usecortex-ai import CortexAI
|
|
167
226
|
|
|
168
227
|
client = CortexAI(token="YOUR_TOKEN", )
|
|
169
|
-
client.user_memory.generate_user_memory(tenant_id='tenant_id', user_query='user_query', user_name='user_name',
|
|
228
|
+
client.user_memory.generate_user_memory(tenant_id='tenant_id', user_query='user_query', user_name='user_name', )
|
|
170
229
|
"""
|
|
171
230
|
_response = self._raw_client.generate_user_memory(
|
|
172
231
|
tenant_id=tenant_id,
|
|
@@ -182,24 +241,36 @@ class UserMemoryClient:
|
|
|
182
241
|
*,
|
|
183
242
|
tenant_id: str,
|
|
184
243
|
user_memory: str,
|
|
185
|
-
sub_tenant_id: str,
|
|
244
|
+
sub_tenant_id: typing.Optional[str] = None,
|
|
186
245
|
request_options: typing.Optional[RequestOptions] = None,
|
|
187
|
-
) ->
|
|
246
|
+
) -> AddUserMemoryResponse:
|
|
188
247
|
"""
|
|
248
|
+
Store a new user memory for future reference.
|
|
249
|
+
|
|
250
|
+
This endpoint allows you to manually add a memory that will be stored and
|
|
251
|
+
can be retrieved later through memory search. Use this to save important
|
|
252
|
+
preferences, context, or information that you want the system to remember.
|
|
253
|
+
|
|
254
|
+
The stored memory will be indexed and available for semantic search, making
|
|
255
|
+
it accessible when relevant to future queries or interactions.
|
|
256
|
+
|
|
189
257
|
Parameters
|
|
190
258
|
----------
|
|
191
259
|
tenant_id : str
|
|
260
|
+
Unique identifier for the tenant/organization
|
|
192
261
|
|
|
193
262
|
user_memory : str
|
|
263
|
+
The memory content to store for future reference
|
|
194
264
|
|
|
195
|
-
sub_tenant_id : str
|
|
265
|
+
sub_tenant_id : typing.Optional[str]
|
|
266
|
+
Optional sub-tenant identifier for organizing data within a tenant. If not provided, defaults to tenant_id
|
|
196
267
|
|
|
197
268
|
request_options : typing.Optional[RequestOptions]
|
|
198
269
|
Request-specific configuration.
|
|
199
270
|
|
|
200
271
|
Returns
|
|
201
272
|
-------
|
|
202
|
-
|
|
273
|
+
AddUserMemoryResponse
|
|
203
274
|
Successful Response
|
|
204
275
|
|
|
205
276
|
Examples
|
|
@@ -207,7 +278,7 @@ class UserMemoryClient:
|
|
|
207
278
|
from usecortex-ai import CortexAI
|
|
208
279
|
|
|
209
280
|
client = CortexAI(token="YOUR_TOKEN", )
|
|
210
|
-
client.user_memory.add_user_memory(tenant_id='tenant_id', user_memory='user_memory',
|
|
281
|
+
client.user_memory.add_user_memory(tenant_id='tenant_id', user_memory='user_memory', )
|
|
211
282
|
"""
|
|
212
283
|
_response = self._raw_client.add_user_memory(
|
|
213
284
|
tenant_id=tenant_id, user_memory=user_memory, sub_tenant_id=sub_tenant_id, request_options=request_options
|
|
@@ -231,21 +302,35 @@ class AsyncUserMemoryClient:
|
|
|
231
302
|
return self._raw_client
|
|
232
303
|
|
|
233
304
|
async def list_user_memories(
|
|
234
|
-
self,
|
|
235
|
-
|
|
305
|
+
self,
|
|
306
|
+
*,
|
|
307
|
+
tenant_id: str,
|
|
308
|
+
sub_tenant_id: typing.Optional[str] = None,
|
|
309
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
310
|
+
) -> ListUserMemoriesResponse:
|
|
236
311
|
"""
|
|
312
|
+
Retrieve all stored user memories for your tenant.
|
|
313
|
+
|
|
314
|
+
This endpoint returns a comprehensive list of all user memories that have been stored,
|
|
315
|
+
whether they were added manually or generated through AI. User memories help personalize
|
|
316
|
+
your experience by storing context, preferences, and important information.
|
|
317
|
+
|
|
318
|
+
You can optionally specify a sub-tenant to filter memories within that specific scope.
|
|
319
|
+
|
|
237
320
|
Parameters
|
|
238
321
|
----------
|
|
239
322
|
tenant_id : str
|
|
323
|
+
Unique identifier for the tenant/organization
|
|
240
324
|
|
|
241
|
-
sub_tenant_id : str
|
|
325
|
+
sub_tenant_id : typing.Optional[str]
|
|
326
|
+
Optional sub-tenant identifier for organizing data within a tenant. If not provided, defaults to tenant_id
|
|
242
327
|
|
|
243
328
|
request_options : typing.Optional[RequestOptions]
|
|
244
329
|
Request-specific configuration.
|
|
245
330
|
|
|
246
331
|
Returns
|
|
247
332
|
-------
|
|
248
|
-
|
|
333
|
+
ListUserMemoriesResponse
|
|
249
334
|
Successful Response
|
|
250
335
|
|
|
251
336
|
Examples
|
|
@@ -256,7 +341,7 @@ class AsyncUserMemoryClient:
|
|
|
256
341
|
|
|
257
342
|
client = AsyncCortexAI(token="YOUR_TOKEN", )
|
|
258
343
|
async def main() -> None:
|
|
259
|
-
await client.user_memory.list_user_memories(tenant_id='tenant_id',
|
|
344
|
+
await client.user_memory.list_user_memories(tenant_id='tenant_id', )
|
|
260
345
|
asyncio.run(main())
|
|
261
346
|
"""
|
|
262
347
|
_response = await self._raw_client.list_user_memories(
|
|
@@ -269,24 +354,35 @@ class AsyncUserMemoryClient:
|
|
|
269
354
|
*,
|
|
270
355
|
tenant_id: str,
|
|
271
356
|
memory_id: str,
|
|
272
|
-
sub_tenant_id: str,
|
|
357
|
+
sub_tenant_id: typing.Optional[str] = None,
|
|
273
358
|
request_options: typing.Optional[RequestOptions] = None,
|
|
274
|
-
) ->
|
|
359
|
+
) -> DeleteUserMemoryResponse:
|
|
275
360
|
"""
|
|
361
|
+
Permanently remove a specific user memory from storage.
|
|
362
|
+
|
|
363
|
+
This endpoint allows you to delete a user memory by its unique identifier.
|
|
364
|
+
Once deleted, the memory cannot be recovered, so use this operation carefully.
|
|
365
|
+
|
|
366
|
+
The memory will be removed from your tenant's storage and will no longer
|
|
367
|
+
appear in search results or memory listings.
|
|
368
|
+
|
|
276
369
|
Parameters
|
|
277
370
|
----------
|
|
278
371
|
tenant_id : str
|
|
372
|
+
Unique identifier for the tenant/organization
|
|
279
373
|
|
|
280
374
|
memory_id : str
|
|
375
|
+
Unique identifier of the memory to delete
|
|
281
376
|
|
|
282
|
-
sub_tenant_id : str
|
|
377
|
+
sub_tenant_id : typing.Optional[str]
|
|
378
|
+
Optional sub-tenant identifier for organizing data within a tenant. If not provided, defaults to tenant_id
|
|
283
379
|
|
|
284
380
|
request_options : typing.Optional[RequestOptions]
|
|
285
381
|
Request-specific configuration.
|
|
286
382
|
|
|
287
383
|
Returns
|
|
288
384
|
-------
|
|
289
|
-
|
|
385
|
+
DeleteUserMemoryResponse
|
|
290
386
|
Successful Response
|
|
291
387
|
|
|
292
388
|
Examples
|
|
@@ -297,7 +393,7 @@ class AsyncUserMemoryClient:
|
|
|
297
393
|
|
|
298
394
|
client = AsyncCortexAI(token="YOUR_TOKEN", )
|
|
299
395
|
async def main() -> None:
|
|
300
|
-
await client.user_memory.delete_user_memory(tenant_id='tenant_id', memory_id='memory_id',
|
|
396
|
+
await client.user_memory.delete_user_memory(tenant_id='tenant_id', memory_id='memory_id', )
|
|
301
397
|
asyncio.run(main())
|
|
302
398
|
"""
|
|
303
399
|
_response = await self._raw_client.delete_user_memory(
|
|
@@ -310,27 +406,40 @@ class AsyncUserMemoryClient:
|
|
|
310
406
|
*,
|
|
311
407
|
tenant_id: str,
|
|
312
408
|
query: str,
|
|
313
|
-
sub_tenant_id: str,
|
|
409
|
+
sub_tenant_id: typing.Optional[str] = None,
|
|
314
410
|
max_count: typing.Optional[int] = None,
|
|
315
411
|
request_options: typing.Optional[RequestOptions] = None,
|
|
316
|
-
) ->
|
|
412
|
+
) -> RetrieveUserMemoryResponse:
|
|
317
413
|
"""
|
|
414
|
+
Find relevant user memories using semantic search.
|
|
415
|
+
|
|
416
|
+
This endpoint performs a semantic search across all your stored user memories
|
|
417
|
+
to find the most relevant ones based on your query. The results are ranked by
|
|
418
|
+
similarity score, with the most relevant memories returned first.
|
|
419
|
+
|
|
420
|
+
Use this to recall past preferences, context, or information that might be
|
|
421
|
+
relevant to your current task or query.
|
|
422
|
+
|
|
318
423
|
Parameters
|
|
319
424
|
----------
|
|
320
425
|
tenant_id : str
|
|
426
|
+
Unique identifier for the tenant/organization
|
|
321
427
|
|
|
322
428
|
query : str
|
|
429
|
+
Search query to find relevant user memories
|
|
323
430
|
|
|
324
|
-
sub_tenant_id : str
|
|
431
|
+
sub_tenant_id : typing.Optional[str]
|
|
432
|
+
Optional sub-tenant identifier for organizing data within a tenant. If not provided, defaults to tenant_id
|
|
325
433
|
|
|
326
434
|
max_count : typing.Optional[int]
|
|
435
|
+
Maximum number of memories to return (default: 5)
|
|
327
436
|
|
|
328
437
|
request_options : typing.Optional[RequestOptions]
|
|
329
438
|
Request-specific configuration.
|
|
330
439
|
|
|
331
440
|
Returns
|
|
332
441
|
-------
|
|
333
|
-
|
|
442
|
+
RetrieveUserMemoryResponse
|
|
334
443
|
Successful Response
|
|
335
444
|
|
|
336
445
|
Examples
|
|
@@ -341,7 +450,7 @@ class AsyncUserMemoryClient:
|
|
|
341
450
|
|
|
342
451
|
client = AsyncCortexAI(token="YOUR_TOKEN", )
|
|
343
452
|
async def main() -> None:
|
|
344
|
-
await client.user_memory.retrieve_user_memory(tenant_id='tenant_id', query='query',
|
|
453
|
+
await client.user_memory.retrieve_user_memory(tenant_id='tenant_id', query='query', )
|
|
345
454
|
asyncio.run(main())
|
|
346
455
|
"""
|
|
347
456
|
_response = await self._raw_client.retrieve_user_memory(
|
|
@@ -359,26 +468,39 @@ class AsyncUserMemoryClient:
|
|
|
359
468
|
tenant_id: str,
|
|
360
469
|
user_query: str,
|
|
361
470
|
user_name: str,
|
|
362
|
-
sub_tenant_id: str,
|
|
471
|
+
sub_tenant_id: typing.Optional[str] = None,
|
|
363
472
|
request_options: typing.Optional[RequestOptions] = None,
|
|
364
|
-
) ->
|
|
473
|
+
) -> GenerateUserMemoryResponse:
|
|
365
474
|
"""
|
|
475
|
+
Generate AI-powered user memories from your query and context.
|
|
476
|
+
|
|
477
|
+
This endpoint uses artificial intelligence to create personalized memories
|
|
478
|
+
based on your query and user context. The AI analyzes your input and generates
|
|
479
|
+
relevant, contextual memories that can help improve future interactions.
|
|
480
|
+
|
|
481
|
+
Generated memories are automatically stored and can be retrieved through
|
|
482
|
+
the standard memory search endpoints.
|
|
483
|
+
|
|
366
484
|
Parameters
|
|
367
485
|
----------
|
|
368
486
|
tenant_id : str
|
|
487
|
+
Unique identifier for the tenant/organization
|
|
369
488
|
|
|
370
489
|
user_query : str
|
|
490
|
+
Your query or context for AI memory generation
|
|
371
491
|
|
|
372
492
|
user_name : str
|
|
493
|
+
Your name to personalize the generated memories
|
|
373
494
|
|
|
374
|
-
sub_tenant_id : str
|
|
495
|
+
sub_tenant_id : typing.Optional[str]
|
|
496
|
+
Optional sub-tenant identifier for organizing data within a tenant. If not provided, defaults to tenant_id
|
|
375
497
|
|
|
376
498
|
request_options : typing.Optional[RequestOptions]
|
|
377
499
|
Request-specific configuration.
|
|
378
500
|
|
|
379
501
|
Returns
|
|
380
502
|
-------
|
|
381
|
-
|
|
503
|
+
GenerateUserMemoryResponse
|
|
382
504
|
Successful Response
|
|
383
505
|
|
|
384
506
|
Examples
|
|
@@ -389,7 +511,7 @@ class AsyncUserMemoryClient:
|
|
|
389
511
|
|
|
390
512
|
client = AsyncCortexAI(token="YOUR_TOKEN", )
|
|
391
513
|
async def main() -> None:
|
|
392
|
-
await client.user_memory.generate_user_memory(tenant_id='tenant_id', user_query='user_query', user_name='user_name',
|
|
514
|
+
await client.user_memory.generate_user_memory(tenant_id='tenant_id', user_query='user_query', user_name='user_name', )
|
|
393
515
|
asyncio.run(main())
|
|
394
516
|
"""
|
|
395
517
|
_response = await self._raw_client.generate_user_memory(
|
|
@@ -406,24 +528,36 @@ class AsyncUserMemoryClient:
|
|
|
406
528
|
*,
|
|
407
529
|
tenant_id: str,
|
|
408
530
|
user_memory: str,
|
|
409
|
-
sub_tenant_id: str,
|
|
531
|
+
sub_tenant_id: typing.Optional[str] = None,
|
|
410
532
|
request_options: typing.Optional[RequestOptions] = None,
|
|
411
|
-
) ->
|
|
533
|
+
) -> AddUserMemoryResponse:
|
|
412
534
|
"""
|
|
535
|
+
Store a new user memory for future reference.
|
|
536
|
+
|
|
537
|
+
This endpoint allows you to manually add a memory that will be stored and
|
|
538
|
+
can be retrieved later through memory search. Use this to save important
|
|
539
|
+
preferences, context, or information that you want the system to remember.
|
|
540
|
+
|
|
541
|
+
The stored memory will be indexed and available for semantic search, making
|
|
542
|
+
it accessible when relevant to future queries or interactions.
|
|
543
|
+
|
|
413
544
|
Parameters
|
|
414
545
|
----------
|
|
415
546
|
tenant_id : str
|
|
547
|
+
Unique identifier for the tenant/organization
|
|
416
548
|
|
|
417
549
|
user_memory : str
|
|
550
|
+
The memory content to store for future reference
|
|
418
551
|
|
|
419
|
-
sub_tenant_id : str
|
|
552
|
+
sub_tenant_id : typing.Optional[str]
|
|
553
|
+
Optional sub-tenant identifier for organizing data within a tenant. If not provided, defaults to tenant_id
|
|
420
554
|
|
|
421
555
|
request_options : typing.Optional[RequestOptions]
|
|
422
556
|
Request-specific configuration.
|
|
423
557
|
|
|
424
558
|
Returns
|
|
425
559
|
-------
|
|
426
|
-
|
|
560
|
+
AddUserMemoryResponse
|
|
427
561
|
Successful Response
|
|
428
562
|
|
|
429
563
|
Examples
|
|
@@ -434,7 +568,7 @@ class AsyncUserMemoryClient:
|
|
|
434
568
|
|
|
435
569
|
client = AsyncCortexAI(token="YOUR_TOKEN", )
|
|
436
570
|
async def main() -> None:
|
|
437
|
-
await client.user_memory.add_user_memory(tenant_id='tenant_id', user_memory='user_memory',
|
|
571
|
+
await client.user_memory.add_user_memory(tenant_id='tenant_id', user_memory='user_memory', )
|
|
438
572
|
asyncio.run(main())
|
|
439
573
|
"""
|
|
440
574
|
_response = await self._raw_client.add_user_memory(
|