Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
test:
runs-on: ubuntu-latest
env:
KSADK_WEB_VERSION: "0.2.18"
KSADK_WEB_VERSION: "0.2.19"
steps:
- uses: actions/checkout@v4

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
ksadk_web_version:
description: KsADK Web npm version to bundle
required: false
default: "0.2.18"
default: "0.2.19"
approved_source_commit:
description: Reviewed source commit SHA recorded in docs/maintainer-approval-record.md
required: false
Expand Down Expand Up @@ -37,7 +37,7 @@ jobs:
environment:
name: pypi
env:
KSADK_WEB_VERSION: ${{ github.event.inputs.ksadk_web_version || '0.2.18' }}
KSADK_WEB_VERSION: ${{ github.event.inputs.ksadk_web_version || '0.2.19' }}
KSADK_APPROVED_SOURCE_COMMIT: ${{ github.event.inputs.approved_source_commit || vars.KSADK_APPROVED_SOURCE_COMMIT }}
PUBLISH_TARGET: ${{ github.event.inputs.publish_target || 'full' }}
permissions:
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
- ADK Runner 接入 `ResumabilityConfig`、`invocation_id` 映射、递增 checkpoint、恢复审计和 runtime capability 描述;新增 `KSADK_ADK_RESUMABLE` 显式开关。
- TUI 新增 `/tools` 命令、模型选择、输入排队、处理中耗时状态、终端背景自适应和 `/clear` 原生 scrollback 清理。
- 新增 PostgreSQL 会话故障恢复 E2E 校验脚本,覆盖 LangGraph、LangChain、ADK、可读视图以及数据库中断后恢复写入。
- 公开 Fumadocs 文档站新增中英文云端部署指南,覆盖云账号配置、`launch`、`build`/`deploy`、Code/Container、KCE、VPC、持久化存储、运行时 env 和部署验证;GitHub Pages 子路径下的静态搜索索引改为显式寻址。

### 变更

Expand All @@ -46,7 +47,7 @@
- 修复 PostgreSQL 恢复后,降级期间创建的 session 无法继续写入 PG 的问题。
- 修复 ADK session 在健康 PostgreSQL 下不刷新其他副本新增事件的问题。
- 修复 DeepAgents 测试 fake model 对空内容 tool call 不产生 stream chunk 的兼容问题。
- 修复 `langchain.agents.create_agent()` 返回 message-state 时,LangChain Runner 丢弃流式文本、思考过程和工具调用/结果并回退为同步执行的问题
- 修复 `langchain.agents.create_agent()` 返回 message-state 时,LangChain Runner 丢弃流式文本、思考过程和工具调用/结果并回退为同步执行,以及将 `Command(update=...)` 内部控制对象误作最终正文的问题
- 修复 Windows Python 3.13 安装 ADK extra 时可能从源码构建 LiteLLM 并因缺少 MSVC linker 失败的问题;显式使用 `LiteLlm` 的用户可先安装官方二进制 wheel。
- 修复 coding profile 未直接暴露 workspace 写文件工具,导致新建文件绕行 dispatcher;同时明确 read/edit 必须串行并让无效编辑参数优先返回准确诊断。
- 修复本地 `agentengine web` 缺少 `ListSessionMessages` action,导致刷新或切换 session 后历史消息无法回显的问题;历史投影保留正文、思考、工具、审批和附件信息。
Expand Down
3 changes: 2 additions & 1 deletion README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Most agent frameworks solve how to build agents. KsADK solves how to run, debug,

## Architecture

<p align="center"><img alt="KsADK Agent Runtime Platform architecture" src="docs-site/public/assets/ksadk-runtime-architecture.png" width="860" /></p>
<p align="center"><img alt="KsADK Agent Runtime Platform architecture" src="docs-site/public/assets/ksadk-runtime-architecture.en.png" width="860" /></p>

## Docs And Examples

Expand All @@ -63,6 +63,7 @@ Most agent frameworks solve how to build agents. KsADK solves how to run, debug,
- Architecture: <https://kingsoftcloud.github.io/ksadk-python/en/docs/framework/getting-started/architecture/>
- Ecosystem Positioning: <https://kingsoftcloud.github.io/ksadk-python/en/docs/framework/getting-started/comparison/>
- Observability: <https://kingsoftcloud.github.io/ksadk-python/en/docs/framework/guides/observability-tracing/>
- Cloud Deployment: <https://kingsoftcloud.github.io/ksadk-python/en/docs/framework/guides/cloud-deployment/>
- Samples: <https://github.com/kingsoftcloud/ksadk-samples>

## Related Projects
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ agentengine web . --no-open

## 架构

<p align="center"><a href="https://raw.githubusercontent.com/kingsoftcloud/ksadk-python/main/docs-site/public/assets/ksadk-runtime-architecture.png"><img alt="KsADK Agent Runtime Platform 架构" src="https://raw.githubusercontent.com/kingsoftcloud/ksadk-python/main/docs-site/public/assets/ksadk-runtime-architecture.png" width="860" /></a></p>
<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>

## 文档与样例

