@axiom-lattice/gateway

中文文档
10.1.1发布于 2026/11/03ISCTypeScriptESM + CJS近 30 天下载 4459

API Gateway for LangGraph agent-based applications

原始使用文档
文档目录5 节
  1. Store Consumption
  2. How it works
  3. Quick Start
  4. Logger Configuration
  5. API Endpoints

@axiom-lattice/gateway

Fastify-based HTTP API gateway exposing REST endpoints for agent execution, thread management, and configuration.

Store Consumption

The gateway reads all stores from StoreLatticeManager at startup — no manual wiring needed. Register stores via configureStores before calling startAsHttpEndpoint():

import { configureStores } from "@axiom-lattice/core";
import { createPgStoreConfig } from "@axiom-lattice/pg-stores";
import { LatticeGateway } from "@axiom-lattice/gateway";

const stores = createPgStoreConfig(process.env.DATABASE_URL);
await configureStores({ ...stores });

// Gateway picks up stores from StoreLatticeManager automatically
LatticeGateway.startAsHttpEndpoint({ port: 4001 });

How it works

The gateway internally calls getStoreLattice("default", type) for each store it needs:

  • channelBinding — used by MessageRouter for sender-to-agent binding resolution
  • channelInstallation — used for channel instance lookup
  • database — SqlDatabaseManager reads configs lazily on first query
  • metrics — MetricsServerManager loads configs on first access
  • All other stores — consumed by controllers via getStoreLattice("default", type)

No setConfigStore() or loadConfigsFromStore() calls needed — each manager reads directly from StoreLatticeManager.

Quick Start

import { LatticeGateway } from "@axiom-lattice/gateway";

LatticeGateway.startAsHttpEndpoint({
  port: 4001,
});

Logger Configuration

import { LatticeGateway } from "@axiom-lattice/gateway";
import { LoggerType } from "@axiom-lattice/protocols";

LatticeGateway.startAsHttpEndpoint({
  port: 4001,
  loggerConfig: {
    name: "default",
    type: LoggerType.PINO,
    serviceName: "my-service",
  },
});

API Endpoints

  • POST /api/v1/run — Execute agent
  • POST /api/v1/run/stream — Stream agent execution
  • GET /api/v1/run/:thread_id — Get run status
  • GET /api/v1/run/:thread_id/messages — Get message history

版本与发布记录

@axiom-lattice/gateway 共发布 219 个版本,首次发布于 2025/09/01;过去 12 个月发布了 194 个版本。

版本发布日期距今
10.1.1latest2026/11/034 天前
10.1.02026/11/034 天前
10.0.12026/11/025 天前
10.0.02026/10/317 天前
9.0.02026/10/299 天前
8.4.02026/10/2810 天前

其他发布通道:hotfix → 2.1.20-hotfix.0。

关于 @axiom-lattice/gateway 的常见问题

@axiom-lattice/gateway 是什么?

API Gateway for LangGraph agent-based applications

如何安装 @axiom-lattice/gateway?

在项目目录运行 npm install @axiom-lattice/gateway,或使用 pnpm add / yarn add / bun add。

@axiom-lattice/gateway 支持 TypeScript 吗?

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

@axiom-lattice/gateway 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@axiom-lattice/gateway 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=20.10.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@axiom-lattice/gateway 可以商用吗?

@axiom-lattice/gateway 使用 ISC 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@axiom-lattice/gateway 的下载量有多少?

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

@axiom-lattice/gateway 还在维护吗?

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