usecortex-ai 0.3.1__py3-none-any.whl → 0.3.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.
@@ -0,0 +1,180 @@
1
+ Metadata-Version: 2.4
2
+ Name: usecortex-ai
3
+ Version: 0.3.2
4
+ Summary: The official Python SDK for the Cortex AI platform.
5
+ Author-email: Nishkarsh Shrivastava <nishkarsh@usecortex.ai>
6
+ License: Copyright (c) 2024 Cortex AI
7
+
8
+ All Rights Reserved.
9
+
10
+ PROPRIETARY AND CONFIDENTIAL
11
+
12
+ This software is the proprietary and confidential property of Cortex AI ("the Company").
13
+ Permission is hereby granted to authorized 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.
14
+
15
+ You may not, without the express written permission of the Company:
16
+
17
+ 1. Copy, modify, or create derivative works of the software.
18
+ 2. Distribute, sell, rent, lease, sublicense, or otherwise transfer the software to any third party.
19
+ 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.
20
+
21
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
+ SOFTWARE.
28
+ Project-URL: Homepage, https://www.usecortex.ai/
29
+ Project-URL: Documentation, https://docs.usecortex.ai/
30
+ Keywords: cortex,ai,sdk,api,generative ai,rag
31
+ Classifier: Development Status :: 5 - Production/Stable
32
+ Classifier: Programming Language :: Python :: 3
33
+ Classifier: Programming Language :: Python :: 3.10
34
+ Classifier: Programming Language :: Python :: 3.11
35
+ Classifier: Programming Language :: Python :: 3.12
36
+ Classifier: Intended Audience :: Developers
37
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
38
+ Classifier: Typing :: Typed
39
+ Requires-Python: >=3.10
40
+ Description-Content-Type: text/markdown
41
+ License-File: LICENSE
42
+ Requires-Dist: httpx>=0.24
43
+ Requires-Dist: pydantic<3,>=1.10
44
+ Dynamic: license-file
45
+
46
+ # Cortex AI Python SDK - [usecortex.ai](https://www.usecortex.ai/)
47
+
48
+ The official Python SDK for the Cortex AI platform. Build powerful, context-aware AI applications in your Python applications.
49
+
50
+ **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.
51
+
52
+ [Learn more about the SDK from our docs](https://docs.usecortex.ai/)
53
+
54
+ ## Core features
55
+
56
+ * **Dynamic retrieval and querying** that always retrieve the most relevant context
57
+ * **Built-in long-term memory** that evolves with every user interaction
58
+ * **Personalization hooks** for user preferences, intent, and history
59
+ * **Developer-first SDK** with the most flexible APIs and fine-grained controls
60
+
61
+ ## Getting started
62
+
63
+ ### Installation
64
+
65
+ ```bash
66
+ pip install usecortex-ai
67
+ ```
68
+
69
+ ### Client setup
70
+
71
+ 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.
72
+
73
+ ```python
74
+ import os
75
+ from usecortex_ai import CortexAI, AsyncCortexAI
76
+
77
+ api_key = os.environ["CORTEX_API_KEY"] # Set your Cortex API key in the environment variable CORTEX_API_KEY. Optional, but recommended.
78
+
79
+ # Sync client
80
+ client = CortexAI(token=api_key)
81
+
82
+ # Async client (for async/await usage)
83
+ async_client = AsyncCortexAI(token=api_key)
84
+ ```
85
+
86
+ ### Create a Tenant
87
+
88
+ 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)
89
+
90
+ ```python
91
+ def create_tenant():
92
+ return client.user.create_tenant(tenant_id="my-company")
93
+ ```
94
+
95
+ ### Index Your Data
96
+
97
+ When you index your data, you make it ready for retrieval from Cortex using natural language.
98
+
99
+ ```python
100
+ # Upload text content
101
+ def upload_text():
102
+ return client.upload.upload_text(
103
+ tenant_id="my-company-py-sync",
104
+ sub_tenant_id="engineering",
105
+ content="Our API rate limits are 1000 requests per minute for premium accounts.",
106
+ file_id="api-docs-rate-limits",
107
+ tenant_metadata={"sub_tenant_id": "engineering"}
108
+ )
109
+
110
+ # Upload document file
111
+ def upload_file():
112
+ with open("company-handbook.pdf", 'rb') as file_obj:
113
+ file_data = ("company-handbook.pdf", file_obj)
114
+ return client.upload.upload_document(
115
+ tenant_id="my-company",
116
+ file=file_data,
117
+ file_id="company-handbook.pdf"
118
+ )
119
+ ```
120
+
121
+ **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).
122
+
123
+ ### Search and retrieval
124
+
125
+ ```python
126
+ # Semantic search with retrieval
127
+ results = client.search.retrieve(
128
+ query="What are the API rate limits?",
129
+ tenant_id="my-company",
130
+ sub_tenant_id="engineering",
131
+ max_chunks=10
132
+ )
133
+
134
+ # List all sources
135
+ all_sources = client.sources.get_all(
136
+ tenant_id="my-company",
137
+ sub_tenant_id="engineering",
138
+ )
139
+
140
+ # Get specific sources by ID
141
+ specific_sources = client.sources.get_by_ids(
142
+ tenant_id="my-company",
143
+ sub_tenant_id="engineering",
144
+ source_ids=["api-docs-rate-limits", "company-handbook"]
145
+ )
146
+ ```
147
+
148
+ **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).
149
+
150
+ ## SDK Method Structure & Type Safety
151
+
152
+ Our SDKs follow a predictable pattern that mirrors the API structure while providing full type safety.
153
+
154
+ > **Method Mapping** : `client.<group>.<function_name>` mirrors `api.usecortex.ai/<group>/<function_name>`
155
+ >
156
+ > For example: `client.upload.upload_text()` corresponds to `POST /upload/upload_text`
157
+
158
+ The SDKs provide exact type parity with the API specification:
159
+
160
+ - **Request Parameters** : Every field documented in the API reference (required, optional, types, validation rules) is reflected in the SDK method signatures
161
+ - **Response Objects** : Return types match the exact JSON schema documented for each endpoint
162
+ - **Error Types** : Exception structures mirror the error response formats from the API
163
+ - **Nested Objects** : Complex nested parameters and responses maintain their full structure and typing
164
+
165
+ > 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.
166
+ >
167
+ > Just hit **Cmd+Space/Ctrl+Space!**
168
+
169
+ ## Links
170
+
171
+ - **Homepage:** [usecortex.ai](https://www.usecortex.ai/)
172
+ - **Documentation:** [docs.usecortex.ai](https://docs.usecortex.ai/)
173
+
174
+ ## Our docs
175
+
176
+ 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.
177
+
178
+ ## Support
179
+
180
+ If you have any questions or need help, please reach out to our support team at [founders@usecortex.ai](mailto:founders@usecortex.ai).
@@ -94,8 +94,8 @@ usecortex_ai/user/raw_client.py,sha256=RnloKJVojvAknaylQknMUY9kS0HwP6_QjcmMuFvvi
94
94
  usecortex_ai/user_memory/__init__.py,sha256=_VhToAyIt_5axN6CLJwtxg3-CO7THa_23pbUzqhXJa4,85
95
95
  usecortex_ai/user_memory/client.py,sha256=tvRx5U_x8VtE7hUN52AMlMMVsWOgUcEK4rzXrVUNHXM,21299
96
96
  usecortex_ai/user_memory/raw_client.py,sha256=XVsgzClh57SQWtUXc2ikaywbYRME6zA25PSIu7-9m4M,59521
97
- usecortex_ai-0.3.1.dist-info/licenses/LICENSE,sha256=ExSrDLXpv6Bq3AiBk9VwLfysI9Fj-L3LqJNGKqbxNzw,1256
98
- usecortex_ai-0.3.1.dist-info/METADATA,sha256=R_P9TggMnCwtU2M9muxDbU6LQcz9qo4glxbe1nQxMfw,2965
99
- usecortex_ai-0.3.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
100
- usecortex_ai-0.3.1.dist-info/top_level.txt,sha256=TQ77el6hL0CvN7BTXJVFTqZ5ot1_kHKo2ZnEcOvZsjo,13
101
- usecortex_ai-0.3.1.dist-info/RECORD,,
97
+ usecortex_ai-0.3.2.dist-info/licenses/LICENSE,sha256=ExSrDLXpv6Bq3AiBk9VwLfysI9Fj-L3LqJNGKqbxNzw,1256
98
+ usecortex_ai-0.3.2.dist-info/METADATA,sha256=Tu6li-hWbHf7gniy23vR0phfYogzAszVKUaXGS_jjJY,7961
99
+ usecortex_ai-0.3.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
100
+ usecortex_ai-0.3.2.dist-info/top_level.txt,sha256=TQ77el6hL0CvN7BTXJVFTqZ5ot1_kHKo2ZnEcOvZsjo,13
101
+ usecortex_ai-0.3.2.dist-info/RECORD,,
@@ -1,66 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: usecortex-ai
3
- Version: 0.3.1
4
- Summary: The official Python SDK for the Cortex AI platform.
5
- Author-email: Nishkarsh Shrivastava <nishkarsh@usecortex.ai>
6
- License: Copyright (c) 2024 Cortex AI
7
-
8
- All Rights Reserved.
9
-
10
- PROPRIETARY AND CONFIDENTIAL
11
-
12
- This software is the proprietary and confidential property of Cortex AI ("the Company").
13
- Permission is hereby granted to authorized 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.
14
-
15
- You may not, without the express written permission of the Company:
16
-
17
- 1. Copy, modify, or create derivative works of the software.
18
- 2. Distribute, sell, rent, lease, sublicense, or otherwise transfer the software to any third party.
19
- 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.
20
-
21
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
- SOFTWARE.
28
- Project-URL: Homepage, https://www.usecortex.ai/
29
- Project-URL: Documentation, https://docs.usecortex.ai/
30
- Keywords: cortex,ai,sdk,api,generative ai,rag
31
- Classifier: Development Status :: 4 - Beta
32
- Classifier: Programming Language :: Python :: 3
33
- Classifier: Programming Language :: Python :: 3.10
34
- Classifier: Programming Language :: Python :: 3.11
35
- Classifier: Programming Language :: Python :: 3.12
36
- Classifier: Intended Audience :: Developers
37
- Classifier: Topic :: Software Development :: Libraries :: Python Modules
38
- Classifier: Typing :: Typed
39
- Requires-Python: >=3.10
40
- Description-Content-Type: text/markdown
41
- License-File: LICENSE
42
- Requires-Dist: httpx>=0.24
43
- Requires-Dist: pydantic<3,>=1.10
44
- Dynamic: license-file
45
-
46
- ```
47
-
48
- ```
49
-
50
-
51
- # Cortex AI Python SDK
52
-
53
- The official Python SDK for the Cortex AI platform. Build powerful, context-aware AI applications in your Python applications.
54
-
55
- ## Links
56
-
57
- - **Homepage:** [usecortex.ai](https://www.usecortex.ai/)
58
- - **Documentation:** [docs.usecortex.ai](https://docs.usecortex.ai/)
59
-
60
- ## Getting Started
61
-
62
- Please refer to our [SDK documentation](https://docs.usecortex.ai/api-reference/sdks) and [API reference](https://docs.usecortex.ai/api-reference/introduction) to get started.
63
-
64
- ## Support
65
-
66
- If you have any questions or need help, please reach out to our support team at [founders@usecortex.ai](mailto:founders@usecortex.ai).