LangGraph
Trace LangGraph stateful agent graphs with full visibility into graph node transitions, LLM calls, and tool use. Extends the LangChain callback protocol with graph-specific node events.
Installation
Section titled “Installation”npm install @axonpush/sdk @langchain/langgraphimport { AxonPush } from "@axonpush/sdk";import { AxonPushLangGraphHandler } from "@axonpush/sdk/integrations/langgraph";
const client = new AxonPush({ apiKey: process.env.AXONPUSH_API_KEY!, tenantId: process.env.AXONPUSH_TENANT_ID!,});
const handler = new AxonPushLangGraphHandler({ client, channelId: 1, agentId: "my-agent",});import { StateGraph } from "@langchain/langgraph";
const graph = new StateGraph({ channels }) .addNode("agent", agentNode) .addNode("tools", toolNode) .compile();
const result = await graph.invoke(input, { callbacks: [handler] });Events Traced
Section titled “Events Traced”| Event | When |
|---|---|
chain.start | A chain or runnable begins execution |
chain.end | A chain or runnable completes |
llm.start | An LLM call begins |
llm.end | An LLM call completes |
llm.token | A streaming token is received |
tool.*.start | A tool invocation begins |
tool.*.end | A tool invocation completes |
graph.node.start | A graph node begins execution |
graph.node.end | A graph node completes execution |