声明式编排引擎,通过Workspace和Gateway规范定义Agent任务,自动沙箱隔离、网络隔离并在集群中大规模运行Agent工作负载。
我们仍在积极完善核心概念、协议和规范。在稳定发布之前,我们可能会引入重大的破坏性变更。
用 workspace 和 gateway 规范声明一个 agentic 任务。AX 会将其沙箱化、接好 workspace、隔离其网络,并帮助其大规模运行。
AX 是一个高吞吐量、声明式的编排器,用于在集群中运行数十亿个自主 agent 工作负载。它运行在 Agent Substrate 之上以实现沙箱化执行,设计目标是每集群运行数十亿个任务。如果你用过 Kubernetes,ax 会让你感到熟悉。
# task.yaml
apiVersion: ax.io/v1alpha1
kind: Workspace
metadata:
name: golang
spec:
git:
- repo: https://github.com/golang/go.git
branch: "my-fix"
---
apiVersion: ax.io/v1alpha1
kind: Task
metadata:
name: test
spec:
workspaces:
- name: golang
goal: "Ensure that Go tool chain is available and is built from source"
debug: true # lets you `ax ssh` into the sandbox
然后 apply 它,观察它启动,并从旁观察 agent 的行为:
ax apply -f task.yaml
ax watch task test
ax ssh test -- ls -al /workspace
Agent 是一种新型的工作负载。它既不是无状态的微服务,也不是运行到结束的批处理作业。它会积累状态、需要严格的隔离、调用模型 API 和工具服务器,如果没人盯着还可能在循环中烧钱。AX 给你四个小的原语,声明式地处理所有这些场景:
一切都是 ax.io/v1alpha1 manifest,用一条命令 apply。
go install github.com/google/ax/cmd/ax@latest
这会把 ax 二进制文件放到 $(go env GOPATH)/bin。确保该目录在你的 PATH 上。
你需要一个 Kubernetes 集群、ko(brew install ko)、你的集群能拉取的容器仓库,以及一个可达的 Agent Substrate Control API(集群内默认值:api.ate-system.svc.cluster.local:443)。
make deploy AX_IMAGE_REPO=<your-registry>
这会先部署 Redis,然后用 ko 构建并部署控制平面镜像。所有资源都落在 ax-system namespace 下。
ax apply -f examples/task.yaml # Task + Workspace + Gateway + Model in one file
ax get tasks
# NAME ATESPACE PHASE ACTOR WORKER-IP AGE
# task123 default Running task123 10.20.3.67 1m
ax watch task task123 # stream phase and condition changes live
ax ssh task123 -- ls -la /workspace # poke around inside the sandbox
ax suspend task task123 # checkpoint and pause
ax resume task task123 # pick up where it left off
想看完整的生命周期端到端体验?运行 ./demo.sh。它 apply 一个自定义 workspace、等待就绪、通过 ax ssh 执行命令,然后 suspend 任务。
ax 通过 gRPC 与控制平面通信。它有意设计成 kubectl 的形态:apply、get、describe、watch、delete,外加几个 agent 专用的动词。
# Apply anything (multi-document YAML, file or stdin)
ax apply -f examples/task.yaml
# Tasks
ax get tasks # list
ax get tasks -a my-atespace # list in another atespace
ax get task task123 # full spec + live status as YAML
ax describe task task123 # human-readable detail
ax watch task task123 # stream status and condition transitions
ax suspend task task123 # checkpoint actor state and pause
ax resume task task123 # resume a suspended task
ax delete task task123
# Shell into the running sandbox
ax ssh task123 # interactive shell (task needs spec.debug: true)
ax ssh task123 -- ls -la /workspace # one-off command
ax ssh task123 -- python3 main.py
# Gateways, workspaces, models follow the same pattern
ax get gateways
# NAME ATESPACE LISTENERS EGRESS-HOSTS
# default-gateway default 8494/gRPC,8080/HTTP *
ax describe gateway default-gateway
ax delete gateway default-gateway
ax get workspaces
# NAME ATESPACE GIT-REPOS MCP-SERVERS
# default-workspace default 1 1
ax describe workspace default-workspace
ax delete workspace default-workspace
ax get models
# NAME ATESPACE PROVIDER MODEL
# default-model default google gemini-3.8-flash
ax describe model default-model
ax delete model default-model
# Connection plumbing
ax ctx # active kube context and how ax is reaching the control plane
ax tunnel list # background tunnels (state lives in ~/.ax/tunnels)
ax tunnel stop
ax version
ax 跟随你当前激活的 Kubernetes context。切换集群时 ax 会在后台解析并隧道连接到那个集群的控制平面。
kubectx staging-cluster
ax get tasks
kubectx prod-cluster
ax get tasks
# Or target a context without switching
ax --context=dev-cluster get tasks
Apache License 2.0。详情见 LICENSE。