> 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 full documentation content, see https://docs.nvidia.com/nemo/relay/llms-full.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nemo/relay/_mcp/server.

# About

Use this section when you own an application, agent harness, or workflow and can route tool and LLM calls through NeMo Relay directly.

Direct instrumentation puts NeMo Relay at the boundaries where work happens.
Scopes define request and agent ownership, managed execution helpers wrap tool
and LLM calls, middleware applies policy and transformation, and subscribers
receive lifecycle events. This path gives the runtime a complete view of agent
work while keeping the application callback result unchanged.

## Start Here When

Use this guide when you need to:

* Trace nested agent work across tools and model calls
* Redact or normalize event payloads before export
* Block unsafe or invalid calls before execution
* Wrap calls with timing, routing, retries, or fallback behavior
* Isolate request-specific middleware and subscribers

If the tool or LLM boundary is owned by a framework, use [Integrate into Frameworks](/integrate-into-frameworks/about) instead.

## Guides

These guides show how to instrument applications with scopes, tool calls, LLM calls, middleware, and direct API examples.

* [Adding Scopes and Marks](/instrument-applications/adding-scopes-and-marks) shows how to create ownership boundaries and checkpoint events before adding call instrumentation.
* [Instrument a Tool Call](/instrument-applications/instrument-tool-call) shows the smallest managed tool wrapper with event validation.
* [Instrument an LLM Call](/instrument-applications/instrument-llm-call) shows the smallest managed model-provider wrapper with event validation.
* [Add Middleware](/instrument-applications/advanced-guide) shows how to add guardrails, request intercepts, execution intercepts, and scope-local behavior.
* [Code Examples](/instrument-applications/code-examples) collects direct API examples for tools, LLMs, streaming calls, scopes, and partial middleware helpers.

Start with scopes and marks, then instrument the call boundaries your
application owns. Add one middleware behavior at a time after the tool or LLM
wrapper is emitting the expected lifecycle events.

For production usage, keep tool names stable, keep payloads JSON-compatible, use
sanitize guardrails for sensitive fields, and prefer scope-local middleware when
behavior should apply to one request, tenant, or experiment.