Metadata-Version: 2.4
Name: agentengine-sdk-python
Version: 0.8.8
Summary: Kingsoft Cloud Agent Engine SDK alias package for ksadk
Author-email: KsADK Team <xiayu@kingsoft.com>
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/kingsoftcloud/ksadk-python
Project-URL: Repository, https://github.com/kingsoftcloud/ksadk-python
Project-URL: Documentation, https://kingsoftcloud.github.io/ksadk-python/
Keywords: agent,langchain,langgraph,deepagents,adk,faas,kingsoft cloud,ai,llm
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: click>=8.0.0
Requires-Dist: pyyaml>=6.0.0
Requires-Dist: packaging>=23.0
Requires-Dist: tomli>=2.0.0; python_version < "3.11"
Requires-Dist: python-dotenv>=1.0.0
Requires-Dist: pydantic<3.0.0,>=2.0.0
Requires-Dist: jsonschema<5.0.0,>=4.0.0
Requires-Dist: rfc8785==0.1.4
Requires-Dist: questionary>=2.0.0
Requires-Dist: prompt_toolkit>=3.0.0
Requires-Dist: rich>=13.0.0
Requires-Dist: fastapi<1.0.0,>=0.100.0
Requires-Dist: uvicorn>=0.23.0
Requires-Dist: python-multipart<1.0.0,>=0.0.9
Requires-Dist: python-socks<3.0.0,>=2.7.1
Requires-Dist: httpx<0.29.0,>=0.28.1
Requires-Dist: httpcore<1.1.0,>=1.0.9
Requires-Dist: a2a-sdk[fastapi]==1.1.0
Requires-Dist: a2ui-core==0.3.0
Requires-Dist: httpx-sse>=0.4.0
Requires-Dist: sse-starlette>=2.1.0
Requires-Dist: mcp>=1.26.0
Requires-Dist: requests>=2.28.0
Requires-Dist: requests-aws4auth>=1.2.0
Requires-Dist: kingsoftcloud-sdk-python>=1.5.8.94
Requires-Dist: cryptography>=44.0.0
Requires-Dist: websockets<16.0,>=12.0
Requires-Dist: playwright>=1.50.0
Requires-Dist: qrcode>=7.4.0
Requires-Dist: asyncpg<1.0.0,>=0.30.0
Requires-Dist: SQLAlchemy[asyncio]<3.0.0,>=2.0.0
Requires-Dist: aiosqlite<1.0.0,>=0.20.0
Requires-Dist: greenlet>=1.0.0
Requires-Dist: ks3sdk>=1.15.0
Requires-Dist: pypdf>=6.0.0
Requires-Dist: beautifulsoup4>=4.12.0
Requires-Dist: rapidocr-onnxruntime>=1.2.0
Requires-Dist: pillow<13.0.0,>=11.0.0
Requires-Dist: google-adk<3.0.0,>=1.34.0
Requires-Dist: langgraph==1.2.15
Requires-Dist: langgraph-checkpoint-sqlite>=2.0.0
Requires-Dist: opentelemetry-api>=1.39.0
Requires-Dist: opentelemetry-sdk>=1.39.0
Requires-Dist: opentelemetry-exporter-otlp>=1.39.0
Provides-Extra: adk
Requires-Dist: litellm>=1.0.0; (platform_system != "Windows" or python_version < "3.13") and extra == "adk"
Requires-Dist: json_repair>=0.25.0; extra == "adk"
Provides-Extra: langchain
Requires-Dist: langchain<2.0.0,>=1.3.14; extra == "langchain"
Requires-Dist: langchain-openai<2.0.0,>=1.4.0; extra == "langchain"
Requires-Dist: langchain-core<2.0.0,>=1.5.0; extra == "langchain"
Provides-Extra: langgraph
Requires-Dist: langgraph==1.2.15; extra == "langgraph"
Requires-Dist: langgraph-checkpoint-sqlite>=2.0.0; extra == "langgraph"
Requires-Dist: langgraph-checkpoint-postgres>=3.1.0; extra == "langgraph"
Requires-Dist: psycopg[binary]<4.0,>=3.2; extra == "langgraph"
Requires-Dist: psycopg-pool<4.0,>=3.2; extra == "langgraph"
Requires-Dist: langchain<2.0.0,>=1.3.14; extra == "langgraph"
Requires-Dist: langchain-openai<2.0.0,>=1.4.0; extra == "langgraph"
Requires-Dist: protobuf>=6.32.1; extra == "langgraph"
Provides-Extra: deepagents
Requires-Dist: deepagents<1.0.0,>=0.6.2; python_version >= "3.11" and extra == "deepagents"
Requires-Dist: langgraph==1.2.15; extra == "deepagents"
Requires-Dist: langchain<2.0.0,>=1.3.14; extra == "deepagents"
Requires-Dist: langchain-openai<2.0.0,>=1.4.0; extra == "deepagents"
Provides-Extra: a2a
Requires-Dist: a2a-sdk[fastapi]==1.1.0; extra == "a2a"
Requires-Dist: SQLAlchemy[asyncio]<3.0.0,>=2.0.0; extra == "a2a"
Requires-Dist: aiosqlite<1.0.0,>=0.20.0; extra == "a2a"
Provides-Extra: a2a-postgres
Requires-Dist: a2a-sdk[postgresql]==1.1.0; extra == "a2a-postgres"
Provides-Extra: tracing
Requires-Dist: openinference-instrumentation-langchain>=0.1.0; extra == "tracing"
Provides-Extra: judge
Requires-Dist: deepeval>=3.2.6; extra == "judge"
Provides-Extra: kb
Provides-Extra: skills
Requires-Dist: e2b<2.25.0,>=2.15.3; extra == "skills"
Provides-Extra: codex
Requires-Dist: openai-codex==0.154.0; extra == "codex"
Provides-Extra: agui
Requires-Dist: ag-ui-protocol==1.0.0; extra == "agui"
Requires-Dist: ag-ui-langgraph[fastapi]==0.0.47; extra == "agui"
Requires-Dist: ag-ui-a2ui-toolkit==0.0.4; extra == "agui"
Requires-Dist: copilotkit==0.1.96; extra == "agui"
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
Requires-Dist: pytest-xdist>=3.0.0; extra == "dev"
Requires-Dist: fastmcp>=2.14.7; extra == "dev"
Requires-Dist: build>=1.0.0; extra == "dev"
Requires-Dist: twine>=5.0.0; extra == "dev"
Requires-Dist: black>=22.0.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"
Requires-Dist: mypy>=1.0.0; extra == "dev"
Requires-Dist: types-PyYAML>=6.0.0; extra == "dev"
Requires-Dist: types-protobuf>=6.32.0; extra == "dev"
Requires-Dist: types-python-dateutil>=2.9.0; extra == "dev"
Requires-Dist: types-qrcode>=8.2.0; extra == "dev"
Requires-Dist: types-requests>=2.32.0; extra == "dev"
Provides-Extra: all
Requires-Dist: agentengine-sdk-python[a2a,adk,agui,codex,deepagents,dev,judge,kb,langchain,langgraph,skills,tracing]; extra == "all"
Dynamic: license-file