Expand All @@ -63,6 +63,7 @@ agentengine web . --no-open
- 架构:<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/>
- 样例仓库:<https://github.com/kingsoftcloud/ksadk-samples>

## 相关项目
Expand Down
3 changes: 2 additions & 1 deletion README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ agentengine web . --no-open

## 架构

<p align="center"><img alt="KsADK Agent Runtime Platform 架构" src="docs-site/public/assets/ksadk-runtime-architecture.png" width="860" /></p>
<p align="center"><img alt="KsADK 智能体运行时平台架构" src="docs-site/public/assets/ksadk-runtime-architecture.png" width="860" /></p>

## 文档与样例

Expand All @@ -63,6 +63,7 @@ agentengine web . --no-open
- 架构:<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/>
- 样例仓库:<https://github.com/kingsoftcloud/ksadk-samples>

## 相关项目
Expand Down
3 changes: 3 additions & 0 deletions docs-site/components/search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { useDocsSearch } from 'fumadocs-core/search/client';
import { create } from '@orama/orama';
import { createTokenizer } from '@orama/tokenizers/mandarin';
import { useI18n } from 'fumadocs-ui/contexts/i18n';
import { assetPath } from '@/lib/shared';

function initOrama(locale?: string) {
if (locale === 'cn') {
Expand All @@ -35,6 +36,8 @@ export default function DefaultSearchDialog(props: SharedProps) {
type: 'static',
initOrama,
locale,
// GitHub Pages project sites live below /<repository>, not the domain root.
from: assetPath('/api/search'),
});

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: Architecture

KsADK's public architecture is an **Agent Runtime Platform** layer. You keep building business agents with your chosen framework, while KsADK unifies runtime, debugging, protocols, tools, sandboxing, deployment, and observability.

![KsADK Agent Runtime Platform architecture](/assets/ksadk-runtime-architecture.svg)
![KsADK Agent Runtime Platform architecture](/assets/ksadk-runtime-architecture.en.svg)

## Overview

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,5 +221,6 @@ You now have:
- Wrap an existing project in [Bring An Existing Agent](../tutorials/existing-agent).
- Configure more settings in [Configuration](./configuration).
- Learn framework conventions in [Frameworks](../guides/frameworks).
- Publish a validated project in [Deploy to Kingsoft Cloud](../guides/cloud-deployment).
- Debug with the [Local Web UI](../guides/local-web-ui).
- Check commands in the [CLI Reference](../reference/cli).
Original file line number Diff line number Diff line change
Expand Up @@ -204,5 +204,6 @@ rm -rf .agentengine/

- 阅读 [配置项](./configuration),理解 `.env`、YAML 和 CLI 覆盖顺序。
- 阅读 [运行时架构](../guides/runtime-architecture),理解请求如何进入 Runner。
- 阅读 [部署到金山云](../guides/cloud-deployment),把已验证的项目发布为托管 Agent。
- 阅读 [OpenAI 兼容 API](../reference/openai-compatible-api),把本地 Agent 接到客户端。
- 阅读 [本地 Web UI](../guides/local-web-ui),了解会话、上传和工作区预览。
216 changes: 216 additions & 0 deletions docs-site/content/docs/framework/guides/cloud-deployment.en.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,216 @@
---
title: Cloud Deployment to Kingsoft Cloud
description: Deploy a validated KsADK project as a hosted Agent, from credentials to verification.
---

This guide starts after a KsADK project works locally with `agentengine run . -i`
or `agentengine web .`. It explains how to deploy that project as a hosted
Agent on Kingsoft Cloud.

<Callout type="info">
Use `launch` for a first deployment: it builds, uploads or pushes the
artifact, then creates or updates the Agent. Use `build` plus `deploy` when
your CI pipeline needs to review the artifact separately.
</Callout>

## Choose A Target

| Target | Use it when | Default artifact |
| --- | --- | --- |
| `serverless` | You want the fastest hosted deployment for a standard Agent | `Code`, built and uploaded to KS3 automatically |
| `serverless --artifact-type Container` | The code package is large or needs system dependencies / a custom image | Container; requires Docker and a registry |
| `kce --artifact-type Container` | You already operate a KCE cluster, namespace, and registry | Container |

`serverless` and the `Code` artifact type are the defaults. Choose Container
only for a real image requirement, a package-size limit, or an intentional KCE
deployment.

## Prerequisites

1. Install KsADK with the extra for your framework. For LangGraph:

```bash title="shell"
pip install "ksadk[langgraph]"
agentengine --version
```

2. Your project needs a working `agentengine.yaml`, entry point, and dependency
manifest. Test it first:

```bash title="shell"
agentengine run . -i
```

3. Prepare Kingsoft Cloud AK/SK credentials with permission for AgentEngine,
KS3, and the selected region. Container deployment also needs a registry you
can push to and a working local Docker installation.

4. Never commit AK/SK credentials, model keys, registry passwords, `.env`,
`prod.env`, or `.agentengine/`. Commit only placeholder values in
`.env.example`.

## Configure Cloud Credentials And Runtime Variables

The interactive wizard is the simplest setup. It asks for model settings,
cloud credentials, region, and optional registry information:

```bash title="shell"
agentengine config
```

For automation, write cloud credentials to the current project's uncommitted
`.env`:

```bash title="shell"
agentengine config set \
KSYUN_ACCESS_KEY=<your-access-key> \
KSYUN_SECRET_KEY=<your-secret-key> \
KSYUN_ACCOUNT_ID=<your-account-id> \
KSYUN_REGION=cn-beijing-6
```

`KSYUN_ACCOUNT_ID` is optional when the SDK can resolve it from AK/SK. Put only
runtime variables in a separate `prod.env`; do not put cloud AK/SK credentials
in that file:

```bash title="prod.env"
OPENAI_API_KEY=<your-model-api-key>
OPENAI_BASE_URL=https://api.example.com/v1
OPENAI_MODEL_NAME=<your-model-name>
```

<Callout type="warning" title="Credential boundary">
`--env-file` injects variables into the hosted runtime. Cloud credentials are
for the local deployment client and must not be forwarded as runtime env.
</Callout>

## Deploy To Serverless

Start with a dry run to inspect the target, region, artifact type, network, and
runtime environment without creating a remote Agent:

```bash title="shell"
agentengine launch . \
--target serverless \
--region cn-beijing-6 \
--env-file ./prod.env \
--dry-run
```

Remove `--dry-run` after reviewing the plan:

```bash title="shell"
agentengine launch . \
--target serverless \
--region cn-beijing-6 \
--env-file ./prod.env
```

This creates a Code artifact, uploads it to KS3, and creates or updates the
hosted Agent. Add `--name my-agent` to choose the name and `--no-cache` to
force a new package.

## Build And Deploy Separately

For CI or artifact review, build first and deploy the saved artifact reference:

```bash title="shell"
agentengine build . --mode code --push --region cn-beijing-6
agentengine deploy . --target serverless --region cn-beijing-6 --env-file ./prod.env
```

Build metadata is stored below `.agentengine/`. Use `--repackage` or
`--no-cache` when the current source must be packaged again.

## Container And KCE

For Container mode, configure `KCR_REGISTRY`, `KCR_USERNAME`, and
`KCR_PASSWORD`. Enterprise KCR and third-party registries require both username
and password. Personal KCR may omit `KCR_USERNAME`; the SDK falls back to
`KSYUN_ACCOUNT_ID`.

```bash title="shell"
agentengine config set \
KCR_REGISTRY=<registry-host/namespace> \
KCR_USERNAME=<registry-username> \
KCR_PASSWORD=<registry-password>

agentengine launch . \
--target serverless \
--artifact-type Container \
--registry <registry-host/namespace> \
--env-file ./prod.env
```

For KCE, use the same registry and a Container artifact, then choose a
namespace:

```bash title="shell"
agentengine launch . \
--target kce \
--artifact-type Container \
--registry <registry-host/namespace> \
--namespace default \
--env-file ./prod.env
```

## Network And Persistent Storage

New Agents allow public access by default. For VPC-only access, provide all
three network identifiers together:

```bash title="shell"
agentengine launch . \
--target serverless \
--disable-public-access \
--enable-vpc-access \
--vpc-id vpc-xxxx \
--subnet-id subnet-xxxx \
--security-group-id sg-xxxx \
--availability-zone cn-beijing-6a \
--env-file ./prod.env
```

Hermes and OpenClaw mount persistent storage by default. `adk`, `langchain`,
`langgraph`, and `deepagents` mount storage only when you explicitly provide a
mount path. For a persistent workspace or files across restarts:

```bash title="shell"
agentengine launch . \
--target serverless \
--storage-size-gi 20 \
--storage-mount-path /home/node/.agentengine \
--env-file ./prod.env
```

Storage sizes range from `20` to `500` Gi. Use `--no-storage` to explicitly
disable PVC storage.

## Verify And Access

After deployment, inspect the hosted Agent and then open its dashboard:

```bash title="shell"
agentengine agent list --region cn-beijing-6
agentengine agent status <agent-name-or-id> --region cn-beijing-6
agentengine dashboard open <agent-name-or-id>
```

Record the resulting Agent ID, name, and region with the deployment. When
updating an Agent, public-access settings are retained unless you explicitly
pass `--enable-public-access` or `--disable-public-access`.

## Troubleshooting

| Symptom | What to check |
| --- | --- |
| Missing or invalid cloud credentials | Inspect `KSYUN_ACCESS_KEY`, `KSYUN_SECRET_KEY`, and the selected region with `agentengine config show`. |
| VPC validation fails | Supply `--vpc-id`, `--subnet-id`, and `--security-group-id` together. Availability zone is optional and cannot replace them. |
| Container build fails | Confirm Docker is running, the registry is reachable, and registry credentials match the registry type. |
| Code package is too large | Remove unnecessary dependencies first; then use `--artifact-type Container` when an image is justified. |
| Hosted runtime cannot call the model | Confirm `prod.env` was passed with `--env-file` and its variable names match the model provider used by the Agent. |

<Callout type="info">
Run `--dry-run` whenever you first deploy, change target, or change network
settings. It checks the request plan without creating or updating a cloud Agent.
</Callout>
Loading
Loading