NeMo Relay LangGraph Integration
Use the nemo_relay.integrations.langgraph package to add NeMo Relay
observability to LangGraph workflows through public LangGraph APIs.
Setup
Install the LangGraph integration extra in your application environment.
uv
pip
Installing the langgraph extra also installs the LangChain integration
dependencies.
Usage Example
Managed ToolNode Calls
For a standalone LangGraph ToolNode, construct the node with
create_tool_node. It routes each model-requested tool call through Relay’s
managed execution pipeline while preserving LangGraph state, store, and runtime
argument injection.
NemoRelayCallbackHandler records the graph lifecycle and provides its scopes.
create_tool_node provides managed tool execution; use both for complete
standalone LangGraph instrumentation. For custom ToolNode wrapper composition,
construct ToolNode directly and pass wrap_tool_call and awrap_tool_call
from this integration.
For LangChain agents inside a LangGraph workflow, use NemoRelayMiddleware from
this package the same way as the LangChain integration and pass the LangGraph
config into the nested agent call:
Install the NVIDIA LangChain provider if you want to run the nested agent example as written:
uv
pip
Verify the Integration
The integration works correctly when:
graph.invoke(...)returns the incremented state from the example.- The
langgraph-requestscope contains the LangGraph run. - Nested LangChain agents inherit the same callback config when you pass the LangGraph
configthrough.
Observability
Refer to Observability for details on exporting NeMo Relay observability data to third-party systems.