<h1 align="center">Kingsoft Cloud Agent Development Kit</h1>

新版本要求 Python 3.12 或以上；已有 Agent 可保留原 SDK 和运行镜像，旧 Runtime 的会话读取与订阅协议继续兼容。

<p align="center"><strong>金山云智能体开发套件</strong></p>

<p align="center">
  构建、部署、调试、观测企业级 AI 智能体的一站式云原生框架。
  兼容 Google ADK、LangGraph、LangChain 与 DeepAgents，并支持一键拉起 OpenClaw 和 Hermes 运行时。
</p>

<p align="center"><a href="README.md">简体中文（默认）</a> · <a href="README.en.md">English</a></p>

<p align="center">
  <a href="https://kingsoftcloud.github.io/ksadk-python/"><img alt="Docs" src="https://img.shields.io/badge/Docs-ksadk--python-2f6fdf?style=flat" /></a>
  <a href="https://pypi.org/project/ksadk/"><img alt="PyPI" src="https://img.shields.io/pypi/v/ksadk?style=flat&color=2f6fdf" /></a>
  <a href="LICENSE"><img alt="License" src="https://img.shields.io/badge/License-Apache--2.0-blue?style=flat" /></a>
  <a href="https://deepwiki.com/kingsoftcloud/ksadk-python"><img alt="Ask DeepWiki" src="https://deepwiki.com/badge.svg" /></a>
</p>

<p align="center"><a href="https://raw.githubusercontent.com/kingsoftcloud/ksadk-python/main/docs-site/public/assets/agentkit-studio-overview.png"><img alt="KsADK AgentKit Studio 真实 Agent 工作区" src="https://raw.githubusercontent.com/kingsoftcloud/ksadk-python/main/docs-site/public/assets/agentkit-studio-overview.png" width="860" /></a></p>

