Adaptive Helpers
Generated from crates/node/dist/adaptive.d.ts.
Import from nemo-relay-node/adaptive.
Adaptive plugin configuration helpers.
Interfaces
BackendSpec
Adaptive state backend.
StateConfig
Adaptive state configuration.
TelemetryConfig
Adaptive telemetry settings.
AdaptiveHintsConfig
Adaptive hints injection settings.
ToolParallelismConfig
Adaptive tool scheduling settings.
AcgStabilityThresholds
Prompt-stability thresholds for the cache governor.
AcgConfig
Cache governor settings.
Config
Adaptive component config.
ComponentSpec interface
Adaptive component with kind adaptive.
Classes
AdaptiveRuntime
Adaptive runtime owned by the caller.
Functions
defaultConfig
Creates a default adaptive config.
The config has version 1 and no sections. Add state, telemetry, and scheduler sections to it.
Returns
An adaptive config with no sections.
Remarks
The config does nothing until it is wrapped with ComponentSpec and activated.
inMemoryBackend
Creates a backend spec that keeps adaptive state in process memory.
The state is private to the process and is lost when it exits.
Returns
A backend spec with kind in_memory.
Remarks
Use redisBackend when several processes must share state.
redisBackend
Creates a backend spec that keeps adaptive state in Redis.
Processes that use the same Redis instance and key prefix share the state.
Parameters
url: Redis connection URL.keyPrefix: Prefix for every key the backend writes.
Returns
A backend spec with kind redis.
Remarks
keyPrefix defaults to nemo_relay:.
telemetryConfig
Creates adaptive telemetry settings.
Fields in config replace the defaults; fields left out keep them.
Parameters
config: Telemetry settings to set.
Returns
Complete telemetry settings.
Remarks
learners defaults to an empty list.
adaptiveHintsConfig
Creates adaptive hint-injection settings.
Fields in config replace the defaults; fields left out keep them.
Parameters
config: Hint-injection settings to set.
Returns
Complete hint-injection settings.
Remarks
By default the injector runs at priority 100, lets the chain continue, and writes hints to nvext.agent_hints.
toolParallelismConfig
Creates adaptive tool-scheduling settings.
Fields in config replace the defaults; fields left out keep them.
Parameters
config: Tool-scheduling settings to set.
Returns
Complete tool-scheduling settings.
Remarks
The default mode observe_only records recommendations and leaves execution unchanged.
acgConfig
Creates adaptive cache governor settings.
Fields in config replace the defaults; fields left out keep them.
Parameters
config: Cache governor settings to set.
Returns
Complete cache governor settings.
Remarks
Thresholds in stability_thresholds default one by one, so one threshold can be set without the others.
ComponentSpec function
Wraps an adaptive config as a plugin component.
The result is an entry for PluginConfig.components.
Parameters
config: Adaptive config.options:enabledcontrols whether the component activates.
Returns
A component entry with kind adaptive.
Remarks
With enabled false, initialize validates the component but does not activate it.
validateConfig
Validates adaptive config without creating a runtime.
buildCacheTelemetryEvent
Builds one cache telemetry event from token usage.
setLatencySensitivity
Sets latency sensitivity on the current scope.
Type Aliases
AdaptivePluginConfig
Constants
ADAPTIVE_PLUGIN_KIND
Re-exports
AgentIdentityCacheRequestFactsCacheRequestFactsOptionsCacheTelemetryEventCacheTelemetryEventOptionsCacheUsageCacheWriteTokenCountsConfigDiagnosticConfigPolicyConfigReport