usecortex-ai 0.5.0__tar.gz → 0.5.1__tar.gz

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 (126) hide show
  1. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/LICENSE +21 -21
  2. {usecortex_ai-0.5.0/src/usecortex_ai.egg-info → usecortex_ai-0.5.1}/PKG-INFO +1 -1
  3. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/README.md +135 -135
  4. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/pyproject.toml +40 -40
  5. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/setup.cfg +0 -0
  6. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/__init__.py +8 -4
  7. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/client.py +0 -4
  8. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/core/__init__.py +0 -0
  9. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/core/api_error.py +0 -0
  10. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/core/client_wrapper.py +0 -0
  11. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/core/datetime_utils.py +0 -0
  12. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/core/file.py +0 -0
  13. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/core/force_multipart.py +0 -0
  14. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/core/http_client.py +0 -0
  15. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/core/http_response.py +0 -0
  16. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/core/jsonable_encoder.py +0 -0
  17. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/core/pydantic_utilities.py +0 -0
  18. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/core/query_encoder.py +0 -0
  19. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/core/remove_none_from_dict.py +0 -0
  20. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/core/request_options.py +0 -0
  21. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/core/serialization.py +0 -0
  22. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/dashboard/__init__.py +0 -0
  23. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/dashboard/client.py +2 -30
  24. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/dashboard/raw_client.py +0 -28
  25. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/embeddings/__init__.py +0 -0
  26. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/embeddings/client.py +8 -58
  27. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/embeddings/raw_client.py +8 -58
  28. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/environment.py +0 -0
  29. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/errors/__init__.py +0 -0
  30. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/errors/bad_request_error.py +0 -0
  31. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/errors/forbidden_error.py +0 -0
  32. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/errors/internal_server_error.py +0 -0
  33. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/errors/not_found_error.py +0 -0
  34. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/errors/service_unavailable_error.py +0 -0
  35. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/errors/too_many_requests_error.py +0 -0
  36. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/errors/unauthorized_error.py +0 -0
  37. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/errors/unprocessable_entity_error.py +0 -0
  38. usecortex_ai-0.5.1/src/usecortex_ai/fetch/__init__.py +7 -0
  39. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/fetch/client.py +42 -165
  40. usecortex_ai-0.5.1/src/usecortex_ai/fetch/raw_client.py +861 -0
  41. usecortex_ai-0.5.1/src/usecortex_ai/fetch/types/__init__.py +7 -0
  42. usecortex_ai-0.5.1/src/usecortex_ai/fetch/types/fetch_list_knowledge_response.py +8 -0
  43. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/raw_client.py +0 -4
  44. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/search/__init__.py +0 -0
  45. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/search/client.py +36 -124
  46. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/search/raw_client.py +36 -124
  47. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/search/types/__init__.py +0 -0
  48. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/search/types/alpha.py +0 -0
  49. {usecortex_ai-0.5.0/src/usecortex_ai/fetch → usecortex_ai-0.5.1/src/usecortex_ai/sources}/__init__.py +0 -0
  50. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/sources/client.py +2 -16
  51. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/sources/raw_client.py +2 -16
  52. {usecortex_ai-0.5.0/src/usecortex_ai/sources → usecortex_ai-0.5.1/src/usecortex_ai/tenant}/__init__.py +0 -0
  53. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/tenant/client.py +4 -108
  54. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/tenant/raw_client.py +2 -106
  55. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/types/__init__.py +6 -2
  56. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/types/actual_error_response.py +0 -0
  57. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/types/add_memory_response.py +0 -0
  58. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/types/api_key_info.py +0 -0
  59. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/types/attachment_model.py +0 -0
  60. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/types/bm_25_operator_type.py +0 -0
  61. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/types/collection_stats.py +0 -0
  62. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/types/content_model.py +0 -0
  63. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/types/custom_property_definition.py +0 -0
  64. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/types/dashboard_apis_response.py +0 -0
  65. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/types/dashboard_sources_response.py +0 -0
  66. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/types/dashboard_tenants_response.py +0 -0
  67. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/types/delete_result.py +0 -0
  68. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/types/delete_user_memory_response.py +0 -0
  69. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/types/entity.py +0 -0
  70. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/types/error_response.py +0 -0
  71. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/types/fetch_mode.py +0 -0
  72. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/types/forceful_relations_payload.py +0 -0
  73. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/types/graph_context.py +0 -0
  74. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/types/http_validation_error.py +0 -0
  75. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/types/infra.py +0 -0
  76. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/types/insert_result.py +0 -0
  77. usecortex_ai-0.5.1/src/usecortex_ai/types/list_content_kind.py +5 -0
  78. usecortex_ai-0.5.1/src/usecortex_ai/types/list_user_memories_response.py +32 -0
  79. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/types/memory_item.py +0 -0
  80. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/types/memory_result_item.py +0 -0
  81. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/types/milvus_data_type.py +0 -0
  82. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/types/path_triplet.py +0 -0
  83. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/types/processing_status.py +0 -0
  84. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/types/processing_status_indexing_status.py +0 -0
  85. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/types/qn_a_search_response.py +0 -0
  86. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/types/raw_embedding_document.py +0 -0
  87. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/types/raw_embedding_search_result.py +0 -0
  88. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/types/raw_embedding_vector.py +0 -0
  89. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/types/relation_evidence.py +0 -0
  90. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/types/retrieval_result.py +1 -1
  91. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/types/retrieve_mode.py +1 -1
  92. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/types/scored_path_response.py +0 -0
  93. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/types/search_mode.py +0 -0
  94. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/types/source_delete_response.py +0 -0
  95. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/types/source_delete_result_item.py +0 -0
  96. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/types/source_fetch_response.py +0 -0
  97. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/types/source_graph_relations_response.py +0 -0
  98. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/types/source_list_response.py +0 -0
  99. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/types/source_model.py +0 -0
  100. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/types/source_status.py +0 -0
  101. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/types/source_upload_response.py +0 -0
  102. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/types/source_upload_result_item.py +0 -0
  103. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/types/supported_llm_providers.py +0 -0
  104. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/types/tenant_create_response.py +0 -0
  105. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/types/tenant_info.py +0 -0
  106. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/types/tenant_metadata_schema_info.py +0 -0
  107. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/types/tenant_stats_response.py +0 -0
  108. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/types/triplet_with_evidence.py +0 -0
  109. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/types/user_assistant_pair.py +0 -0
  110. usecortex_ai-0.5.1/src/usecortex_ai/types/user_memory.py +31 -0
  111. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/types/validation_error.py +0 -0
  112. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/types/validation_error_loc_item.py +0 -0
  113. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/types/vector_store_chunk.py +0 -0
  114. {usecortex_ai-0.5.0/src/usecortex_ai/tenant → usecortex_ai-0.5.1/src/usecortex_ai/upload}/__init__.py +0 -0
  115. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai/upload/client.py +34 -204
  116. {usecortex_ai-0.5.0/src/usecortex_ai/fetch → usecortex_ai-0.5.1/src/usecortex_ai/upload}/raw_client.py +189 -216
  117. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1/src/usecortex_ai.egg-info}/PKG-INFO +1 -1
  118. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai.egg-info/SOURCES.txt +6 -4
  119. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai.egg-info/dependency_links.txt +0 -0
  120. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai.egg-info/requires.txt +0 -0
  121. {usecortex_ai-0.5.0 → usecortex_ai-0.5.1}/src/usecortex_ai.egg-info/top_level.txt +0 -0
  122. usecortex_ai-0.5.0/src/usecortex_ai/types/app_sources_upload_data.py +0 -39
  123. usecortex_ai-0.5.0/src/usecortex_ai/upload/__init__.py +0 -7
  124. usecortex_ai-0.5.0/src/usecortex_ai/upload/raw_client.py +0 -1489
  125. usecortex_ai-0.5.0/src/usecortex_ai/upload/types/__init__.py +0 -7
  126. usecortex_ai-0.5.0/src/usecortex_ai/upload/types/body_upload_app_ingestion_upload_app_post_app_sources.py +0 -7