## 30 秒快速体验

```bash
python -m venv .venv
source .venv/bin/activate
pip install -U "ksadk[all]"

agentengine init demo-agent -f langgraph
cd demo-agent
agentengine config set OPENAI_API_KEY=your-api-key OPENAI_MODEL_NAME=gpt-4o-mini
agentengine run -i
```

启动本地调试 Web UI：

```bash
agentengine web . --no-open
```

## 0.8.8：能力与接入

0.8.8 要求 Python 3.12+，内置 Web companion 为 `0.3.18`。
下表介绍本版本能力；安装前核对 GitHub Release 与两个 PyPI 发行包的版本。

[0.8.8 升级指南](https://kingsoftcloud.github.io/ksadk-python/cn/docs/framework/guides/upgrade-0-8-8/)说明 Tunnel 迁移、Memory 历史兼容、依赖选择和聊天传输配置。正式 GitHub Release 发布前，0.8.8 仍为候选，评估时使用经过审核的 wheel。

| 能力 | 如何接入 |
| --- | --- |
| AG-UI / A2UI | 安装 `agui` extra，在自有图中接入结构化输入、业务 Schema 与持久化 checkpoint。 |
| OAuth MCP / API Key MCP | OAuth 使用 `McpOAuthTools` 与本地 Web/托管 Broker；原 API Key 客户端继续使用。 |
| A2A | 绑定 Space、注册 callee，再通过发现工具调用；注册与 Gateway 属于配套平台。 |
| 会话与恢复 | 分别配置 Session 和框架 checkpoint；托管模式显式请求 Kernel 准入。 |

详见[功能接入与配置](https://kingsoftcloud.github.io/ksadk-python/cn/docs/framework/guides/integration-0-8-7/)、
[AG-UI/A2UI 示例](https://kingsoftcloud.github.io/ksadk-python/cn/docs/framework/guides/agui-a2ui/)、
[OAuth MCP](https://kingsoftcloud.github.io/ksadk-python/cn/docs/framework/guides/mcp-oauth/) 和
[A2A](https://kingsoftcloud.github.io/ksadk-python/cn/docs/framework/guides/a2a-runtime/)。
模型生成的 A2UI 仍需通过注册目录校验，复杂样式可能失败；不把生成失败包装为业务成功。

## 企业内网工具

Google ADK 和 LangGraph Agent 可通过同一个企业侧 Connector 调用内网 MCP 工具和 HTTP API。见[工具隧道接入指南与 Connector 示例](https://kingsoftcloud.github.io/ksadk-python/cn/docs/framework/guides/tool-tunnel/)。

## 运行时架构

KsADK 把“框架适配”收敛为稳定的运行时分层，同时保留各框架的原生执行语义：

- **可信内核**：统一并发、取消、恢复、状态一致性和运行时安全边界。
- **Harness 执行层**：负责装配、Activation、生命周期和共用能力注入；一次 Activation 只选择一个 Provider。
- **可插拔 Provider**：Codex、KsADK Harness、DSH/Cordis 与 Subagent 在同一 Harness 契约下运行，Provider 保留原生线程、checkpoint 与事件语义。
- **统一事件**：`RuntimeEvent(schema_version=2)` 是存储、回放、API、Studio 与托管界面的事件事实来源；v1 仅作为只读兼容投影。
- **受控插件化**：DSH Bundle/Profile 使用固定工具链、不可变来源摘要和失败回滚；Codex 官方插件仍由 Codex App Server 管理。
- **平台资源插件**：Studio 可绑定知识库、长期记忆与 Skill Center；Agent Revision 保存资源选择，Build 固化连接引用和插件摘要，Runtime 在 Activation 时按平台授权装配。
- **消息渠道连接**：Studio 内置官方 Channel UI；本地和高代码 Agent 可通过 `ksadk.connector` 出站 WSS 接入独立 Channel 服务，不需要开放本地端口或安装 `agentengine-channel`。
- **本地开发闭环**：Studio 覆盖创建、构建、调试、评测与本地 Scheduler Lite，并复用独立发布的 `@kingsoftcloud/ksadk-web` 会话组件。

从 [运行时架构](https://kingsoftcloud.github.io/ksadk-python/cn/docs/framework/guides/runtime-architecture/)、[AgentKit Local Studio](https://kingsoftcloud.github.io/ksadk-python/cn/docs/framework/guides/agentkit-local-studio/)、[Channel Connector](https://kingsoftcloud.github.io/ksadk-python/cn/docs/framework/guides/channel-connector/) 和[插件与自动化](https://kingsoftcloud.github.io/ksadk-python/cn/docs/framework/guides/plugins-and-automations/)开始阅读。版本说明与制品校验信息见 [GitHub Releases](https://github.com/kingsoftcloud/ksadk-python/releases)。

### RuntimeEvent schema v2 契约

运行事件主路径固定为 canonical `RuntimeEvent(schema_version=2)`；能力描述为 `RuntimeEventVersions=[1,2]`、`RuntimeEventDefault=2`、`RuntimeEventV1ProjectionModes=["snapshot_only","identity_replace"]`、`RuntimeEventV1ProjectionDefault="snapshot_only"`。v1 仅作只读兼容投影。

<p align="center"><a href="https://raw.githubusercontent.com/kingsoftcloud/ksadk-python/main/docs-site/public/assets/agentkit-studio-platform-resources.png"><img alt="KsADK Studio 知识库、记忆库与 Skill Center 真实绑定界面" src="https://raw.githubusercontent.com/kingsoftcloud/ksadk-python/main/docs-site/public/assets/agentkit-studio-platform-resources.png" width="860" /></a></p>

<p align="center"><a href="https://raw.githubusercontent.com/kingsoftcloud/ksadk-python/main/docs-site/public/assets/agentkit-studio-demo.gif"><img alt="KsADK Studio Agent、资源绑定与插件页真实演示" src="https://raw.githubusercontent.com/kingsoftcloud/ksadk-python/main/docs-site/public/assets/agentkit-studio-demo.gif" width="860" /></a></p>

## 为什么需要 KsADK

大多数 Agent 框架解决“如何开发 Agent”。KsADK 解决“如何运行、调试、部署和观测 Agent”。

- 本地开发：`agentengine init`、`agentengine run`、`agentengine web`。
- 统一调试：浏览器 Web UI、streaming、附件、workspace 文件、工具调用和会话。
- 统一协议：本地 `/v1/responses` 与 `/v1/chat/completions`。
- 工具边界：Skill Runtime、Workspace、Sandbox、Memory、Knowledge。
- 工程链路：打包、部署、OpenClaw / Hermes 运行时、OpenTelemetry 可观测。

## 架构

<p align="center"><a href="https://raw.githubusercontent.com/kingsoftcloud/ksadk-python/main/docs-site/public/assets/ksadk-runtime-architecture.png"><img alt="KsADK 总体技术架构" src="https://raw.githubusercontent.com/kingsoftcloud/ksadk-python/main/docs-site/public/assets/ksadk-runtime-architecture.png" width="860" /></a></p>

Agent Kernel 收口可信控制，Harness 管理装配与生命周期，可插拔 Provider 保留框架原生执行语义；RuntimeEvent v2 为 API、Studio 与托管界面提供统一事件事实链。

## 文档与样例

- 文档：<https://kingsoftcloud.github.io/ksadk-python/>
- 快速开始：<https://kingsoftcloud.github.io/ksadk-python/cn/docs/framework/getting-started/quickstart/>
- 为什么需要 KsADK：<https://kingsoftcloud.github.io/ksadk-python/cn/docs/framework/getting-started/why-ksadk/>
- 架构：<https://kingsoftcloud.github.io/ksadk-python/cn/docs/framework/getting-started/architecture/>
- 生态定位对比：<https://kingsoftcloud.github.io/ksadk-python/cn/docs/framework/getting-started/comparison/>
- 可观测：<https://kingsoftcloud.github.io/ksadk-python/cn/docs/framework/guides/observability-tracing/>
- 云端部署：<https://kingsoftcloud.github.io/ksadk-python/cn/docs/framework/guides/cloud-deployment/>
- Hosted UI 与事件回放：<https://kingsoftcloud.github.io/ksadk-python/cn/docs/framework/guides/hosted-ui-events/>
- 环境变量：<https://kingsoftcloud.github.io/ksadk-python/cn/docs/references/environment-variables/>
- 样例仓库：<https://github.com/kingsoftcloud/ksadk-samples>

## 相关项目

- KsADK 仓库：<https://github.com/kingsoftcloud/ksadk-python>
- Web UI 仓库：<https://github.com/kingsoftcloud/ksadk-web>
- PyPI：<https://pypi.org/project/ksadk/>

## 参与贡献

欢迎通过 issue、PR、样例和文档改进参与贡献。提交前建议运行：

```bash
make public-preflight
```

开源协议：Apache-2.0。
