agenticstar-platform 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.
- agenticstar_platform-0.1.0/.gitignore +257 -0
- agenticstar_platform-0.1.0/LICENSE +21 -0
- agenticstar_platform-0.1.0/PKG-INFO +387 -0
- agenticstar_platform-0.1.0/README.md +332 -0
- agenticstar_platform-0.1.0/agenticstar_platform/__init__.py +190 -0
- agenticstar_platform-0.1.0/agenticstar_platform/auth/__init__.py +82 -0
- agenticstar_platform-0.1.0/agenticstar_platform/auth/client.py +508 -0
- agenticstar_platform-0.1.0/agenticstar_platform/auth/config.py +185 -0
- agenticstar_platform-0.1.0/agenticstar_platform/auth/exceptions.py +74 -0
- agenticstar_platform-0.1.0/agenticstar_platform/auth/models.py +266 -0
- agenticstar_platform-0.1.0/agenticstar_platform/common/__init__.py +31 -0
- agenticstar_platform-0.1.0/agenticstar_platform/common/context_manager.py +54 -0
- agenticstar_platform-0.1.0/agenticstar_platform/common/secrets.py +118 -0
- agenticstar_platform-0.1.0/agenticstar_platform/common/validation.py +92 -0
- agenticstar_platform-0.1.0/agenticstar_platform/db/__init__.py +21 -0
- agenticstar_platform-0.1.0/agenticstar_platform/db/api_manager.py +230 -0
- agenticstar_platform-0.1.0/agenticstar_platform/db/config.py +284 -0
- agenticstar_platform-0.1.0/agenticstar_platform/db/config_access.py +524 -0
- agenticstar_platform-0.1.0/agenticstar_platform/db/data_access.py +466 -0
- agenticstar_platform-0.1.0/agenticstar_platform/db/factory.py +55 -0
- agenticstar_platform-0.1.0/agenticstar_platform/db/manager.py +445 -0
- agenticstar_platform-0.1.0/agenticstar_platform/events/__init__.py +52 -0
- agenticstar_platform-0.1.0/agenticstar_platform/events/emitter.py +338 -0
- agenticstar_platform-0.1.0/agenticstar_platform/events/handlers.py +504 -0
- agenticstar_platform-0.1.0/agenticstar_platform/events/models.py +212 -0
- agenticstar_platform-0.1.0/agenticstar_platform/events/types.py +91 -0
- agenticstar_platform-0.1.0/agenticstar_platform/memory/__init__.py +55 -0
- agenticstar_platform-0.1.0/agenticstar_platform/memory/episodic.py +844 -0
- agenticstar_platform-0.1.0/agenticstar_platform/memory/semantic.py +1120 -0
- agenticstar_platform-0.1.0/agenticstar_platform/rag/__init__.py +65 -0
- agenticstar_platform-0.1.0/agenticstar_platform/rag/base.py +208 -0
- agenticstar_platform-0.1.0/agenticstar_platform/rag/embedding.py +488 -0
- agenticstar_platform-0.1.0/agenticstar_platform/rag/qdrant_manager.py +896 -0
- agenticstar_platform-0.1.0/agenticstar_platform/security/__init__.py +122 -0
- agenticstar_platform-0.1.0/agenticstar_platform/security/aws.py +218 -0
- agenticstar_platform-0.1.0/agenticstar_platform/security/azure.py +525 -0
- agenticstar_platform-0.1.0/agenticstar_platform/security/base.py +540 -0
- agenticstar_platform-0.1.0/agenticstar_platform/security/content_safety_validator.py +435 -0
- agenticstar_platform-0.1.0/agenticstar_platform/security/gcp.py +254 -0
- agenticstar_platform-0.1.0/agenticstar_platform/storage/__init__.py +100 -0
- agenticstar_platform-0.1.0/agenticstar_platform/storage/azure.py +666 -0
- agenticstar_platform-0.1.0/agenticstar_platform/storage/base.py +680 -0
- agenticstar_platform-0.1.0/agenticstar_platform/storage/gcs.py +498 -0
- agenticstar_platform-0.1.0/agenticstar_platform/storage/paths.py +144 -0
- agenticstar_platform-0.1.0/agenticstar_platform/storage/s3.py +501 -0
- agenticstar_platform-0.1.0/docs/agenticstar_platform.html +28724 -0
- agenticstar_platform-0.1.0/docs/index.html +7 -0
- agenticstar_platform-0.1.0/docs/search.js +46 -0
- agenticstar_platform-0.1.0/pyproject.toml +109 -0
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
### Project-specific ###
|
|
2
|
+
# Logs
|
|
3
|
+
logs/
|
|
4
|
+
|
|
5
|
+
# Data
|
|
6
|
+
data/
|
|
7
|
+
|
|
8
|
+
# Workspace
|
|
9
|
+
workspace/
|
|
10
|
+
|
|
11
|
+
# Memo
|
|
12
|
+
memo/
|
|
13
|
+
|
|
14
|
+
# Instructions (sensitive configuration)
|
|
15
|
+
instructions/
|
|
16
|
+
|
|
17
|
+
### CLI Frontend (Go) ###
|
|
18
|
+
# Go binaries
|
|
19
|
+
cli-frontend/agenticai
|
|
20
|
+
cli-frontend/agenticai-*
|
|
21
|
+
cli-frontend/*.exe
|
|
22
|
+
|
|
23
|
+
# Python backend (compiled for development/debug)
|
|
24
|
+
cli-frontend/python-backend/
|
|
25
|
+
|
|
26
|
+
# Claude Code MCP (downloaded/configured)
|
|
27
|
+
cli-frontend/claude-code/
|
|
28
|
+
cli-frontend/claude_code_config.py
|
|
29
|
+
|
|
30
|
+
# Bundled tools (Playwright & Marp)
|
|
31
|
+
cli-frontend/bundled-tools/
|
|
32
|
+
cli-frontend/bundled_tools_config.py
|
|
33
|
+
|
|
34
|
+
# Distribution packages
|
|
35
|
+
cli-frontend/dist-package/
|
|
36
|
+
cli-frontend/releases/*.tar.gz
|
|
37
|
+
cli-frontend/releases/*.zip
|
|
38
|
+
|
|
39
|
+
# Legacy Node/TypeScript (removed but keep for safety)
|
|
40
|
+
cli-frontend/node_modules/
|
|
41
|
+
cli-frontend/package.json
|
|
42
|
+
cli-frontend/package-lock.json
|
|
43
|
+
cli-frontend/dist/
|
|
44
|
+
cli-frontend/build/
|
|
45
|
+
|
|
46
|
+
# Test artifacts
|
|
47
|
+
cli-frontend/*.test
|
|
48
|
+
cli-frontend/*.out
|
|
49
|
+
cli-frontend/coverage/
|
|
50
|
+
|
|
51
|
+
# Temporary files
|
|
52
|
+
cli-frontend/.tmp/
|
|
53
|
+
|
|
54
|
+
### Python ###
|
|
55
|
+
# Byte-compiled / optimized / DLL files
|
|
56
|
+
__pycache__/
|
|
57
|
+
*.py[cod]
|
|
58
|
+
*$py.class
|
|
59
|
+
|
|
60
|
+
# C extensions
|
|
61
|
+
*.so
|
|
62
|
+
|
|
63
|
+
# Distribution / packaging
|
|
64
|
+
.Python
|
|
65
|
+
build/
|
|
66
|
+
develop-eggs/
|
|
67
|
+
dist/
|
|
68
|
+
downloads/
|
|
69
|
+
eggs/
|
|
70
|
+
.eggs/
|
|
71
|
+
lib/
|
|
72
|
+
lib64/
|
|
73
|
+
parts/
|
|
74
|
+
sdist/
|
|
75
|
+
var/
|
|
76
|
+
wheels/
|
|
77
|
+
share/python-wheels/
|
|
78
|
+
*.egg-info/
|
|
79
|
+
.installed.cfg
|
|
80
|
+
*.egg
|
|
81
|
+
MANIFEST
|
|
82
|
+
|
|
83
|
+
# PyInstaller
|
|
84
|
+
# Usually these files are written by a python script from a template
|
|
85
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
86
|
+
*.manifest
|
|
87
|
+
*.spec
|
|
88
|
+
|
|
89
|
+
# Installer logs
|
|
90
|
+
pip-log.txt
|
|
91
|
+
pip-delete-this-directory.txt
|
|
92
|
+
|
|
93
|
+
# Unit test / coverage reports
|
|
94
|
+
htmlcov/
|
|
95
|
+
.tox/
|
|
96
|
+
.nox/
|
|
97
|
+
.coverage
|
|
98
|
+
.coverage.*
|
|
99
|
+
.cache
|
|
100
|
+
nosetests.xml
|
|
101
|
+
coverage.xml
|
|
102
|
+
*.cover
|
|
103
|
+
*.py,cover
|
|
104
|
+
.hypothesis/
|
|
105
|
+
.pytest_cache/
|
|
106
|
+
cover/
|
|
107
|
+
|
|
108
|
+
# Translations
|
|
109
|
+
*.mo
|
|
110
|
+
*.pot
|
|
111
|
+
|
|
112
|
+
# Django stuff:
|
|
113
|
+
*.log
|
|
114
|
+
local_settings.py
|
|
115
|
+
db.sqlite3
|
|
116
|
+
db.sqlite3-journal
|
|
117
|
+
|
|
118
|
+
# Flask stuff:
|
|
119
|
+
instance/
|
|
120
|
+
.webassets-cache
|
|
121
|
+
|
|
122
|
+
# Scrapy stuff:
|
|
123
|
+
.scrapy
|
|
124
|
+
|
|
125
|
+
# Sphinx documentation
|
|
126
|
+
docs/_build/
|
|
127
|
+
|
|
128
|
+
# PyBuilder
|
|
129
|
+
.pybuilder/
|
|
130
|
+
target/
|
|
131
|
+
|
|
132
|
+
# Jupyter Notebook
|
|
133
|
+
.ipynb_checkpoints
|
|
134
|
+
|
|
135
|
+
# IPython
|
|
136
|
+
profile_default/
|
|
137
|
+
ipython_config.py
|
|
138
|
+
|
|
139
|
+
# pyenv
|
|
140
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
141
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
142
|
+
# .python-version
|
|
143
|
+
|
|
144
|
+
# pipenv
|
|
145
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
146
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
147
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
148
|
+
# install all needed dependencies.
|
|
149
|
+
#Pipfile.lock
|
|
150
|
+
|
|
151
|
+
# UV
|
|
152
|
+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
|
|
153
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
154
|
+
# commonly ignored for libraries.
|
|
155
|
+
#uv.lock
|
|
156
|
+
|
|
157
|
+
# poetry
|
|
158
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
159
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
160
|
+
# commonly ignored for libraries.
|
|
161
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
162
|
+
#poetry.lock
|
|
163
|
+
|
|
164
|
+
# pdm
|
|
165
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
166
|
+
#pdm.lock
|
|
167
|
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
168
|
+
# in version control.
|
|
169
|
+
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
|
|
170
|
+
.pdm.toml
|
|
171
|
+
.pdm-python
|
|
172
|
+
.pdm-build/
|
|
173
|
+
|
|
174
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
175
|
+
__pypackages__/
|
|
176
|
+
|
|
177
|
+
# Celery stuff
|
|
178
|
+
celerybeat-schedule
|
|
179
|
+
celerybeat.pid
|
|
180
|
+
|
|
181
|
+
# SageMath parsed files
|
|
182
|
+
*.sage.py
|
|
183
|
+
|
|
184
|
+
# Environments
|
|
185
|
+
.env
|
|
186
|
+
.env.docker
|
|
187
|
+
.venv
|
|
188
|
+
env/
|
|
189
|
+
venv/
|
|
190
|
+
ENV/
|
|
191
|
+
env.bak/
|
|
192
|
+
venv.bak/
|
|
193
|
+
config.toml
|
|
194
|
+
|
|
195
|
+
# Claude configuration
|
|
196
|
+
.claude/
|
|
197
|
+
CLAUDE.local.md
|
|
198
|
+
|
|
199
|
+
# Spyder project settings
|
|
200
|
+
.spyderproject
|
|
201
|
+
.spyproject
|
|
202
|
+
|
|
203
|
+
# Rope project settings
|
|
204
|
+
.ropeproject
|
|
205
|
+
|
|
206
|
+
# mkdocs documentation
|
|
207
|
+
/site
|
|
208
|
+
|
|
209
|
+
# mypy
|
|
210
|
+
.mypy_cache/
|
|
211
|
+
.dmypy.json
|
|
212
|
+
dmypy.json
|
|
213
|
+
|
|
214
|
+
# Pyre type checker
|
|
215
|
+
.pyre/
|
|
216
|
+
|
|
217
|
+
# pytype static type analyzer
|
|
218
|
+
.pytype/
|
|
219
|
+
|
|
220
|
+
# Cython debug symbols
|
|
221
|
+
cython_debug/
|
|
222
|
+
|
|
223
|
+
# PyCharm
|
|
224
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
225
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
226
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
227
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
228
|
+
.idea/
|
|
229
|
+
|
|
230
|
+
# PyPI configuration file
|
|
231
|
+
.pypirc
|
|
232
|
+
|
|
233
|
+
### Visual Studio Code ###
|
|
234
|
+
.vscode/*
|
|
235
|
+
!.vscode/settings.json
|
|
236
|
+
!.vscode/tasks.json
|
|
237
|
+
!.vscode/launch.json
|
|
238
|
+
!.vscode/extensions.json
|
|
239
|
+
!.vscode/*.code-snippets
|
|
240
|
+
|
|
241
|
+
# Local History for Visual Studio Code
|
|
242
|
+
.history/
|
|
243
|
+
|
|
244
|
+
# Built Visual Studio Code Extensions
|
|
245
|
+
*.vsix
|
|
246
|
+
|
|
247
|
+
# sqlite db
|
|
248
|
+
*.db
|
|
249
|
+
|
|
250
|
+
# OSX
|
|
251
|
+
.DS_Store
|
|
252
|
+
|
|
253
|
+
.vscode/settings.json
|
|
254
|
+
|
|
255
|
+
# Helm
|
|
256
|
+
helm/*/charts/
|
|
257
|
+
helm/*/*.tgz
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 SoftBank Corp.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: agenticstar-platform
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: AGENTICSTAR Platform SDK - Enterprise AI Agent Infrastructure
|
|
5
|
+
Project-URL: Homepage, https://github.com/softbank/agenticstar-platform
|
|
6
|
+
Project-URL: Documentation, https://github.com/softbank/agenticstar-platform#readme
|
|
7
|
+
Project-URL: Repository, https://github.com/softbank/agenticstar-platform
|
|
8
|
+
Author-email: "SoftBank Corp." <agenticai@softbank.co.jp>
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: agent,ai,enterprise,llm,rag,vector-database
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
19
|
+
Requires-Python: >=3.11
|
|
20
|
+
Requires-Dist: httpx>=0.26.0
|
|
21
|
+
Provides-Extra: all
|
|
22
|
+
Requires-Dist: asyncpg>=0.29.0; extra == 'all'
|
|
23
|
+
Requires-Dist: azure-identity>=1.15.0; extra == 'all'
|
|
24
|
+
Requires-Dist: azure-storage-blob>=12.19.0; extra == 'all'
|
|
25
|
+
Requires-Dist: boto3>=1.34.0; extra == 'all'
|
|
26
|
+
Requires-Dist: google-cloud-storage>=2.14.0; extra == 'all'
|
|
27
|
+
Requires-Dist: openai>=1.0.0; extra == 'all'
|
|
28
|
+
Requires-Dist: qdrant-client>=1.7.0; extra == 'all'
|
|
29
|
+
Provides-Extra: db
|
|
30
|
+
Requires-Dist: asyncpg>=0.29.0; extra == 'db'
|
|
31
|
+
Requires-Dist: azure-identity>=1.15.0; extra == 'db'
|
|
32
|
+
Provides-Extra: dev
|
|
33
|
+
Requires-Dist: mypy>=1.7.0; extra == 'dev'
|
|
34
|
+
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
|
|
35
|
+
Requires-Dist: pytest-cov>=4.1.0; extra == 'dev'
|
|
36
|
+
Requires-Dist: pytest>=7.4.0; extra == 'dev'
|
|
37
|
+
Requires-Dist: ruff>=0.1.0; extra == 'dev'
|
|
38
|
+
Provides-Extra: rag
|
|
39
|
+
Requires-Dist: openai>=1.0.0; extra == 'rag'
|
|
40
|
+
Requires-Dist: qdrant-client>=1.7.0; extra == 'rag'
|
|
41
|
+
Provides-Extra: security
|
|
42
|
+
Requires-Dist: google-cloud-dlp>=3.12.0; extra == 'security'
|
|
43
|
+
Requires-Dist: httpx>=0.26.0; extra == 'security'
|
|
44
|
+
Provides-Extra: storage
|
|
45
|
+
Requires-Dist: azure-storage-blob>=12.19.0; extra == 'storage'
|
|
46
|
+
Requires-Dist: boto3>=1.34.0; extra == 'storage'
|
|
47
|
+
Requires-Dist: google-cloud-storage>=2.14.0; extra == 'storage'
|
|
48
|
+
Provides-Extra: storage-aws
|
|
49
|
+
Requires-Dist: boto3>=1.34.0; extra == 'storage-aws'
|
|
50
|
+
Provides-Extra: storage-azure
|
|
51
|
+
Requires-Dist: azure-storage-blob>=12.19.0; extra == 'storage-azure'
|
|
52
|
+
Provides-Extra: storage-gcp
|
|
53
|
+
Requires-Dist: google-cloud-storage>=2.14.0; extra == 'storage-gcp'
|
|
54
|
+
Description-Content-Type: text/markdown
|
|
55
|
+
|
|
56
|
+
# AGENTICSTAR Platform SDK
|
|
57
|
+
|
|
58
|
+
Enterprise AI Agent Infrastructure SDK for building autonomous agent systems.
|
|
59
|
+
|
|
60
|
+
## Installation
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
pip install agenticstar-platform
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Quick Start
|
|
67
|
+
|
|
68
|
+
```python
|
|
69
|
+
from agenticstar_platform import (
|
|
70
|
+
# Database
|
|
71
|
+
PostgreSQLManager, PostgreSQLConfig,
|
|
72
|
+
# RAG (Vector DB + Embedding)
|
|
73
|
+
QdrantManager, QdrantConfig, EmbeddingGenerator, EmbeddingConfig,
|
|
74
|
+
# Storage
|
|
75
|
+
AzureBlobStorageClient, AzureBlobConfig,
|
|
76
|
+
# Events
|
|
77
|
+
EventEmitter, EventType,
|
|
78
|
+
# Memory
|
|
79
|
+
SemanticMemoryClient, SemanticMemoryConfig,
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
# Example: Initialize SDK components
|
|
83
|
+
async def main():
|
|
84
|
+
# Database
|
|
85
|
+
db_config = PostgreSQLConfig.from_toml("config.toml", section="database")
|
|
86
|
+
async with PostgreSQLManager(db_config) as db:
|
|
87
|
+
users = await db.fetch_all("SELECT * FROM users WHERE active = $1", (True,))
|
|
88
|
+
|
|
89
|
+
# RAG System
|
|
90
|
+
embedding_config = EmbeddingConfig.from_toml("config.toml", section="rag.embedding")
|
|
91
|
+
embedding_gen = EmbeddingGenerator(embedding_config)
|
|
92
|
+
|
|
93
|
+
qdrant_config = QdrantConfig.from_toml("config.toml", section="rag.qdrant")
|
|
94
|
+
async with QdrantManager(qdrant_config, embedding_gen) as qdrant:
|
|
95
|
+
results = await qdrant.search("How to use the SDK?", limit=5)
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Modules
|
|
99
|
+
|
|
100
|
+
- **db**: PostgreSQL data access layer with Azure AD support
|
|
101
|
+
- **rag**: Qdrant vector database and Azure OpenAI embedding integration
|
|
102
|
+
- **storage**: Multi-cloud storage (Azure Blob, S3, GCS)
|
|
103
|
+
- **security**: PII detection (Azure Presidio, AWS Comprehend, GCP DLP)
|
|
104
|
+
- **memory**: Episodic (Graphiti/FalkorDB) and semantic (Mem0) memory
|
|
105
|
+
- **events**: Event type definitions for streaming
|
|
106
|
+
- **common**: Shared utilities (secret masking, validation)
|
|
107
|
+
|
|
108
|
+
## Platform Class Example
|
|
109
|
+
|
|
110
|
+
Below is an example of a Platform class that wraps SDK components for your agent system:
|
|
111
|
+
|
|
112
|
+
```python
|
|
113
|
+
"""
|
|
114
|
+
Platform class example - Using AGENTICSTAR Platform SDK
|
|
115
|
+
"""
|
|
116
|
+
import asyncio
|
|
117
|
+
from dataclasses import dataclass
|
|
118
|
+
from typing import Optional
|
|
119
|
+
|
|
120
|
+
from agenticstar_platform import (
|
|
121
|
+
PostgreSQLManager, PostgreSQLConfig,
|
|
122
|
+
QdrantManager, QdrantConfig,
|
|
123
|
+
EmbeddingGenerator, EmbeddingConfig,
|
|
124
|
+
EventEmitter, EventType,
|
|
125
|
+
SemanticMemoryClient, SemanticMemoryConfig,
|
|
126
|
+
AzureBlobStorageClient, AzureBlobConfig,
|
|
127
|
+
)
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
@dataclass
|
|
131
|
+
class PlatformConfig:
|
|
132
|
+
"""Platform configuration"""
|
|
133
|
+
db_config: PostgreSQLConfig
|
|
134
|
+
qdrant_config: QdrantConfig
|
|
135
|
+
embedding_config: EmbeddingConfig
|
|
136
|
+
storage_config: Optional[AzureBlobConfig] = None
|
|
137
|
+
memory_config: Optional[SemanticMemoryConfig] = None
|
|
138
|
+
|
|
139
|
+
@classmethod
|
|
140
|
+
def from_toml(cls, path: str) -> "PlatformConfig":
|
|
141
|
+
"""Load all configurations from TOML file"""
|
|
142
|
+
return cls(
|
|
143
|
+
db_config=PostgreSQLConfig.from_toml(path, section="database"),
|
|
144
|
+
qdrant_config=QdrantConfig.from_toml(path, section="rag.qdrant"),
|
|
145
|
+
embedding_config=EmbeddingConfig.from_toml(path, section="rag.embedding"),
|
|
146
|
+
storage_config=AzureBlobConfig.from_dict({
|
|
147
|
+
# Load from environment or config
|
|
148
|
+
"bucket_name": "your-container",
|
|
149
|
+
"connection_string": "your-connection-string",
|
|
150
|
+
}),
|
|
151
|
+
)
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
class AgentPlatform:
|
|
155
|
+
"""
|
|
156
|
+
Platform class wrapping SDK components.
|
|
157
|
+
|
|
158
|
+
This class demonstrates how to use AGENTICSTAR Platform SDK
|
|
159
|
+
to build your own agent infrastructure.
|
|
160
|
+
|
|
161
|
+
Example:
|
|
162
|
+
>>> config = PlatformConfig.from_toml("config.toml")
|
|
163
|
+
>>> platform = AgentPlatform(config)
|
|
164
|
+
>>> await platform.initialize()
|
|
165
|
+
>>>
|
|
166
|
+
>>> # Use database
|
|
167
|
+
>>> users = await platform.db.fetch_all("SELECT * FROM users")
|
|
168
|
+
>>>
|
|
169
|
+
>>> # Use RAG
|
|
170
|
+
>>> results = await platform.search_knowledge("How to deploy?")
|
|
171
|
+
>>>
|
|
172
|
+
>>> # Clean up
|
|
173
|
+
>>> await platform.cleanup()
|
|
174
|
+
"""
|
|
175
|
+
|
|
176
|
+
def __init__(self, config: PlatformConfig):
|
|
177
|
+
self.config = config
|
|
178
|
+
self._db: Optional[PostgreSQLManager] = None
|
|
179
|
+
self._qdrant: Optional[QdrantManager] = None
|
|
180
|
+
self._embedding: Optional[EmbeddingGenerator] = None
|
|
181
|
+
self._storage: Optional[AzureBlobStorageClient] = None
|
|
182
|
+
self._memory: Optional[SemanticMemoryClient] = None
|
|
183
|
+
|
|
184
|
+
async def initialize(self) -> None:
|
|
185
|
+
"""Initialize all SDK components"""
|
|
186
|
+
# Database
|
|
187
|
+
self._db = PostgreSQLManager(self.config.db_config)
|
|
188
|
+
await self._db.initialize()
|
|
189
|
+
|
|
190
|
+
# Embedding generator
|
|
191
|
+
self._embedding = EmbeddingGenerator(self.config.embedding_config)
|
|
192
|
+
|
|
193
|
+
# Vector DB (RAG)
|
|
194
|
+
self._qdrant = QdrantManager(self.config.qdrant_config, self._embedding)
|
|
195
|
+
await self._qdrant.initialize()
|
|
196
|
+
|
|
197
|
+
# Storage (optional)
|
|
198
|
+
if self.config.storage_config:
|
|
199
|
+
self._storage = AzureBlobStorageClient(self.config.storage_config)
|
|
200
|
+
|
|
201
|
+
# Memory (optional)
|
|
202
|
+
if self.config.memory_config:
|
|
203
|
+
self._memory = SemanticMemoryClient(self.config.memory_config)
|
|
204
|
+
|
|
205
|
+
@property
|
|
206
|
+
def db(self) -> PostgreSQLManager:
|
|
207
|
+
"""Database manager"""
|
|
208
|
+
if not self._db:
|
|
209
|
+
raise RuntimeError("Platform not initialized. Call initialize() first.")
|
|
210
|
+
return self._db
|
|
211
|
+
|
|
212
|
+
@property
|
|
213
|
+
def qdrant(self) -> QdrantManager:
|
|
214
|
+
"""Qdrant manager"""
|
|
215
|
+
if not self._qdrant:
|
|
216
|
+
raise RuntimeError("Platform not initialized. Call initialize() first.")
|
|
217
|
+
return self._qdrant
|
|
218
|
+
|
|
219
|
+
@property
|
|
220
|
+
def storage(self) -> Optional[AzureBlobStorageClient]:
|
|
221
|
+
"""Storage client (optional)"""
|
|
222
|
+
return self._storage
|
|
223
|
+
|
|
224
|
+
@property
|
|
225
|
+
def memory(self) -> Optional[SemanticMemoryClient]:
|
|
226
|
+
"""Memory client (optional)"""
|
|
227
|
+
return self._memory
|
|
228
|
+
|
|
229
|
+
async def search_knowledge(self, query: str, limit: int = 10):
|
|
230
|
+
"""
|
|
231
|
+
Search knowledge base using RAG
|
|
232
|
+
|
|
233
|
+
Args:
|
|
234
|
+
query: Search query
|
|
235
|
+
limit: Max results
|
|
236
|
+
|
|
237
|
+
Returns:
|
|
238
|
+
Search results from vector DB
|
|
239
|
+
"""
|
|
240
|
+
return await self.qdrant.search(query, limit=limit)
|
|
241
|
+
|
|
242
|
+
async def add_knowledge(
|
|
243
|
+
self,
|
|
244
|
+
point_id: str,
|
|
245
|
+
text: str,
|
|
246
|
+
metadata: dict,
|
|
247
|
+
) -> dict:
|
|
248
|
+
"""
|
|
249
|
+
Add document to knowledge base
|
|
250
|
+
|
|
251
|
+
Args:
|
|
252
|
+
point_id: Document ID
|
|
253
|
+
text: Document content
|
|
254
|
+
metadata: Document metadata
|
|
255
|
+
|
|
256
|
+
Returns:
|
|
257
|
+
Upsert result
|
|
258
|
+
"""
|
|
259
|
+
return await self.qdrant.upsert(
|
|
260
|
+
point_id=point_id,
|
|
261
|
+
text=text,
|
|
262
|
+
payload=metadata,
|
|
263
|
+
)
|
|
264
|
+
|
|
265
|
+
async def upload_file(self, file_path: str, prefix: str = "") -> dict:
|
|
266
|
+
"""
|
|
267
|
+
Upload file to storage
|
|
268
|
+
|
|
269
|
+
Args:
|
|
270
|
+
file_path: Local file path
|
|
271
|
+
prefix: Storage prefix (folder)
|
|
272
|
+
|
|
273
|
+
Returns:
|
|
274
|
+
Upload result
|
|
275
|
+
"""
|
|
276
|
+
if not self._storage:
|
|
277
|
+
return {"success": False, "error": "Storage not configured"}
|
|
278
|
+
|
|
279
|
+
result = await self._storage.upload_file(file_path, prefix=prefix)
|
|
280
|
+
return {
|
|
281
|
+
"success": result.success,
|
|
282
|
+
"url": result.object_url,
|
|
283
|
+
"size": result.file_size,
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
async def cleanup(self) -> None:
|
|
287
|
+
"""Clean up all resources"""
|
|
288
|
+
if self._qdrant:
|
|
289
|
+
await self._qdrant.close()
|
|
290
|
+
if self._db:
|
|
291
|
+
await self._db.close()
|
|
292
|
+
if self._storage:
|
|
293
|
+
await self._storage.close()
|
|
294
|
+
if self._memory:
|
|
295
|
+
await self._memory.cleanup()
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
# Usage example
|
|
299
|
+
async def example_usage():
|
|
300
|
+
# Load configuration
|
|
301
|
+
config = PlatformConfig.from_toml("config.toml")
|
|
302
|
+
|
|
303
|
+
# Initialize platform
|
|
304
|
+
platform = AgentPlatform(config)
|
|
305
|
+
await platform.initialize()
|
|
306
|
+
|
|
307
|
+
try:
|
|
308
|
+
# Add knowledge
|
|
309
|
+
await platform.add_knowledge(
|
|
310
|
+
point_id="doc-001",
|
|
311
|
+
text="AGENTICSTAR Platform SDKはエンタープライズAIエージェント基盤のためのSDKです。",
|
|
312
|
+
metadata={"category": "documentation", "language": "ja"},
|
|
313
|
+
)
|
|
314
|
+
|
|
315
|
+
# Search knowledge
|
|
316
|
+
results = await platform.search_knowledge("SDKの使い方")
|
|
317
|
+
for result in results.get("results", []):
|
|
318
|
+
print(f"Score: {result['score']:.2f} - {result['text'][:50]}...")
|
|
319
|
+
|
|
320
|
+
# Database query
|
|
321
|
+
users = await platform.db.fetch_all(
|
|
322
|
+
"SELECT id, name FROM users WHERE created_at > $1",
|
|
323
|
+
(datetime(2024, 1, 1),)
|
|
324
|
+
)
|
|
325
|
+
print(f"Found {len(users)} users")
|
|
326
|
+
|
|
327
|
+
finally:
|
|
328
|
+
await platform.cleanup()
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
if __name__ == "__main__":
|
|
332
|
+
asyncio.run(example_usage())
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
## Configuration (config.toml example)
|
|
336
|
+
|
|
337
|
+
```toml
|
|
338
|
+
[database]
|
|
339
|
+
host = "your-postgresql.postgres.database.azure.com"
|
|
340
|
+
port = 5432
|
|
341
|
+
database = "agenticai"
|
|
342
|
+
username = "admin"
|
|
343
|
+
password = "your-password"
|
|
344
|
+
use_azure_ad = false
|
|
345
|
+
pool_min_size = 2
|
|
346
|
+
pool_max_size = 10
|
|
347
|
+
|
|
348
|
+
[database.azure_ad]
|
|
349
|
+
tenant_id = "your-tenant-id"
|
|
350
|
+
client_id = "your-client-id"
|
|
351
|
+
client_secret = "your-client-secret"
|
|
352
|
+
|
|
353
|
+
[rag.embedding]
|
|
354
|
+
api_base = "https://your-openai.openai.azure.com/"
|
|
355
|
+
api_key = "your-api-key"
|
|
356
|
+
deployment_name = "text-embedding-ada-002"
|
|
357
|
+
|
|
358
|
+
[rag.qdrant]
|
|
359
|
+
url = "http://localhost:6333"
|
|
360
|
+
collection_name = "knowledge_base"
|
|
361
|
+
vector_size = 1536
|
|
362
|
+
|
|
363
|
+
[storage.azure]
|
|
364
|
+
bucket_name = "your-container"
|
|
365
|
+
connection_string = "DefaultEndpointsProtocol=https;..."
|
|
366
|
+
prefix = "uploads/"
|
|
367
|
+
|
|
368
|
+
[memory.llm]
|
|
369
|
+
model = "azure/gpt-4"
|
|
370
|
+
api_key = "your-api-key"
|
|
371
|
+
base_url = "https://your-openai.openai.azure.com/"
|
|
372
|
+
api_version = "2024-02-15-preview"
|
|
373
|
+
|
|
374
|
+
[memory.embedder]
|
|
375
|
+
model = "azure/text-embedding-ada-002"
|
|
376
|
+
api_key = "your-api-key"
|
|
377
|
+
base_url = "https://your-openai.openai.azure.com/"
|
|
378
|
+
api_version = "2024-02-15-preview"
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
## API Reference
|
|
382
|
+
|
|
383
|
+
See [API_REFERENCE.md](./API_REFERENCE.md) for detailed API documentation.
|
|
384
|
+
|
|
385
|
+
## Version
|
|
386
|
+
|
|
387
|
+
0.1.0
|