@@ -1,22 +1,22 @@
1
- Copyright (c) 2024 Cortex AI
2
-
3
- All Rights Reserved.
4
-
5
- PROPRIETARY AND CONFIDENTIAL
6
-
7
- This software is the proprietary and confidential property of Cortex AI ("the Company").
8
- Permission is hereby granted to users to install and use this software as part of the Cortex AI service, subject to the terms and conditions of the service agreement entered into with the Company.
9
-
10
- You may not, without the express written permission of the Company:
11
-
12
- 1. Copy, modify, or create derivative works of the software.
13
- 2. Distribute, sell, rent, lease, sublicense, or otherwise transfer the software to any third party.
14
- 3. Reverse engineer, decompile, or disassemble the software, except and only to the extent that such activity is expressly permitted by applicable law notwithstanding this limitation.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1
+ Copyright (c) 2024 Cortex AI
2
+
3
+ All Rights Reserved.
4
+
5
+ PROPRIETARY AND CONFIDENTIAL
6
+
7
+ This software is the proprietary and confidential property of Cortex AI ("the Company").
8
+ Permission is hereby granted to users to install and use this software as part of the Cortex AI service, subject to the terms and conditions of the service agreement entered into with the Company.
9
+
10
+ You may not, without the express written permission of the Company:
11
+
12
+ 1. Copy, modify, or create derivative works of the software.
13
+ 2. Distribute, sell, rent, lease, sublicense, or otherwise transfer the software to any third party.
14
+ 3. Reverse engineer, decompile, or disassemble the software, except and only to the extent that such activity is expressly permitted by applicable law notwithstanding this limitation.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
22
  SOFTWARE.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: usecortex-ai
