@dbx-tools/appkit-graphiti

中文文档
0.9.129发布于 2026/10/14Apache-2.0TypeScriptES Module构建来源已验证近 30 天下载 2007

AppKit Graphiti plugin and Python runtime supervision

原始使用文档
文档目录4 节
  1. Start And Stop Graphiti
  2. Run Until Exit
  3. Embed The Runtime
  4. Register With AppKit

@dbx-tools/appkit-graphiti

Run Graphiti as an AppKit plugin or supervise the same Python runtime directly from Node. The package root exposes the plugin; the runtime and options subpaths expose the underlying lifecycle and configuration contracts.

Start And Stop Graphiti

Build and start the sidecar with the same shared options used by the CLI and AppKit:

import { createGraphitiChildProcess } from "@dbx-tools/appkit-graphiti/runtime";

const { child } = await createGraphitiChildProcess({
  profile: "MY-PROFILE",
  modelClass: "chat-fast",
});

await child.shutdown();

createGraphitiChildProcess({ healthCheck }) accepts an async GraphitiHealthCheck. By default it polls Graphiti's /healthcheck endpoint and returns only after readiness succeeds. The AppKit plugin supplies an OpenAPI probe so tool registration can use the same non-empty /openapi.json document that established startup, then polls /healthcheck with the remaining startup budget. Every tool call awaits that healthcheck promise, and AppKit is SIGTERMed if the later probe fails.

Set bearer or GRAPHITI_TOKEN to require bearer authentication on every Graphiti HTTP endpoint. The AppKit plugin generates a fresh bearer for each sidecar run and includes it in all private requests automatically.

Set PYTHON to launch that interpreter directly. Without it, the runtime uses uv run to provision the matching dbx-tools-graphiti package. Set DBX_TOOLS_NODE_BIN to prepend a specific Node executable's directory for Python and its descendants.

Calling shutdown() requests platform termination, allows bounded Python cleanup, and force-kills the process tree only when graceful shutdown exceeds its deadline.

Run Until Exit

Use the foreground helper when another Node entry point owns signal handling:

import { runGraphiti } from "@dbx-tools/appkit-graphiti/runtime";

await runGraphiti({ profile: "MY-PROFILE" });

Model selection, route resolution, authentication refresh, process supervision, PostGraph client lifecycle, and embedded PostgreSQL lifecycle remain internal to the runtime. Omit databaseUrl to persist bundled PostgreSQL beneath graphitiHome. A configured PostgreSQL URL or Lakebase target uses the external database instead.

Set postgresRole or DBX_TOOLS_POSTGRES_ROLE when Graphiti should use the shared PostgreSQL assumed-role policy. The login identity must already have permission to SET ROLE to that role.

Embed The Runtime

Use this package from Node applications that need Graphiti lifecycle control. Use @dbx-tools/cli/graphiti for Commander and desktop-service commands.

Register With AppKit

import { graphiti } from "@dbx-tools/appkit-graphiti";

export default {
  plugins: [graphiti({ profile: "MY-PROFILE" })],
};

The package root provides sidecar startup, OpenAPI-derived tool registration, per-user graph scopes, and the exported GRAPHITI_CONFIG_SCHEMA.

The model-facing add_memory tool executes Graphiti's synchronous write operation, so a successful tool result means extraction and PostgreSQL persistence completed. The direct HTTP surface retains the upstream fire-and-forget operation for callers that intentionally manage queued writes.

Run the manual smoke tiers separately from routine tests:

bun run graphiti:smoke:embedded
bun run graphiti:smoke:mastra --profile MY-PROFILE

The embedded smoke test covers PostGraph CRUD, full-text search, shutdown, and restart persistence. The Mastra smoke test starts the AppKit plugin on an automatically selected loopback port, writes through the model-facing tool, restarts the embedded database, and verifies retrieval through the same tool provider path used by Mastra agents.

版本与发布记录

@dbx-tools/appkit-graphiti 共发布 146 个版本,首次发布于 2026/08/14;过去 12 个月发布了 146 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.9.129latest2026/10/141 个月前
0.9.1282026/10/141 个月前
0.9.1272026/10/141 个月前
0.9.1262026/10/141 个月前
0.9.1252026/10/141 个月前
0.9.1242026/10/141 个月前

关于 @dbx-tools/appkit-graphiti 的常见问题

@dbx-tools/appkit-graphiti 是什么?

AppKit Graphiti plugin and Python runtime supervision

如何安装 @dbx-tools/appkit-graphiti?

在项目目录运行 npm install @dbx-tools/appkit-graphiti,或使用 pnpm add / yarn add / bun add。

@dbx-tools/appkit-graphiti 支持 TypeScript 吗?

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

@dbx-tools/appkit-graphiti 支持 ESM 还是 CommonJS?

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

@dbx-tools/appkit-graphiti 可以商用吗?

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

@dbx-tools/appkit-graphiti 的下载量有多少?

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

@dbx-tools/appkit-graphiti 还在维护吗?

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