拱顶吊带
一层薄薄的,有管理的地层 朗彩深处 探员。每次会议都运行 在一个声明性工作流程状态的机器下,您在一个YAML文件中写作.
为何要用拱顶吊带
与AI代理的可靠自动化应该跟随这个过程,拥有该程序的人应该 进程应该能够编写。 今天,大多数域专家都无法做到这一点. 目前的自动化工具在三个方面都不足.
- 代理人是一个步骤,而不是过程. 经纪人坐在一个固定的图里 所以 灵活性结束于一个节点的边缘。 过程和图表一样僵硬 画了.
- 这一进程及其执行是分散的. 每一个业务流程均重报为 技术图。 使两件艺术品和两个主人 永远保持同步 停止成本计算.
- 复杂数据仍以代码结尾. 编码中的嵌入式有效载荷、环和算术用地 节点。 拥有这一过程的人不能读取,更不要说修改了.
拱顶吊带扭转了局面 经纪人负责整个过程,一个 workflow.yaml 两者
描述并强制执行它。 数据工作在沙盒里发生 同样的规则.
完整文档: https://harness.archmax.ai/ (中文(简体) )
安装
npm install @archmax-ai/harness
节点22或后. 该模型是通过环境配置的,与任何 OpenAI 兼容
终点 拱顶吊带读取这些钥匙 .env 工作空间根 :
ARCHMAX_API_BASE_URL=https://api.example.com/v1
ARCHMAX_API_KEY=...
ARCHMAX_MODEL=...
ARCHMAX_MODEL 默认值。 一个工作流程名称 ID 状态运行 settings.model, (中文(简体) ),
并且一个州会用它自己的 model:无论如何,它是一个身份,解决了
同样的终点和证书。 所以机械状态可以运行在小模型上 而状态
一个人读的输出 运行在一个能力.
见 配置 页:1 每个变量.
要为您设置一个编码代理( Claude Code, Cursor, Codex,...) 作者工作流程, 安装 编写技能 :
npx skills add archmax-ai/harness
快速启动
四个州的退款台 代理决定退款 并起草电子邮件,脚本检查
反政策的决定, 一个分级员检查电子邮件, 代理发送它。 完整
实例在 examples/refund/。 。 。 .
refund/
├── index.js # your program: the host tools and the agent
├── tools.js
└── workflows/refund/
├── workflow.yaml # the process, enforced
└── scripts/check-decision.js # the deterministic check
工作流程
# workflows/refund/workflow.yaml
title: Refund request
instructions: Decide only from what lookup_customer returns; never guess an order.
states:
decide:
triggers:
manual:
requires: [email]
tools:
allow: [lookup_customer]
instructions: >-
Look the customer up with lookup_customer, using the `email` variable. A
refund is approved only when their order is delivered; otherwise it is
denied. Record the decision with archmax_set_variables as `decision`
(approved or denied), write the email to the customer in
scratchpad/email.md, then advance to check-decision. If you are sent
back, fix what the note says and advance again.
transitions:
- to: check-decision
description: The decision is recorded and the email is drafted.
check-decision:
type: code
script: scripts/check-decision.js
tools:
allow: [lookup_customer]
transitions:
- to: review-email
description: The decision matches the refund policy.
- to: decide
description: The decision contradicts the refund policy.
review-email:
type: grader
instructions: >-
Read scratchpad/email.md and the `decision` variable. Approve the email
when it is polite, states the decision plainly and names the order.
Otherwise send it back, saying exactly what to change.
transitions:
- to: send
description: The email is ready to send.
- to: decide
description: The email needs changes.
send:
tools:
allow: [send_email]
instructions: >-
Send scratchpad/email.md to the customer at `email` with send_email, then
say in one sentence that it was sent.
每个状态都是过程的一步,而代理人只看到它所在的一步:
状态的指令,其工具和其中的转换, 每一个描述,以便它可以选择
他们之间 它通过呼叫继续前进 archmax_advance,而运行时间拒绝任何边缘 状态没有
声明 无过渡状态,如 send,是会议结束的地方.
其中两个州没有代理运营. check-decision 是一个代码状态: 运行时间
它的脚本进入, 没有模式调用. review-email 是一个分级状态: 一个孤立的
代理根据州政府的指示判断电子邮件。 两个都只到达自己的州
工具, 双方决定 同样的代理方式,与 archmax_advance返回到
代理作为笔记 它读之前再次尝试.
检查
// workflows/refund/scripts/check-decision.js
/** A refund is due only for a delivered order: any other decision goes back to the agent. */
export default async function ({ variables, tools }) {
const customer = JSON.parse(await tools.lookup_customer({ email: variables.email }));
const order = customer?.order;
const due = order?.status === "delivered" ? "approved" : "denied";
if (variables.decision === due) {
await tools.archmax_advance({
to: "review-email",
reason: `The refund is ${due}, as the policy requires.`,
});
} else {
await tools.archmax_advance({
to: "decide",
reason: `Order ${order?.id ?? "(none)"} is ${order?.status ?? "unknown"}, so the refund must be ${due}.`,
});
}
}
政策是建立在代码上的 所以不管模型怎么说 当代理记录错误 脚本会带着原因发回来 在别人给邮件分级之前.
运行它
npm install @archmax-ai/harness langchain zod
lookup_customer 财务报告和审定财务报表 send_email 是你们的系统,作为普通的LangChain工具:
// tools.js
import { tool } from "langchain";
import { z } from "zod";
const customers = {
"[email protected]": { name: "Ann", order: { id: "ORD-1001", status: "delivered" } },
"[email protected]": { name: "Bob", order: { id: "ORD-1002", status: "shipped" } },
};
export const lookupCustomer = tool(async ({ email }) => JSON.stringify(customers[email] ?? null), {
name: "lookup_customer",
description: "Look up a customer and their latest order by email address.",
schema: z.object({ email: z.string() }),
});
export const sendEmail = tool(
async ({ to, body }) => {
console.log(`To ${to}:\n${body}`);
return "sent";
},
{
name: "send_email",
description: "Send an email to the customer.",
schema: z.object({ to: z.string(), body: z.string() }),
},
);
// index.js
import { createAgent } from "@archmax-ai/harness";
import { lookupCustomer, sendEmail } from "./tools.js";
const agent = await createAgent({
workflow: "refund",
tools: [lookupCustomer, sendEmail],
workspace: { rootDir: import.meta.dirname },
});
const outcome = await agent.workflow.send("ticket-1001", {
message: "Hi, I'd like a refund for my last order.",
variables: { email: "[email protected]" },
});
console.log(outcome.kind); // "completed"
console.log(outcome.auditTrail.map((step) => `${step.kind} → ${step.to}`).join("\n"));
completed
trigger → decide
agent → check-decision
code → review-email
grader → send
一个电话是一转 outcome 说它是如何结束的: completed, (中文(简体) ), parked (等待一个人)
或事件),或 failed (代理人打电话 archmax_raise 因为工作无法完成). 这个
线索记录了每一个动作 是谁做的 届会具有持久性,在 sessions/ 默认,所以
send 与同样的身份 继续谈话.
国家行动倡议
工作流程也从命令线上流出 只需要带子的工具 参考文献
工作空间 examples/customer-support/ 是一个,它是套房
端到端测试以真实模式进行:
npx archmax run order-lookup "Which orders are delayed for Acme?" --root examples/customer-support
npx archmax test order-lookup --root examples/customer-support # run the workflow's cases
npx archmax validate order-lookup --root examples/customer-support # static checks, no model calls
退款的例子需要你的两个工具,所以它从你的代码中运行. 见
CLI 参考 页:1 sessions, (中文(简体) ), decide, (中文(简体) ), reply 财务报告和审定财务报表
deliver。 。 。 .
下一个
用编码代理撰写
写作技巧教一个编码代理 计划,年级和代码状态,治理,人 国家、案件和《国家国际法》。 装入 技能水平数字 :
npx skills add archmax-ai/harness
从GitHub安装最新版本。 将技能定在您的项目 SDK 版本
取决于,在包中安装运出的副本,然后 npm install数字 :
npx skills add ./node_modules/@archmax-ai/harness
对于技能 中间软件 在你自己的经纪人 BUNDLED_AUTHORING_SKILL_DIR 导出决定
包装副本。 来源是 skills/archmax-harness/。 。 。 .
文档
- 快速启动 财务报告和审定财务报表 安装
- 指南: 工作流程机, (中文(简体) ), 年级和代码状态, (中文(简体) ), 会议, (中文(简体) ), 触发, (中文(简体) ), 技能, (中文(简体) ), 子工作流程, (中文(简体) ), 测试, (中文(简体) ), 符号效率
- 参考: 机器光谱, (中文(简体) ), 国 际, (中文(简体) ), 公开 API, (中文(简体) ), 词汇表, (中文(简体) ), 更改日志
发展
npm run dev -- run order-lookup "..." --root examples/customer-support
npm run typecheck && npm test
npm run docs:dev
实质性变化通过 打开Spec 下级
openspec/文献, README.md 和写作技巧的飞船在与
他们描述的行为。 见 捐款额 编辑
开发设置。 。 。 .
许可证
麻省理工学院. 见 自由主义。 。 。 .