@ailu-ai/graph-sdk

中文文档
2.8.5发布于 2026/11/06Apache-2.0TypeScriptES Module近 30 天下载 2866

Ailu框架的正门——构建,编译和运行状态,可重复的代理图. 运行在 Rust 引擎上 (@ailu-ai/napi),这是必需的依赖.

中文使用文档
文档目录3 节
  1. 安装
  2. 快速启动
  3. 许可证

@ailu-ai/graph-sdk (英语)

前面的门 爱路 框架:建立、, 编译和运行 状态、可更新的代理图表 ——代理,工具,人文审批 大门,文物和长跑的工作流程——不触及下层引擎.

每次跑步都会经过检查:它可以停在人类认可的大门上 从它停止的地方恢复。 要恢复到另一个进程, 请用 runCatalogGraph 并保持它返回的状态.

安装

npm install @ailu-ai/graph-sdk
# or: pnpm add @ailu-ai/graph-sdk   /   yarn add @ailu-ai/graph-sdk

Ailu的Rust引擎上有图 它作为预先建造的土生土长的船舶(@ailu-ai/napi, (中文(简体) ), 为macOS(x64,arm64),用glibc(x64,arm64)和Windows x64安装了SDK. 没有 TypeScript 倒置: 在另一个平台 compile() 掷出 RustEngineRequiredError。在启动时检查:

import { rustEngineAvailable } from "@ailu-ai/graph-sdk";
console.log(rustEngineAvailable()); // true when the native engine loaded

快速启动

import { createGraph } from "@ailu-ai/graph-sdk";

const app = createGraph({ name: "greeter" })
  .node("hello", async (_input, state) => ({
    greeting: `Hello, ${(state.channels as Record<string, unknown>).name}!`
  }))
  .compile();

const result = await app.run({ name: "Ada" });
console.log(result.channels.greeting); // "Hello, Ada!"

增加一个人类认可门和跑道 暂停 干净,那么 恢复 从其 检查站:

const app = createGraph({ name: "publish-flow" })
  .node("write", async () => ({ draft: "Hello from Ailu." }))
  .humanGate("review")
  .node("publish", async () => ({ approved: true }))
  .edge("write", "review")
  .edge("review", "publish")
  .compile();

const suspended = await app.run();              // status: "suspended"
const done = await app.resume(suspended.runId); // status: "completed"

代理节点需要一个模型和一个提示. API 密钥从环境读取 (单位:千美元)ANTHROPIC_API_KEY 这里); 没有密钥, 运行失败, 并说要设置哪个变量 . 在引擎的定型模拟器(测试,CI)上下线 AILU_LLM_MOCK=1。 。 。 .

import { createGraph, model } from "@ailu-ai/graph-sdk";

const app = createGraph({ name: "assistant" })
  .agentNode("reply", {
    model: model.anthropic("claude-sonnet-4-6"),
    prompt: { system: "Answer in one sentence." }
  })
  .compile();

const out = await app.run({ question: "What is a checkpoint?" });
console.log(out.channels.agentResult);

有条件的路线总是 名称为上游 从不 eval'd 字符串——哪个 让爱露的流量安全、可检查.

联合国 https://ai-adriane.github.io/ailu-core/ 互联网档案馆的存檔,存档日期2013-12-21。 。 。 .

许可证

阿帕奇2.0 (英语). 见 LICENSE。 。 。 .

版本与发布记录

@ailu-ai/graph-sdk 共发布 18 个版本,首次发布于 2026/09/29;过去 12 个月发布了 18 个版本。

版本发布日期距今
2.8.5latest2026/11/061 天前
2.8.42026/11/053 天前
2.8.32026/11/053 天前
2.8.22026/10/308 天前
2.8.12026/10/299 天前
2.8.02026/10/299 天前

关于 @ailu-ai/graph-sdk 的常见问题

@ailu-ai/graph-sdk 是什么?

Ailu框架的正门——构建,编译和运行状态,可重复的代理图. 运行在 Rust 引擎上 (@ailu-ai/napi),这是必需的依赖.

如何安装 @ailu-ai/graph-sdk?

在项目目录运行 npm install @ailu-ai/graph-sdk,或使用 pnpm add / yarn add / bun add。

@ailu-ai/graph-sdk 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@ailu-ai/graph-sdk 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@ailu-ai/graph-sdk 可以商用吗?

@ailu-ai/graph-sdk 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@ailu-ai/graph-sdk 的下载量有多少?

根据 npm 官方下载统计,@ailu-ai/graph-sdk 在 2026/10/05 – 2026/11/03 这 30 天内被下载 2,866 次,日均约 96 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@ailu-ai/graph-sdk 还在维护吗?

最新版本 2.8.5 发布于 2026/11/06(1 天前);至今共发布 18 个版本,其中过去 12 个月发布了 18 个;首次发布于 2026/09/29。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。