Skip to content

IntervalTrigger

Defined in: src/memory/extraction/triggers.ts:45

Runs extraction every N agent invocations.

A controllable middle ground: extraction (and any model call it entails) happens on a cadence rather than every turn, while the high-water mark guarantees the messages from the skipped turns are still processed when the trigger does fire.

extraction: { trigger: [new IntervalTrigger({ turns: 5 })] }
new IntervalTrigger(options): IntervalTrigger;

Defined in: src/memory/extraction/triggers.ts:49

ParameterType
optionsIntervalTriggerOptions

IntervalTrigger

ExtractionTrigger.constructor

readonly name: "interval" = 'interval';

Defined in: src/memory/extraction/triggers.ts:46

Stable identifier for this trigger kind, used in logging.

ExtractionTrigger.name

attach(context): void;

Defined in: src/memory/extraction/triggers.ts:57

Wire this trigger into the agent lifecycle.

Called once per store during MemoryManager initialization. Register hooks on context.agent and call context.fire() when extraction should run.

ParameterTypeDescription
contextExtractionTriggerContextThe agent to attach to and the fire callback bound to this trigger’s store

void

ExtractionTrigger.attach