> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nemo/relay/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nemo/relay/_mcp/server.

# NeMo Relay Deep Agents Integration

> Add NeMo Relay observability to Deep Agents applications.

Use the `nemo_relay.integrations.deepagents` package to add NeMo Relay
observability to Deep Agents applications through the LangChain and LangGraph
integration surfaces that Deep Agents builds on.

## Setup

Install the Deep Agents integration extra in your application environment.

```bash
uv add "nemo-relay[deepagents]"
```

```bash
pip install "nemo-relay[deepagents]"
```

The example below uses the NVIDIA LangChain provider. Install that provider
extra too if you want to run the example as written:

```bash
uv add "nemo-relay[deepagents,langchain-nvidia]"
```

```bash
pip install "nemo-relay[deepagents,langchain-nvidia]"
```

## Usage Example

```python
import nemo_relay
from deepagents import create_deep_agent
from nemo_relay.integrations.deepagents import (
    NemoRelayDeepAgentsCallbackHandler,
    add_nemo_relay_integration,
)

agent = create_deep_agent(
    **add_nemo_relay_integration(
        model="nvidia:nvidia/nemotron-3-nano-30b-a3b",
        tools=[],
        name="main-agent",
    )
)

input_payload = {
    "messages": [
        {
            "role": "user",
            "content": "Research recent GPU news",
        }
    ]
}

with nemo_relay.scope.scope("deepagents-request", nemo_relay.ScopeType.Agent):
    result = agent.invoke(
        input_payload,
        config={"callbacks": [NemoRelayDeepAgentsCallbackHandler()]},
    )

final_message = result["messages"][-1]
print(f"Final response: {final_message.content}")
```

Add `skills=[...]` or subagent configuration after this minimal path is working
when you need to capture Deep Agents skill or subagent marks.

## Verify the Integration

The integration works correctly when:

* The Deep Agents run completes and prints a final response.
* The `deepagents-request` scope contains the top-level agent execution.
* Skill, subagent, and human-in-the-loop marks appear when those features are exercised.

## Observability

The integration composes the existing NeMo Relay LangChain and LangGraph hooks,
then emits Deep Agents-specific marks for configured skills, subagents, and
human-in-the-loop lifecycle events.

It captures:

* LangChain model and tool calls through NeMo Relay managed execution.
* LangGraph run scopes through callbacks.
* Human-in-the-loop interrupt and resume marks.
* Configured skills and subagent summaries at agent-run start.
* In-process dictionary-style subagents with the same NeMo Relay middleware, so
  their model and tool calls are captured when Deep Agents invokes them.

Remote graphs or processes still need NeMo Relay instrumentation in that graph
or process to capture their internal model and tool calls.

Refer to [Observability](/configure-plugins/observability/about)
for details on exporting NeMo Relay observability data to third-party systems.