Skip to main content
Quick setup? Instead of following these steps manually, copy a prompt into your coding agent and it will set this up for you automatically.
LangWatch integrates with LangGraph to provide detailed observability into your graph-based agents, LLM calls, and tool usage.

Installation

Usage

The LangWatch API key is configured by default via the LANGWATCH_API_KEY environment variable.
Use LangWatch’s callback handler to instrument your LangGraph agents. Pass the callback to the graph invocation, not to a model call inside a node: LangGraph then propagates it to everything the run touches, so every node becomes a span, including tool nodes and plain Python nodes.
The @langwatch.trace() decorator creates a parent trace for your graph execution. get_langchain_callback() goes in the config of agent.invoke(), and the same config argument works for ainvoke() and stream(). From there LangGraph passes it down: each node becomes a chain span named after the node, model calls become LLM spans, and tool calls become tool spans. A callback attached only to the model call inside one node produces LLM spans alone. The tool nodes and the plain function nodes never appear, so the trace does not show which step the graph ran.
Last modified on September 18, 2026