3
- Version: 0.5.0
3
+ Version: 0.5.1
4
4
  Summary: The official Python SDK for the Cortex AI platform.
5
5
  Author-email: Soham Ratnaparkhi <soham@usecortex.ai>
6
6
  License: Copyright (c) 2024 Cortex AI
@@ -1,135 +1,135 @@
1
- # Cortex AI Python SDK - [usecortex.ai](https://www.usecortex.ai/)
2
-
3
- The official Python SDK for the Cortex AI platform. Build powerful, context-aware AI applications in your Python applications.
4
-
5
- **Cortex** is your plug-and-play memory infrastructure. It powers intelligent, context-aware retrieval for any AI app or agent. Whether you’re building a customer support bot, research copilot, or internal knowledge assistant.
6
-
7
- [Learn more about the SDK from our docs](https://docs.usecortex.ai/)
8
-
9
- ## Core features
10
-
11
- * **Dynamic retrieval and querying** that always retrieve the most relevant context
12
- * **Built-in long-term memory** that evolves with every user interaction
13
- * **Personalization hooks** for user preferences, intent, and history
14
- * **Developer-first SDK** with the most flexible APIs and fine-grained controls
15
-
16
- ## Getting started
17
-
18
- ### Installation
19
-
20
- ```bash
21
- pip install usecortex-ai
22
- ```
23
-
24
- ### Client setup
25
-
26
- We provide both synchronous and asynchronous clients. Use **`AsyncCortexAI`** when working with async/await patterns, and **`CortexAI`** for traditional synchronous workflows. Client initialization does not trigger any network requests, so you can safely create as many client instances as needed. Both clients expose the exact same set of methods.
27
-
28
- ```python
29
- import os
30
- from usecortex_ai import CortexAI, AsyncCortexAI
31
-
32
- api_key = os.environ["CORTEX_API_KEY"] # Set your Cortex API key in the environment variable CORTEX_API_KEY. Optional, but recommended.
33
-
34
- # Sync client
35
- client = CortexAI(token=api_key)
36
-
37
- # Async client (for async/await usage)
38
- async_client = AsyncCortexAI(token=api_key)
39
- ```
40
-
41
- ### Create a Tenant
42
-
43
- You can consider a `tenant` as a single database that can have internal isolated collections called `sub-tenants`. [Know more about the concept of tenant here](https://docs.usecortex.ai/essentials/multi-tenant)
44
-
45
- ```python
46
- def create_tenant():
47
- return client.user.create_tenant(tenant_id="my-company")
48
- ```
49
-
50
- ### Index Your Data
51
-
52
- When you index your data, you make it ready for retrieval from Cortex using natural language.
53
-
54
- ```python
55
- # Upload text content
56
- def upload_text():
57
- return client.upload.upload_text(
58
- tenant_id="my-company-py-sync",
59
- sub_tenant_id="engineering",
60
- content="Our API rate limits are 1000 requests per minute for premium accounts.",
61
- file_id="api-docs-rate-limits",
62
- tenant_metadata={"sub_tenant_id": "engineering"}
63
- )
64
-
65
- # Upload document file
66
- def upload_file():
67
- with open("company-handbook.pdf", 'rb') as file_obj:
68
- file_data = ("company-handbook.pdf", file_obj)
69
- return client.upload.upload_document(
70
- tenant_id="my-company",
71
- file=file_data,
72
- file_id="company-handbook.pdf"
73
- )
74
- ```
75
-
76
- **For a more detailed explanation** of document upload, including supported file formats, processing pipeline, metadata handling, and advanced configuration options, refer to the [Upload Document endpoint documentation](https://docs.usecortex.ai/api-reference/endpoint/upload-document).
77
-
78
- ### Search and retrieval
79
-
80
- ```python
81
- # Semantic search with retrieval
82
- results = client.search.retrieve(
83
- query="What are the API rate limits?",
84
- tenant_id="my-company",
85
- sub_tenant_id="engineering",
86
- max_chunks=10
87
- )
88
-
89
- # List all sources
90
- all_sources = client.sources.get_all(
91
- tenant_id="my-company",
92
- sub_tenant_id="engineering",
93
- )
94
-
95
- # Get specific sources by ID
96
- specific_sources = client.sources.get_by_ids(
97
- tenant_id="my-company",
98
- sub_tenant_id="engineering",
99
- source_ids=["api-docs-rate-limits", "company-handbook"]
100
- )
101
- ```
102
-
103
- **For a more detailed explanation** of search and retrieval, including query parameters, scoring mechanisms, result structure, and advanced search features, refer to the [Search endpoint documentation](https://docs.usecortex.ai/api-reference/endpoint/search).
104
-
105
- ## SDK Method Structure & Type Safety
106
-
107
- Our SDKs follow a predictable pattern that mirrors the API structure while providing full type safety.
108
-
109
- > **Method Mapping** : `client.<group>.<function_name>` mirrors `api.usecortex.ai/<group>/<function_name>`
110
- >
111
- > For example: `client.upload.upload_text()` corresponds to `POST /upload/upload_text`
112
-
113
- The SDKs provide exact type parity with the API specification:
114
-
115
- - **Request Parameters** : Every field documented in the API reference (required, optional, types, validation rules) is reflected in the SDK method signatures
116
- - **Response Objects** : Return types match the exact JSON schema documented for each endpoint
117
- - **Error Types** : Exception structures mirror the error response formats from the API
118
- - **Nested Objects** : Complex nested parameters and responses maintain their full structure and typing
119
-
120
- > This means you can rely on your IDE’s autocomplete and type checking. If a parameter is optional in the API docs, it’s optional in the SDK. If a response contains a specific field, your IDE will know about it. Our SDKs are built in such a way that your IDE will automatically provide **autocompletion, type-checking, inline documentation with examples, and compile time validation** for each and every method.
121
- >
122
- > Just hit **Cmd+Space/Ctrl+Space!**
123
-
124
- ## Links
125
-
126
- - **Homepage:** [usecortex.ai](https://www.usecortex.ai/)
127
- - **Documentation:** [docs.usecortex.ai](https://docs.usecortex.ai/)
128
-
129
- ## Our docs
130
-
131
- Please refer to our [API reference](https://docs.usecortex.ai/api-reference/introduction) for detailed explanations of every API endpoint, parameter options, and advanced use cases.
132
-
133
- ## Support
134
-
135
- If you have any questions or need help, please reach out to our support team at [founders@usecortex.ai](mailto:founders@usecortex.ai).
1
+ # Cortex AI Python SDK - [usecortex.ai](https://www.usecortex.ai/)
2
+
3
+ The official Python SDK for the Cortex AI platform. Build powerful, context-aware AI applications in your Python applications.
4
+
5
+ **Cortex** is your plug-and-play memory infrastructure. It powers intelligent, context-aware retrieval for any AI app or agent. Whether you’re building a customer support bot, research copilot, or internal knowledge assistant.
6
+
7
+ [Learn more about the SDK from our docs](https://docs.usecortex.ai/)
8
+
9
+ ## Core features
10
+
11
+ * **Dynamic retrieval and querying** that always retrieve the most relevant context
12
+ * **Built-in long-term memory** that evolves with every user interaction
13
+ * **Personalization hooks** for user preferences, intent, and history
14
+ * **Developer-first SDK** with the most flexible APIs and fine-grained controls
15
+
16
+ ## Getting started
17
+
18
+ ### Installation
19
+
20
+ ```bash
21
+ pip install usecortex-ai
22
+ ```
23
+
24
+ ### Client setup
25
+
26
+ We provide both synchronous and asynchronous clients. Use **`AsyncCortexAI`** when working with async/await patterns, and **`CortexAI`** for traditional synchronous workflows. Client initialization does not trigger any network requests, so you can safely create as many client instances as needed. Both clients expose the exact same set of methods.
27
+
28
+ ```python
29
+ import os
30
+ from usecortex_ai import CortexAI, AsyncCortexAI
31
+
32
+ api_key = os.environ["CORTEX_API_KEY"] # Set your Cortex API key in the environment variable CORTEX_API_KEY. Optional, but recommended.
33
+
34
+ # Sync client
35
+ client = CortexAI(token=api_key)
36
+
37
+ # Async client (for async/await usage)
38
+ async_client = AsyncCortexAI(token=api_key)
39
+ ```
40
+
41
+ ### Create a Tenant
42
+
43
+ You can consider a `tenant` as a single database that can have internal isolated collections called `sub-tenants`. [Know more about the concept of tenant here](https://docs.usecortex.ai/essentials/multi-tenant)
44
+
45
+ ```python
46
+ def create_tenant():
47
+ return client.user.create_tenant(tenant_id="my-company")
48
+ ```
49
+
50
+ ### Index Your Data
51
+
52
+ When you index your data, you make it ready for retrieval from Cortex using natural language.
53
+
54
+ ```python
55
+ # Upload text content
56
+ def upload_text():
57
+ return client.upload.upload_text(
58
+ tenant_id="my-company-py-sync",
59
+ sub_tenant_id="engineering",
60
+ content="Our API rate limits are 1000 requests per minute for premium accounts.",
61
+ file_id="api-docs-rate-limits",
62
+ tenant_metadata={"sub_tenant_id": "engineering"}
63
+ )
64
+
65
+ # Upload document file
66
+ def upload_file():
67
+ with open("company-handbook.pdf", 'rb') as file_obj:
68
+ file_data = ("company-handbook.pdf", file_obj)
69
+ return client.upload.upload_document(
70
+ tenant_id="my-company",
71
+ file=file_data,
72
+ file_id="company-handbook.pdf"
73
+ )
74
+ ```
75
+
76
+ **For a more detailed explanation** of document upload, including supported file formats, processing pipeline, metadata handling, and advanced configuration options, refer to the [Upload Document endpoint documentation](https://docs.usecortex.ai/api-reference/endpoint/upload-document).
77
+
78
+ ### Search and retrieval
79
+
80
+ ```python
81
+ # Semantic search with retrieval
82
+ results = client.search.retrieve(
83
+ query="What are the API rate limits?",
84
+ tenant_id="my-company",
85
+ sub_tenant_id="engineering",
86
+ max_chunks=10
87
+ )
88
+
89
+ # List all sources
90
+ all_sources = client.sources.get_all(
91
+ tenant_id="my-company",
92
+ sub_tenant_id="engineering",
93
+ )
94
+
95
+ # Get specific sources by ID
96
+ specific_sources = client.sources.get_by_ids(
97
+ tenant_id="my-company",
98
+ sub_tenant_id="engineering",
99
+ source_ids=["api-docs-rate-limits", "company-handbook"]
100
+ )
101
+ ```
102
+
103
+ **For a more detailed explanation** of search and retrieval, including query parameters, scoring mechanisms, result structure, and advanced search features, refer to the [Search endpoint documentation](https://docs.usecortex.ai/api-reference/endpoint/search).
104
+
105
+ ## SDK Method Structure & Type Safety
106
+
107
+ Our SDKs follow a predictable pattern that mirrors the API structure while providing full type safety.
108
+
109
+ > **Method Mapping** : `client.<group>.<function_name>` mirrors `api.usecortex.ai/<group>/<function_name>`
110
+ >
111
+ > For example: `client.upload.upload_text()` corresponds to `POST /upload/upload_text`
112
+
113
+ The SDKs provide exact type parity with the API specification:
114
+
115
+ - **Request Parameters** : Every field documented in the API reference (required, optional, types, validation rules) is reflected in the SDK method signatures
116
+ - **Response Objects** : Return types match the exact JSON schema documented for each endpoint
117
+ - **Error Types** : Exception structures mirror the error response formats from the API
118
+ - **Nested Objects** : Complex nested parameters and responses maintain their full structure and typing
119
+
120
+ > This means you can rely on your IDE’s autocomplete and type checking. If a parameter is optional in the API docs, it’s optional in the SDK. If a response contains a specific field, your IDE will know about it. Our SDKs are built in such a way that your IDE will automatically provide **autocompletion, type-checking, inline documentation with examples, and compile time validation** for each and every method.
121
+ >
122
+ > Just hit **Cmd+Space/Ctrl+Space!**
123
+
124
+ ## Links
125
+
126
+ - **Homepage:** [usecortex.ai](https://www.usecortex.ai/)
127
+ - **Documentation:** [docs.usecortex.ai](https://docs.usecortex.ai/)
128
+
129
+ ## Our docs
130
+
131
+ Please refer to our [API reference](https://docs.usecortex.ai/api-reference/introduction) for detailed explanations of every API endpoint, parameter options, and advanced use cases.
132
+
133
+ ## Support
134
+
135
+ If you have any questions or need help, please reach out to our support team at [founders@usecortex.ai](mailto:founders@usecortex.ai).
@@ -1,40 +1,40 @@
1
- [build-system]
2
- requires = ["setuptools>=61.0"]
3
- build-backend = "setuptools.build_meta"
4
-
5
- [project]
6
- name = "usecortex-ai"
7
-
8
- version = "0.5.0"
9
-
10
- authors = [
11
- { name = "Soham Ratnaparkhi", email = "soham@usecortex.ai" },
12
- ]
13
- description = "The official Python SDK for the Cortex AI platform."
14
- readme = "README.md"
15
- requires-python = ">=3.10"
16
- license = { file = "LICENSE" }
17
- keywords = ["cortex", "ai", "sdk", "api", "generative ai", "rag"]
18
-
19
- # Add classifiers to help users find your package on PyPI
20
- classifiers = [
21
- # See https://pypi.org/classifiers/
22
- "Development Status :: 5 - Production/Stable",
23
- "Programming Language :: Python :: 3",
24
- "Programming Language :: Python :: 3.10",
25
- "Programming Language :: Python :: 3.11",
26
- "Programming Language :: Python :: 3.12",
27
- "Intended Audience :: Developers",
28
- "Topic :: Software Development :: Libraries :: Python Modules",
29
- "Typing :: Typed",
30
- ]
31
-
32
- dependencies = [
33
- "httpx>=0.24",
34
- "pydantic>=1.10,<3",
35
- ]
36
-
37
- [project.urls]
38
- Homepage = "https://www.usecortex.ai/"
39
- Documentation = "https://docs.usecortex.ai/"
40
-
1
+ [build-system]
2
+ requires = ["setuptools>=61.0"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "usecortex-ai"
7
+
8
+ version = "0.5.1"
9
+
10
+ authors = [
11
+ { name = "Soham Ratnaparkhi", email = "soham@usecortex.ai" },
12
+ ]
13
+ description = "The official Python SDK for the Cortex AI platform."
14
+ readme = "README.md"
15
+ requires-python = ">=3.10"
16
+ license = { file = "LICENSE" }
17
+ keywords = ["cortex", "ai", "sdk", "api", "generative ai", "rag"]
18
+
19
+ # Add classifiers to help users find your package on PyPI
20
+ classifiers = [
21
+ # See https://pypi.org/classifiers/
22
+ "Development Status :: 5 - Production/Stable",
23
+ "Programming Language :: Python :: 3",
24
+ "Programming Language :: Python :: 3.10",
25
+ "Programming Language :: Python :: 3.11",
26
+ "Programming Language :: Python :: 3.12",
27
+ "Intended Audience :: Developers",
28
+ "Topic :: Software Development :: Libraries :: Python Modules",
29
+ "Typing :: Typed",
30
+ ]
31
+
32
+ dependencies = [
33
+ "httpx>=0.24",
34
+ "pydantic>=1.10,<3",
35
+ ]
36
+
37
+ [project.urls]
38
+ Homepage = "https://www.usecortex.ai/"
39
+ Documentation = "https://docs.usecortex.ai/"
40
+
File without changes
@@ -6,7 +6,6 @@ from .types import (
6
6
  ActualErrorResponse,
7
7
  AddMemoryResponse,
8
8
  ApiKeyInfo,
9
- AppSourcesUploadData,
10
9
  AttachmentModel,
11
10
  Bm25OperatorType,
12
11
  CollectionStats,
@@ -25,6 +24,8 @@ from .types import (
25
24
  HttpValidationError,
26
25
  Infra,
27
26
  InsertResult,
27
+ ListContentKind,
28
+ ListUserMemoriesResponse,
28
29
  MemoryItem,
29
30
  MemoryResultItem,
30
31
  MilvusDataType,
@@ -56,6 +57,7 @@ from .types import (
56
57
  TenantStatsResponse,
57
58
  TripletWithEvidence,
58
59
  UserAssistantPair,
60
+ UserMemory,
59
61
  ValidationError,
60
62
  ValidationErrorLocItem,
61
63
  VectorStoreChunk,
@@ -73,20 +75,18 @@ from .errors import (
73
75
  from . import dashboard, embeddings, fetch, search, sources, tenant, upload
74
76
  from .client import AsyncCortexAI, CortexAI
75
77
  from .environment import CortexAIEnvironment
78
+ from .fetch import FetchListKnowledgeResponse
76
79
  from .search import Alpha
77
- from .upload import BodyUploadAppIngestionUploadAppPostAppSources
78
80
 
79
81
  __all__ = [
80
82
  "ActualErrorResponse",
81
83
  "AddMemoryResponse",
82
84
  "Alpha",
83
85
  "ApiKeyInfo",
84
- "AppSourcesUploadData",
85
86
  "AsyncCortexAI",
86
87
  "AttachmentModel",
87
88
  "BadRequestError",
88
89
  "Bm25OperatorType",
89
- "BodyUploadAppIngestionUploadAppPostAppSources",
90
90
  "CollectionStats",
91
91
  "ContentModel",
92
92
  "CortexAI",
@@ -99,6 +99,7 @@ __all__ = [
99
99
  "DeleteUserMemoryResponse",
100
100
  "Entity",
101
101
  "ErrorResponse",
102
+ "FetchListKnowledgeResponse",
102
103
  "FetchMode",
103
104
  "ForbiddenError",
104
105
  "ForcefulRelationsPayload",
@@ -107,6 +108,8 @@ __all__ = [
107
108
  "Infra",
108
109
  "InsertResult",
109
110
  "InternalServerError",
111
+ "ListContentKind",
112
+ "ListUserMemoriesResponse",
110
113
  "MemoryItem",
111
114
  "MemoryResultItem",
112
115
  "MilvusDataType",
@@ -143,6 +146,7 @@ __all__ = [
143
146
  "UnauthorizedError",
144
147
  "UnprocessableEntityError",
145
148
  "UserAssistantPair",
149
+ "UserMemory",
146
150
  "ValidationError",
147
151
  "ValidationErrorLocItem",
148
152
  "VectorStoreChunk",
@@ -103,8 +103,6 @@ class CortexAI:
103
103
  self, *, request_options: typing.Optional[RequestOptions] = None
104
104
  ) -> typing.Optional[typing.Any]:
105
105
  """
106
- Endpoint that serves Prometheus metrics.
107
-
108
106
  Parameters
109
107
  ----------
110
108
  request_options : typing.Optional[RequestOptions]
@@ -213,8 +211,6 @@ class AsyncCortexAI:
213
211
  self, *, request_options: typing.Optional[RequestOptions] = None
214
212
  ) -> typing.Optional[typing.Any]:
215
213
  """
216
- Endpoint that serves Prometheus metrics.
217
-
218
214
  Parameters
219
215
  ----------
220
216
  request_options : typing.Optional[RequestOptions]
@@ -27,11 +27,6 @@ class DashboardClient:
27
27
 
28
28
  def list_apis(self, *, request_options: typing.Optional[RequestOptions] = None) -> DashboardApisResponse:
29
29
  """
30
- List all API keys for dashboard view.
31
-
32
- Uses Firebase authentication to identify the user and returns API keys
33
- associated with that user.
34
-
35
30
  Parameters
36
31
  ----------
37
32
  request_options : typing.Optional[RequestOptions]
@@ -56,10 +51,6 @@ class DashboardClient:
56
51
  self, *, tenant_id: str, sub_tenant_id: str, request_options: typing.Optional[RequestOptions] = None
57
52
  ) -> DashboardSourcesResponse:
58
53
  """
59
- List all sources for a tenant/sub-tenant combination.
60
-
61
- Uses the same logic as the existing get_sources function.
62
-
63
54
  Parameters
64
55
  ----------
65
56
  tenant_id : str
@@ -81,7 +72,7 @@ class DashboardClient:
81
72
  from usecortex-ai import CortexAI
82
73
 
83
74
  client = CortexAI(token="YOUR_TOKEN", )
84
- client.dashboard.list_sources(tenant_id='tenant_id', sub_tenant_id='sub_tenant_id', )
75
+ client.dashboard.list_sources(tenant_id='tenant_1234', sub_tenant_id='sub_tenant_4567', )
85
76
  """
86
77
  _response = self._raw_client.list_sources(
87
78
  tenant_id=tenant_id, sub_tenant_id=sub_tenant_id, request_options=request_options
@@ -90,11 +81,6 @@ class DashboardClient:
90
81
 
91
82
  def list_tenants(self, *, request_options: typing.Optional[RequestOptions] = None) -> DashboardTenantsResponse:
92
83
  """
93
- List all tenants for dashboard view.
94
-
95
- Uses Firebase authentication to identify the user and returns tenant
96
- mappings associated with that user's organization.
97
-
98
84
  Parameters
99
85
  ----------
100
86
  request_options : typing.Optional[RequestOptions]
@@ -231,11 +217,6 @@ class AsyncDashboardClient:
231
217
 
232
218
  async def list_apis(self, *, request_options: typing.Optional[RequestOptions] = None) -> DashboardApisResponse:
233
219
  """
234
- List all API keys for dashboard view.
235
-
236
- Uses Firebase authentication to identify the user and returns API keys
237
- associated with that user.
238
-
239
220
  Parameters
240
221
  ----------
241
222
  request_options : typing.Optional[RequestOptions]
@@ -264,10 +245,6 @@ class AsyncDashboardClient:
264
245
  self, *, tenant_id: str, sub_tenant_id: str, request_options: typing.Optional[RequestOptions] = None
265
246
  ) -> DashboardSourcesResponse:
266
247
  """
267
- List all sources for a tenant/sub-tenant combination.
268
-
269
- Uses the same logic as the existing get_sources function.
270
-
271
248
  Parameters
272
249
  ----------
273
250
  tenant_id : str
@@ -292,7 +269,7 @@ class AsyncDashboardClient:
292
269
 
293
270
  client = AsyncCortexAI(token="YOUR_TOKEN", )
294
271
  async def main() -> None:
295
- await client.dashboard.list_sources(tenant_id='tenant_id', sub_tenant_id='sub_tenant_id', )
272
+ await client.dashboard.list_sources(tenant_id='tenant_1234', sub_tenant_id='sub_tenant_4567', )
296
273
  asyncio.run(main())
297
274
  """
298
275
  _response = await self._raw_client.list_sources(
@@ -304,11 +281,6 @@ class AsyncDashboardClient:
304
281
  self, *, request_options: typing.Optional[RequestOptions] = None
305
282
  ) -> DashboardTenantsResponse:
306
283
  """
307
- List all tenants for dashboard view.
308
-
309
- Uses Firebase authentication to identify the user and returns tenant
310
- mappings associated with that user's organization.
311
-
312
284
  Parameters
313
285
  ----------
314
286
  request_options : typing.Optional[RequestOptions]