@axiom-lattice/gateway
v2.1.108
Published
API Gateway for LangGraph agent-based applications
Readme
@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 byMessageRouterfor sender-to-agent binding resolutionchannelInstallation— used for channel instance lookupdatabase—SqlDatabaseManagerreads configs lazily on first querymetrics—MetricsServerManagerloads 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,
queueServiceConfig: { type: "memory", defaultStartPollingQueue: true },
});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 agentPOST /api/v1/run/stream— Stream agent executionGET /api/v1/run/:thread_id— Get run statusGET /api/v1/run/:thread_id/messages— Get message historyGET /api/config— Get gateway configurationPUT /api/config— Update gateway configuration
