Adaptive Helpers
Generated from crates/node/adaptive.d.ts.
Import from nemo-relay-node/adaptive.
Adaptive plugin configuration helpers.
Interfaces
BackendSpec
Adaptive state backend selection.
StateConfig
Adaptive state configuration.
TelemetryConfig
Built-in adaptive telemetry settings.
AdaptiveHintsConfig
Built-in adaptive hints injection settings.
ToolParallelismConfig
Built-in adaptive tool scheduling settings.
AcgStabilityThresholds
ACG prompt-stability classification thresholds.
AcgConfig
Adaptive cache-governor settings.
Config
Canonical config object for the top-level adaptive component.
ComponentSpec interface
Top-level adaptive component wrapper with fixed kind adaptive.
CacheUsage
Normalized LLM token usage for cache telemetry.
AgentIdentity
Identity of the agent associated with cache telemetry.
CacheRequestFactsOptions
Input for building cache request facts.
CacheRequestFacts
Request-time facts used to classify cache misses.
CacheTelemetryEventOptions
Input for building cache telemetry events.
CacheTelemetryEvent
Normalized adaptive cache telemetry event.
Classes
AdaptiveRuntime
Owned adaptive runtime outside the generic plugin system.
Functions
defaultConfig
Create a default adaptive component config.
Returns the minimal top-level adaptive config shape with version = 1 so callers can add state, telemetry, and scheduler settings incrementally.
Returns
A new adaptive config object.
Remarks
The returned object is detached from runtime state until it is wrapped with ComponentSpec and activated through the plugin system.
inMemoryBackend
Create an in-memory adaptive state backend spec.
Produces the backend descriptor for ephemeral adaptive state stored inside the current process rather than an external datastore.
Returns
An adaptive backend spec using in-memory storage.
Remarks
This backend does not persist state across process restarts.
redisBackend
Create a Redis-backed adaptive state backend spec.
Produces the backend descriptor expected by the adaptive plugin when state should be shared or persisted through Redis.
Parameters
url: Redis connection URL for the backend.keyPrefix: Prefix applied to Redis keys.
Returns
An adaptive backend spec using Redis storage.
Remarks
The default key prefix namespaces runtime records under nemo_relay: unless a different prefix is supplied.
telemetryConfig
Create adaptive telemetry settings with runtime defaults applied.
Merges caller-supplied overrides onto the built-in telemetry config shape used by the adaptive plugin.
Parameters
config: Partial telemetry settings to override.
Returns
A normalized adaptive telemetry config object.
Remarks
An empty learners array is supplied by default so callers can append learner names without checking for initialization first.
adaptiveHintsConfig
Create adaptive hint-injection settings with defaults applied.
Merges caller-supplied overrides onto the default config used by the adaptive hints injector.
Parameters
config: Partial adaptive hints settings to override.
Returns
A normalized adaptive hints config object.
Remarks
By default the injector runs at priority 100, preserves the rest of the chain, and writes hints to nvext.agent_hints.
toolParallelismConfig
Create adaptive tool-parallelism settings with defaults applied.
Merges caller-supplied overrides onto the scheduler config shape used by the adaptive plugin’s tool parallelism component.
Parameters
config: Partial tool scheduling settings to override.
Returns
A normalized tool-parallelism config object.
Remarks
The default mode is observe_only, so recommendations are produced without changing execution behavior unless the caller opts in.
acgConfig
Create adaptive cache-governor settings with defaults applied.
Merges caller-supplied overrides onto the Adaptive Cache Governor (ACG) config shape used by the adaptive plugin’s LLM execution intercept.
Parameters
config: Partial Adaptive Cache Governor (ACG) settings to override.
Returns
A normalized adaptive cache-governor config object.
Remarks
Nested stability_thresholds values are defaulted individually so callers can override only the thresholds they need.
ComponentSpec function
Wrap adaptive config as a top-level component.
Produces the plugin component entry that can be inserted directly into plugin.defaultConfig().components.
Parameters
config: Adaptive component configuration document.options: Optional component-level flags.
Returns
A plugin component spec for the adaptive plugin.
Remarks
Setting options.enabled = false keeps the config in the plugin document for validation while skipping runtime activation.
validateConfig
Validate an adaptive config document without constructing a runtime.
buildCacheTelemetryEvent
Build one adaptive cache telemetry event from normalized usage.
setLatencySensitivity
Set manual latency sensitivity on the current scope.
Constants
ADAPTIVE_PLUGIN_KIND
Re-exports
ConfigDiagnosticConfigPolicyConfigReport