This page explains how framework integrations should attach existing application work to NeMo Relay runtime semantics.
Application code can usually call the managed NeMo Relay helpers directly. Framework integrations often cannot.
A framework may already own:
That means framework integrations must choose the best instrumentation boundary available rather than assuming direct runtime ownership.
When integrating NeMo Relay into an existing framework, prefer these choices in order:
This order preserves the most runtime semantics with the least distortion.
Execution wrappers are the preferred integration boundary when a framework exposes a real callback or handler.
Use the managed execute helpers when the framework exposes a stable callable boundary that NeMo Relay can wrap.
This is the best integration shape because it preserves:
Execution wrappers are also the natural place to align framework semantics with NeMo Relay execution intercepts.
Use explicit API calls when the framework owns part of the invocation lifecycle and cannot hand NeMo Relay a stable callback to wrap. Explicit calls let the framework keep its own scheduler, retry loop, callback signature, or provider client while still using selected NeMo Relay runtime behavior.
Explicit API calls are useful, but they are narrower than managed execution wrappers. Depending on which explicit APIs you call, you can lose:
Use explicit APIs when they match the framework boundary. Prefer managed execution wrappers whenever the framework can expose the real callback.
Use explicit start and end emission when the framework gives reliable lifecycle hooks but does not let NeMo Relay wrap the real invocation.
This fallback preserves lifecycle visibility, but the framework must pair start and end calls correctly.
Use standalone conditional-execution helpers when the framework only needs an allow-or-block decision before continuing its own invocation path.
This is the preferred explicit API when the framework can ask NeMo Relay for a policy decision but must still execute the real tool or provider call itself. The helper returns the guardrail decision; it does not emit a full managed lifecycle span by itself.
Use standalone request-intercept helpers when the framework needs NeMo Relay to rewrite the request before the framework continues execution on its own.
This is the preferred explicit API when the framework owns execution but can accept a rewritten JSON-compatible request before it calls the underlying tool or provider. Request-intercept helpers apply request transformation without owning callback execution.
Use mark events when the framework exposes important milestones but not a clean start/end lifecycle boundary.
Mark events are useful for:
They provide visibility, but they are not a replacement for full lifecycle instrumentation.
Use these rules to decide where NeMo Relay should wrap framework behavior.
Use these practices when applying the concept in application or integration code.