ainative-agent 0.1.0__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 (31) hide show
  1. ainative_agent-0.1.0/.gitignore +286 -0
  2. ainative_agent-0.1.0/LICENSE +189 -0
  3. ainative_agent-0.1.0/PKG-INFO +132 -0
  4. ainative_agent-0.1.0/README.md +96 -0
  5. ainative_agent-0.1.0/pyproject.toml +65 -0
  6. ainative_agent-0.1.0/src/ainative_agent/__init__.py +27 -0
  7. ainative_agent-0.1.0/src/ainative_agent/_http.py +126 -0
  8. ainative_agent-0.1.0/src/ainative_agent/agents.py +121 -0
  9. ainative_agent-0.1.0/src/ainative_agent/billing.py +77 -0
  10. ainative_agent-0.1.0/src/ainative_agent/chat.py +65 -0
  11. ainative_agent-0.1.0/src/ainative_agent/classify.py +44 -0
  12. ainative_agent-0.1.0/src/ainative_agent/client.py +146 -0
  13. ainative_agent-0.1.0/src/ainative_agent/errors.py +56 -0
  14. ainative_agent-0.1.0/src/ainative_agent/events.py +91 -0
  15. ainative_agent-0.1.0/src/ainative_agent/files.py +75 -0
  16. ainative_agent-0.1.0/src/ainative_agent/graph.py +186 -0
  17. ainative_agent-0.1.0/src/ainative_agent/memory.py +108 -0
  18. ainative_agent-0.1.0/src/ainative_agent/registry.py +53 -0
  19. ainative_agent-0.1.0/src/ainative_agent/tables.py +92 -0
  20. ainative_agent-0.1.0/src/ainative_agent/tasks.py +87 -0
  21. ainative_agent-0.1.0/src/ainative_agent/threads.py +91 -0
  22. ainative_agent-0.1.0/src/ainative_agent/types.py +267 -0
  23. ainative_agent-0.1.0/src/ainative_agent/vectors.py +64 -0
  24. ainative_agent-0.1.0/tests/__init__.py +0 -0
  25. ainative_agent-0.1.0/tests/conftest.py +41 -0
  26. ainative_agent-0.1.0/tests/test_agents.py +143 -0
  27. ainative_agent-0.1.0/tests/test_billing.py +113 -0
  28. ainative_agent-0.1.0/tests/test_client.py +110 -0
  29. ainative_agent-0.1.0/tests/test_memory.py +112 -0
  30. ainative_agent-0.1.0/tests/test_registry.py +108 -0
  31. ainative_agent-0.1.0/tests/test_tasks.py +106 -0
