Skip to main content
Prefer zero setup? Use plog run or import provenlog.auto instead. See Auto-Instrumentation.

Setup

from provenlog.integrations.langgraph import Trail

trail = Trail(agent_id="my-graph-agent")
graph.invoke(input, config={"callbacks": [trail]})

What gets captured

Everything from the LangChain integration, plus graph-specific events:
EventAction TypeDetails
Node startCUSTOMNode name, step index
Node endCUSTOMNode name, output
Node errorCUSTOMNode name, error details
Graph stateCUSTOMCheckpoint metadata

How it works

The LangGraph Trail extends the LangChain callback handler with graph-node-level awareness. It tracks which node is executing at any point, so LLM calls and tool calls within a graph are attributed to their specific node.
When auto-instrumentation detects LangGraph, it skips the separate LangChain patch — the LangGraph Trail captures both graph-level and chain-level events.

Configuration

# Simple — uses default embedded mode
trail = Trail(agent_id="my-graph-agent")

# With explicit client for custom configuration
from provenlog import ProvenLogClient

client = ProvenLogClient("http://localhost:7600", agent_id="my-agent")
trail = Trail(client=client, agent_id="my-graph-agent")