> ## Documentation Index
> Fetch the complete documentation index at: https://docs.provenlog.com/llms.txt
> Use this file to discover all available pages before exploring further.

# LangGraph

> Audit LangGraph graphs with node-level events

<Note>
  **Prefer zero setup?** Use `plog run` or `import provenlog.auto` instead. See [Auto-Instrumentation](/integrations/auto-instrumentation).
</Note>

## Setup

```python theme={null}
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](/integrations/langchain), plus graph-specific events:

| Event       | Action Type | Details                  |
| ----------- | ----------- | ------------------------ |
| Node start  | `CUSTOM`    | Node name, step index    |
| Node end    | `CUSTOM`    | Node name, output        |
| Node error  | `CUSTOM`    | Node name, error details |
| Graph state | `CUSTOM`    | Checkpoint 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.

<Note>
  When auto-instrumentation detects LangGraph, it skips the separate LangChain patch — the LangGraph Trail captures both graph-level and chain-level events.
</Note>

## Configuration

```python theme={null}
# 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")
```