@@ -0,0 +1,286 @@
1
+ # Logs
2
+ logs
3
+ *.log
4
+ npm-debug.log*
5
+ yarn-debug.log*
6
+ yarn-error.log*
7
+ pnpm-debug.log*
8
+ lerna-debug.log*
9
+
10
+ node_modules
11
+ dist
12
+ dist-ssr
13
+ *.local
14
+ .env
15
+
16
+ # Editor directories and files
17
+ .vscode/*
18
+ !.vscode/extensions.json
19
+ .idea
20
+ .DS_Store
21
+ *.suo
22
+ *.ntvs*
23
+ *.njsproj
24
+ *.sln
25
+ *.sw?
26
+
27
+ /generated/prisma
28
+
29
+ # Test coverage reports
30
+ coverage/
31
+ test-results/
32
+ playwright-report/
33
+
34
+ # Build artifacts
35
+ *.tsbuildinfo
36
+
37
+ # Byte-compiled / optimized / DLL files
38
+ __pycache__/
39
+ *.py[cod]
40
+ *$py.class
41
+ *.pyc
42
+ *.pyo
43
+ *.pyd
44
+
45
+ # C extensions
46
+ *.so
47
+
48
+ # VS Code embedded repository - selective exclusion
49
+ src/vscode/.git/
50
+ src/vscode/node_modules/
51
+ src/vscode/out/
52
+ src/vscode/.build/
53
+ # Keep essential VS Code fork source code and configuration
54
+
55
+ # Test database
56
+ src/backend/test.db
57
+
58
+ # Distribution / packaging
59
+ .Python
60
+ build/
61
+ develop-eggs/
62
+ downloads/
63
+ eggs/
64
+ .eggs/
65
+ lib/
66
+ lib64/
67
+ parts/
68
+ sdist/
69
+ var/
70
+ wheels/
71
+ pip-wheel-metadata/
72
+ share/python-wheels/
73
+ *.egg-info/
74
+ .installed.cfg
75
+ *.egg
76
+ MANIFEST
77
+
78
+ # PyInstaller
79
+ # Usually these files are written by a python script from a template
80
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
81
+ *.manifest
82
+ *.spec
83
+
84
+ # Installer logs
85
+ pip-log.txt
86
+ pip-delete-this-directory.txt
87
+
88
+ # Unit test / coverage reports
89
+ htmlcov/
90
+ .tox/
91
+ .nox/
92
+ .coverage
93
+ .coverage.*
94
+ .cache
95
+ nosetests.xml
96
+ coverage.xml
97
+ *.cover
98
+ *.py,cover
99
+ .hypothesis/
100
+ .pytest_cache/
101
+ cover/
102
+
103
+ # Translations
104
+ *.mo
105
+ *.pot
106
+
107
+ # Django stuff:
108
+ local_settings.py
109
+ db.sqlite3
110
+ db.sqlite3-journal
111
+
112
+ # Flask stuff:
113
+ instance/
114
+ .webassets-cache
115
+
116
+ # Scrapy stuff:
117
+ .scrapy
118
+
119
+ # Sphinx documentation
120
+ docs/_build/
121
+
122
+ # PyBuilder
123
+ .pybuilder/
124
+ target/
125
+
126
+ # Jupyter Notebook
127
+ .ipynb_checkpoints
128
+
129
+ # IPython
130
+ profile_default/
131
+ ipython_config.py
132
+
133
+ # pyenv
134
+ # For a library or package, you might want to ignore these files since the code is
135
+ # intended to run in multiple environments; otherwise, check them in:
136
+ # .python-version
137
+
138
+ # pipenv
139
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
140
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
141
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
142
+ # install all needed dependencies.
143
+ #Pipfile.lock
144
+
145
+ # UV
146
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
147
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
148
+ # commonly ignored for libraries.
149
+ #uv.lock
150
+
151
+ # poetry
152
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
153
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
154
+ # commonly ignored for libraries.
155
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
156
+ #poetry.lock
157
+
158
+ # pdm
159
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
160
+ #pdm.lock
161
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
162
+ # in version control.
163
+ # https://pdm.fming.dev/latest/usage/project/#working-with-version-control
164
+ .pdm.toml
165
+ .pdm-python
166
+ .pdm-build/
167
+
168
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
169
+ __pypackages__/
170
+
171
+ # Celery stuff
172
+ celerybeat-schedule
173
+ celerybeat.pid
174
+
175
+ # SageMath parsed files
176
+ *.sage.py
177
+
178
+ # Virtual environments
179
+ venv/
180
+ .venv/
181
+ env/
182
+ .env/
183
+ ENV/
184
+ env.bak/
185
+ venv.bak/
186
+
187
+ # Spyder project settings
188
+ .spyderproject
189
+ .spyproject
190
+
191
+ # Rope project settings
192
+ .ropeproject
193
+
194
+ # mkdocs documentation
195
+ /site
196
+
197
+ # mypy
198
+ .mypy_cache/
199
+ .dmypy.json
200
+ dmypy.json
201
+
202
+ # Pyre type checker
203
+ .pyre/
204
+
205
+ # pytype static type analyzer
206
+ .pytype/
207
+
208
+ # Cython debug symbols
209
+ cython_debug/
210
+
211
+ # PyCharm
212
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
213
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
214
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
215
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
216
+ #.idea/
217
+
218
+ # PyPI configuration file
219
+ .pypirc
220
+
221
+ # Node.js
222
+ .npm
223
+
224
+ # Electron
225
+ out/
226
+
227
+ # VS Code fork specific
228
+ src/vscode/.vs
229
+ src/vscode/.vscode-test
230
+
231
+ # windsurf rules
232
+ .windsurfrules
233
+
234
+ # Unrelated projects
235
+ agentpay-api/
236
+ codeagent/
237
+ vibe-coding-site/
238
+ ainative-browser-builder/
239
+ # ZeroDB/ - Removed to allow src/backend/app/zerodb/ API files to be committed
240
+ # Note: src/backend/tests/ is NOT ignored - only root tests/ folder was previously ignored (removed)
241
+
242
+ # Temporary files
243
+ temp/
244
+ tmp/
245
+ temp_projects/
246
+
247
+ # API endpoint documentation (should be in docs repo)
248
+ *_ENDPOINTS.md
249
+ API_ENDPOINTS_ANALYSIS.md
250
+ ZERODB_ENDPOINTS.md
251
+ USER_CODE_QUALITY_DEBUGGING_ENDPOINTS.md
252
+ ADMIN_ENDPOINTS.md
253
+ PUBLIC_ENDPOINTS.md
254
+
255
+ # Test files
256
+ test-mcp-*.js
257
+ setup-task-db.js
258
+
259
+ # Additional cleanup patterns
260
+ *.backup
261
+ *.bak
262
+ *_env/
263
+ cody_venv*/
264
+ chromium_test_repo/
265
+ test_limited_files/
266
+ .python-version
267
+
268
+ # ZeroDB CLI - Now included in monorepo (was: managed in separate repo)
269
+ # zerodb-local/cli/
270
+
271
+ # Claude Code configuration (project-specific)
272
+ .mcp.json
273
+ .claude_backup/.claude/
274
+ .claude.backup/
275
+ .claude/user-identities.json
276
+
277
+ # Daily reports (auto-generated, not committed)
278
+ docs/reports/daily/
279
+
280
+ # Daily report scripts (local-only)
281
+ scripts/generate-daily-report.sh
282
+ scripts/send-daily-report-whatsapp.sh
283
+ .env
284
+ .claude
285
+ .mcp.json
286
+ docs/recovery/current_db_backup_20260314.sql
@@ -0,0 +1,189 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work.
38
+
39
+ "Derivative Works" shall mean any work, whether in Source or Object
40
+ form, that is based on (or derived from) the Work and for which the
41
+ editorial revisions, annotations, elaborations, or other modifications
42
+ represent, as a whole, an original work of authorship. For the purposes
43
+ of this License, Derivative Works shall not include works that remain
44
+ separable from, or merely link (or bind by name) to the interfaces of,
45
+ the Work and Derivative Works thereof.
46
+
47
+ "Contribution" shall mean any work of authorship, including
48
+ the original version of the Work and any modifications or additions
49
+ to that Work or Derivative Works thereof, that is intentionally
50
+ submitted to the Licensor for inclusion in the Work by the copyright owner
51
+ or by an individual or Legal Entity authorized to submit on behalf of
52
+ the copyright owner. For the purposes of this definition, "submitted"
53
+ means any form of electronic, verbal, or written communication sent
54
+ to the Licensor or its representatives, including but not limited to
55
+ communication on electronic mailing lists, source code control systems,
56
+ and issue tracking systems that are managed by, or on behalf of, the
57
+ Licensor for the purpose of discussing and improving the Work, but
58
+ excluding communication that is conspicuously marked or otherwise
59
+ designated in writing by the copyright owner as "Not a Contribution."
60
+
61
+ "Contributor" shall mean Licensor and any individual or Legal Entity
62
+ on behalf of whom a Contribution has been received by the Licensor and
63
+ subsequently incorporated within the Work.
64
+
65
+ 2. Grant of Copyright License. Subject to the terms and conditions of
66
+ this License, each Contributor hereby grants to You a perpetual,
67
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
68
+ copyright license to reproduce, prepare Derivative Works of,
69
+ publicly display, publicly perform, sublicense, and distribute the
70
+ Work and such Derivative Works in Source or Object form.
71
+
72
+ 3. Grant of Patent License. Subject to the terms and conditions of
73
+ this License, each Contributor hereby grants to You a perpetual,
74
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
75
+ (except as stated in this section) patent license to make, have made,
76
+ use, offer to sell, sell, import, and otherwise transfer the Work,
77
+ where such license applies only to those patent claims licensable
78
+ by such Contributor that are necessarily infringed by their
79
+ Contribution(s) alone or by combination of their Contribution(s)
80
+ with the Work to which such Contribution(s) was submitted. If You
81
+ institute patent litigation against any entity (including a
82
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
83
+ or a Contribution incorporated within the Work constitutes direct
84
+ or contributory patent infringement, then any patent licenses
85
+ granted to You under this License for that Work shall terminate
86
+ as of the date such litigation is filed.
87
+
88
+ 4. Redistribution. You may reproduce and distribute copies of the
89
+ Work or Derivative Works thereof in any medium, with or without
90
+ modifications, and in Source or Object form, provided that You
91
+ meet the following conditions:
92
+
93
+ (a) You must give any other recipients of the Work or
94
+ Derivative Works a copy of this License; and
95
+
96
+ (b) You must cause any modified files to carry prominent notices
97
+ stating that You changed the files; and
98
+
99
+ (c) You must retain, in the Source form of any Derivative Works
100
+ that You distribute, all copyright, patent, trademark, and
101
+ attribution notices from the Source form of the Work,
102
+ excluding those notices that do not pertain to any part of
103
+ the Derivative Works; and
104
+
105
+ (d) If the Work includes a "NOTICE" text file as part of its
106
+ distribution, then any Derivative Works that You distribute must
107
+ include a readable copy of the attribution notices contained
108
+ within such NOTICE file, excluding any notices that do not
109
+ pertain to any part of the Derivative Works, in at least one
110
+ of the following places: within a NOTICE text file distributed
111
+ as part of the Derivative Works; within the Source form or
112
+ documentation, if provided along with the Derivative Works; or,
113
+ within a display generated by the Derivative Works, if and
114
+ wherever such third-party notices normally appear. The contents
115
+ of the NOTICE file are for informational purposes only and
116
+ do not modify the License. You may add Your own attribution
117
+ notices within Derivative Works that You distribute, alongside
118
+ or as an addendum to the NOTICE text from the Work, provided
119
+ that such additional attribution notices cannot be construed
120
+ as modifying the License.
121
+
122
+ You may add Your own copyright statement to Your modifications and
123
+ may provide additional or different license terms and conditions
124
+ for use, reproduction, or distribution of Your modifications, or
125
+ for any such Derivative Works as a whole, provided Your use,
126
+ reproduction, and distribution of the Work otherwise complies with
127
+ the conditions stated in this License.
128
+
129
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
130
+ any Contribution intentionally submitted for inclusion in the Work
131
+ by You to the Licensor shall be under the terms and conditions of
132
+ this License, without any additional terms or conditions.
133
+ Notwithstanding the above, nothing herein shall supersede or modify
134
+ the terms of any separate license agreement you may have executed
135
+ with Licensor regarding such Contributions.
136
+
137
+ 6. Trademarks. This License does not grant permission to use the trade
138
+ names, trademarks, service marks, or product names of the Licensor,
139
+ except as required for reasonable and customary use in describing the
140
+ origin of the Work and reproducing the content of the NOTICE file.
141
+
142
+ 7. Disclaimer of Warranty. Unless required by applicable law or
143
+ agreed to in writing, Licensor provides the Work (and each
144
+ Contributor provides its Contributions) on an "AS IS" BASIS,
145
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
146
+ implied, including, without limitation, any warranties or conditions
147
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
148
+ PARTICULAR PURPOSE. You are solely responsible for determining the
149
+ appropriateness of using or redistributing the Work and assume any
150
+ risks associated with Your exercise of permissions under this License.
151
+
152
+ 8. Limitation of Liability. In no event and under no legal theory,
153
+ whether in tort (including negligence), contract, or otherwise,
154
+ unless required by applicable law (such as deliberate and grossly
155
+ negligent acts) or agreed to in writing, shall any Contributor be
156
+ liable to You for damages, including any direct, indirect, special,
157
+ incidental, or consequential damages of any character arising as a
158
+ result of this License or out of the use or inability to use the
159
+ Work (including but not limited to damages for loss of goodwill,
160
+ work stoppage, computer failure or malfunction, or any and all
161
+ other commercial damages or losses), even if such Contributor
162
+ has been advised of the possibility of such damages.
163
+
164
+ 9. Accepting Warranty or Additional Liability. While redistributing
165
+ the Work or Derivative Works thereof, You may choose to offer,
166
+ and charge a fee for, acceptance of support, warranty, indemnity,
167
+ or other liability obligations and/or rights consistent with this
168
+ License. However, in accepting such obligations, You may act only
169
+ on Your own behalf and on Your sole responsibility, not on behalf
170
+ of any other Contributor, and only if You agree to indemnify,
171
+ defend, and hold each Contributor harmless for any liability
172
+ incurred by, or claims asserted against, such Contributor by reason
173
+ of your accepting any such warranty or additional liability.
174
+
175
+ END OF TERMS AND CONDITIONS
176
+
177
+ Copyright 2026 AINative Studio
178
+
179
+ Licensed under the Apache License, Version 2.0 (the "License");
180
+ you may not use this file except in compliance with the License.
181
+ You may obtain a copy of the License at
182
+
183
+ http://www.apache.org/licenses/LICENSE-2.0
184
+
185
+ Unless required by applicable law or agreed to in writing, software
186
+ distributed under the License is distributed on an "AS IS" BASIS,
187
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
188
+ See the License for the specific language governing permissions and
189
+ limitations under the License.
@@ -0,0 +1,132 @@
1
+ Metadata-Version: 2.4
2
+ Name: ainative-agent
3
+ Version: 0.1.0
4
+ Summary: Python SDK for AINative Agent APIs - agents, swarm, memory, graph, vectors, chat, files, tables, threads, events
5
+ Project-URL: Homepage, https://ainative.studio/agent-cloud
6
+ Project-URL: Documentation, https://docs.ainative.studio
7
+ Project-URL: Repository, https://github.com/AINative-Studio/core
8
+ Project-URL: Bug Tracker, https://github.com/AINative-Studio/core/issues
9
+ Author-email: AINative Studio <dev@ainative.studio>
10
+ License: MIT
11
+ License-File: LICENSE
12
+ Keywords: agent-cloud,agent-sdk,agentic-ai,ai-agents,ainative,autonomous-agents,graphrag,mcp,openclaw,python,swarm,x402,zerodb,zeromemory
13
+ Classifier: Development Status :: 3 - Alpha
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.9
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Typing :: Typed
22
+ Requires-Python: >=3.9
23
+ Requires-Dist: httpx>=0.27
24
+ Requires-Dist: pydantic>=2.0
25
+ Requires-Dist: websockets>=12.0
26
+ Provides-Extra: dev
27
+ Requires-Dist: build>=1.0; extra == 'dev'
28
+ Requires-Dist: mypy>=1.10; extra == 'dev'
29
+ Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
30
+ Requires-Dist: pytest-cov>=4.0; extra == 'dev'
31
+ Requires-Dist: pytest-httpx>=0.30; extra == 'dev'
32
+ Requires-Dist: pytest>=8.0; extra == 'dev'
33
+ Requires-Dist: ruff>=0.4; extra == 'dev'
34
+ Requires-Dist: twine>=5.0; extra == 'dev'
35
+ Description-Content-Type: text/markdown
36
+
37
+ # ainative-agent
38
+
39
+ Python SDK for all AINative Agent APIs -- agents, swarm tasks, memory, graph, vectors, chat, files, tables, threads, and real-time events.
40
+
41
+ ## Install
42
+
43
+ ```bash
44
+ pip install ainative-agent
45
+ ```
46
+
47
+ ## Quick Start
48
+
49
+ ```python
50
+ import asyncio
51
+ from ainative_agent import AINativeClient
52
+
53
+ async def main():
54
+ async with AINativeClient(api_key="sk-your-key") as client:
55
+ # Register an agent
56
+ agent = await client.agents.register(
57
+ "my-agent", "worker", ["read", "write"]
58
+ )
59
+
60
+ # Store a memory
61
+ memory = await client.memory.remember(
62
+ "User prefers dark mode",
63
+ entity_id="user-123",
64
+ importance=0.8,
65
+ )
66
+
67
+ # Recall memories
68
+ results = await client.memory.recall("user preferences", entity_id="user-123")
69
+
70
+ # Submit a swarm task
71
+ task = await client.tasks.submit(
72
+ "Analyze error logs from last 24h",
73
+ agent_types=["analyst"],
74
+ )
75
+
76
+ # Poll until complete
77
+ async for update in client.tasks.poll(task.task_id):
78
+ print(f"Status: {update.status}")
79
+
80
+ asyncio.run(main())
81
+ ```
82
+
83
+ ## Modules
84
+
85
+ | Module | Description |
86
+ |--------|-------------|
87
+ | `client.agents` | Agent registration, keys, and audit (AAP) |
88
+ | `client.tasks` | Swarm task submission and polling |
89
+ | `client.memory` | ZeroMemory: remember, recall, forget, reflect |
90
+ | `client.graph` | Context graph: entities, edges, GraphRAG, ontology |
91
+ | `client.vectors` | Vector embeddings: upsert, search, delete |
92
+ | `client.files` | File storage: upload, download, presigned URLs |
93
+ | `client.tables` | NoSQL tables: create, query, insert, update |
94
+ | `client.chat` | Chat completions with streaming |
95
+ | `client.threads` | Conversation threads |
96
+ | `client.events` | Real-time WebSocket events |
97
+
98
+ ## Authentication
99
+
100
+ The SDK supports two authentication methods:
101
+
102
+ ```python
103
+ # API Key (recommended for server-side)
104
+ client = AINativeClient(api_key="sk-your-key")
105
+
106
+ # JWT Token (for user-scoped access)
107
+ client = AINativeClient(token="eyJ...")
108
+ ```
109
+
110
+ ## Error Handling
111
+
112
+ ```python
113
+ from ainative_agent import AINativeClient, AuthenticationError, RateLimitError, APIError
114
+
115
+ async with AINativeClient(api_key="sk-key") as client:
116
+ try:
117
+ agent = await client.agents.get("nonexistent")
118
+ except AuthenticationError:
119
+ print("Invalid credentials")
120
+ except RateLimitError as e:
121
+ print(f"Rate limited, retry after {e.retry_after}s")
122
+ except APIError as e:
123
+ print(f"API error {e.status_code}: {e.message}")
124
+ ```
125
+
126
+ ## Retry Behavior
127
+
128
+ The SDK automatically retries requests on transient errors (429, 5xx) with exponential backoff, up to 3 attempts.
129
+
130
+ ## License
131
+
132
+ Apache-2.0
@@ -0,0 +1,96 @@
1
+ # ainative-agent
2
+
3
+ Python SDK for all AINative Agent APIs -- agents, swarm tasks, memory, graph, vectors, chat, files, tables, threads, and real-time events.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ pip install ainative-agent
9
+ ```
10
+
11
+ ## Quick Start
12
+
13
+ ```python
14
+ import asyncio
15
+ from ainative_agent import AINativeClient
16
+
17
+ async def main():
18
+ async with AINativeClient(api_key="sk-your-key") as client:
19
+ # Register an agent
20
+ agent = await client.agents.register(
21
+ "my-agent", "worker", ["read", "write"]
22
+ )
23
+
24
+ # Store a memory
25
+ memory = await client.memory.remember(
26
+ "User prefers dark mode",
27
+ entity_id="user-123",
28
+ importance=0.8,
29
+ )
30
+
31
+ # Recall memories
32
+ results = await client.memory.recall("user preferences", entity_id="user-123")
33
+
34
+ # Submit a swarm task
35
+ task = await client.tasks.submit(
36
+ "Analyze error logs from last 24h",
37
+ agent_types=["analyst"],
38
+ )
39
+
40
+ # Poll until complete
41
+ async for update in client.tasks.poll(task.task_id):
42
+ print(f"Status: {update.status}")
43
+
44
+ asyncio.run(main())
45
+ ```
46
+
47
+ ## Modules
48
+
49
+ | Module | Description |
50
+ |--------|-------------|
51
+ | `client.agents` | Agent registration, keys, and audit (AAP) |
52
+ | `client.tasks` | Swarm task submission and polling |
53
+ | `client.memory` | ZeroMemory: remember, recall, forget, reflect |
54
+ | `client.graph` | Context graph: entities, edges, GraphRAG, ontology |
55
+ | `client.vectors` | Vector embeddings: upsert, search, delete |
56
+ | `client.files` | File storage: upload, download, presigned URLs |
57
+ | `client.tables` | NoSQL tables: create, query, insert, update |
58
+ | `client.chat` | Chat completions with streaming |
59
+ | `client.threads` | Conversation threads |
60
+ | `client.events` | Real-time WebSocket events |
61
+
62
+ ## Authentication
63
+
64
+ The SDK supports two authentication methods:
65
+
66
+ ```python
67
+ # API Key (recommended for server-side)
68
+ client = AINativeClient(api_key="sk-your-key")
69
+
70
+ # JWT Token (for user-scoped access)
71
+ client = AINativeClient(token="eyJ...")
72
+ ```
73
+
74
+ ## Error Handling
75
+
76
+ ```python
77
+ from ainative_agent import AINativeClient, AuthenticationError, RateLimitError, APIError
78
+
79
+ async with AINativeClient(api_key="sk-key") as client:
80
+ try:
81
+ agent = await client.agents.get("nonexistent")
82
+ except AuthenticationError:
83
+ print("Invalid credentials")
84
+ except RateLimitError as e:
85
+ print(f"Rate limited, retry after {e.retry_after}s")
86
+ except APIError as e:
87
+ print(f"API error {e.status_code}: {e.message}")
88
+ ```
89
+
90
+ ## Retry Behavior
91
+
92
+ The SDK automatically retries requests on transient errors (429, 5xx) with exponential backoff, up to 3 attempts.
93
+
94
+ ## License
95
+
96
+ Apache-2.0