For an installed Hermes Agent, use Hermes native Relay integration. It uses the host’s built-in runtime and Hermes application card, without this page’s framework examples, Python startup helper or Node.js manual instrumentation. The host and Relay version contracts differ between these paths.
The first success check is to find the Trace ID from this request in AI Vision and inspect the calls that ran. Integration credentials authorize data export to AI Vision; a model API key authorizes model calls. They are not interchangeable.
1. Select a language and obtain connection settings
Open Agent Access → Agent Market → Custom Agent integrations, choose Via NeMo Relay, then select Python for LangChain, LangGraph, or Deep Agents, or JavaScript / TypeScript for Node.js SDK. Select or create an AI Vision project and obtain complete credentials in the environment variables section.
Both the Python
relay_tracing.py helper and the Node.js example read these variables. For your first run, execute the page’s Shell settings in the same terminal as the example. Saving a .env file does not load it automatically: use the page’s loading command for Python, or --env-file below for Node.js. Configuration alone does not add instrumentation.
2. Run a complete example first
The commands below use Bash/zsh. The Python example requires 3.11+; if your interpreter is calledpython3, replace python in both installation and execution commands.
Python: LangChain example
For the first check, choose Python → LangChain and follow these steps:NeMo Relay Python: complete LangChain example and connection settings · Demo data · Click to enlarge
- Use Select project, or enter a name and click Create project. Click Get credentials under Environment variables. Ask the space administrator to check permissions if either action fails.
- Choose Run a complete example and copy the Shell environment settings into the terminal running Python. Replace
OPENAI_API_KEY,OPENAI_MODEL, andOPENAI_BASE_URLwith working model settings. Confirm that this machine can reachAIVISION_OTLP_ENDPOINTand the authorization value is complete, without placeholders or masks. - Click Download example and save
relay-langchain-agent-middleware.pyin a practice directory. The complete file already contains the startup helper; no separaterelay_tracing.pyis needed. In a Python 3.11+ environment, enter that directory, install dependencies, and run:
- Keep the 32 hexadecimal characters printed after
AI Vision trace_id. Enter them in Trace ID for this request, select Verify this Trace, and open the details to match the Trace ID, model, and tool nodes. You can find it again through My Agent channel → Agent traces. - After reading back this request, switch to Add to existing code and replace
existing_*, input, and session placeholders with your application objects.
JavaScript / TypeScript: Node.js local tool example
This example calculates7 × 9 so you can check the connection and the request/tool relationship. It makes no model calls, needs no model API key, and produces no model usage.
- Select JavaScript / TypeScript → Node.js SDK → Run a complete example. Install dependencies in a new practice directory to keep its module settings separate from your application:
node --version must report version 24 or newer. This example uses server-side Node.js and ESM modules; it does not run in a browser.
- Select or create a project on the page, click Get credentials, and execute the Shell environment settings in this terminal. Use the complete authorization value and an
AIVISION_OTLP_ENDPOINTreachable from this machine. This example only needs the threeAIVISION_*variables. - Click Download example, place
relay-nodejs.tsin the practice directory, and run:
.env in the same directory and use:
- A successful run prints output like this, with new IDs each time:
- Enter this Trace ID in Trace ID for this request and click Verify this Trace. Open the details and look for a request root with a
multiplytool child, inputa=7, b=9, and result63. No model node is expected for this example.
"type": "commonjs", save the file as relay-nodejs.mts, run node relay-nodejs.mts (optionally with --env-file=.env), and use .mts in its import path.
3. Integrate your existing application
Python framework integration
Install the dependencies shown on the page. Save the supplied startup module asrelay_tracing.py where your application can import it. Apply the “Add to existing code” snippet while preserving your model, tools, and business configuration.
Apply the changes for your framework:
- LangChain: add
NemoRelayMiddlewareto existing middleware and mergeNemoRelayCallbackHandlerinto invocation config. Preserve business callbacks. - LangGraph: the callback records graph lifecycle. Nested LangChain agents also need middleware and the parent config. Use official
create_tool_nodefor standalone tool nodes. - Deep Agents:
add_nemo_relay_integrationadds middleware to the main agent and dictionary subagents. MergeNemoRelayDeepAgentsCallbackHandler. Check internal calls separately for default general-purpose, precompiled, and remote subagents.
Node.js / TypeScript manual instrumentation
After verifying the local example, select Add to existing code. Keep the downloadedrelay-nodejs.ts and import its startup, request, and shutdown functions. It is a reusable module: importing it does not run the multiplication example. It does not need Python’s relay_tracing.py.
Replace existingAgent with your application function, pass the session ID and input to handleRequest, and register onShutdown with the service shutdown handler. Preserve the business return value and await child tasks before returning from the request. Keep credentials on the server.
The request wrapper records request input and output. Instrument internal tools and models with official APIs such as toolCallExecuteAsync / llmCallExecuteAsync at boundaries you control. This example does not automatically instrument LangChain.js or LangGraph.js, or provide the coverage of Python middleware.
Request and service lifecycle
For Python, callstart_tracing() once at service startup. Give each request its own request_scope, reuse the business session ID, and set the explicit business output after execution. After all requests finish, call stop_tracing() during shutdown; asynchronous services use await stop_tracing_async().
For Node.js, call the example’s startTracing() once at startup, use runWithTrace() per request, and await stopTracing() after all requests finish. These functions come from the downloaded example module; they are not top-level Relay SDK APIs.
Do not shut down the process exporter after each request. Review existing telemetry before adding another collector. Keep one complete collection path per destination and preserve the application’s existing environment.
Run a model and tool request with the Python framework example, or a local tool operation with the complete Node.js example. Save the printed trace_id, then verify actual requests after integrating your application.
4. Read and inspect the Trace
Enter thattrace_id on the integration page to read the selected project’s data. If you know the expected Span count from an independent execution record, enter it in the optional field before verifying. Inspect the unique Span count, storage count, read completeness, parent relationships, and usage results using the shared verification result guide, then open the details and verify:
- The record belongs to this request and project.
- Any model or tool calls that actually ran appear under the expected parents.
- Input, output, and errors match execution. Check usage only when the source provides it.
- For subagents, inspect internal calls as well as the subagent node.
Versions and further reading
Python examples use Relay 0.9.x / Python 3.11+ (nemo-relay>=0.9.3,<0.10), with 0.9.3 as the validated baseline. Node.js examples use Node.js 24+ / nemo-relay-node>=0.9.3 <0.10. Relay is pre-1.0, so installation stays within the same minor series. Use the framework dependency ranges shown on the integration page. Official documentation may describe newer releases. Official capabilities and examples validated with AI Vision have separate scopes. Recheck APIs, export settings, and real requests before upgrading.
Streaming, cancellation, TTFT, and subagent cleanup have version-dependent boundaries. See the source integration notes and validation evidence and known issues.
Official references: Relay overview, LangChain, LangGraph, Deep Agents, Node.js quick start (0.9.x), and OTLP export. Relay also provides application and CLI integrations. AI Vision recommends dedicated collectors for existing applications; this guide covers code integration for custom Agents.


