Skip to content

ExtractionTrigger

Defined in: src/memory/extraction/types.ts:101

Controls when a store’s ExtractionConfig runs.

A trigger is a self-attaching value object: attach wires whatever agent hooks the trigger needs and calls ExtractionTriggerContext.fire when extraction should happen. Extend this class for custom triggering logic.

A trigger must eventually fire for its store’s buffered messages to be written: the high-water-mark dedup means skipped turns are still picked up on the next fire, but a trigger that never fires never extracts (and its messages stay buffered for the session). For a guaranteed final write at a boundary, the caller uses MemoryManager.flush, which force-completes regardless of triggers.

new ExtractionTrigger(): ExtractionTrigger;

ExtractionTrigger

abstract readonly name: string;

Defined in: src/memory/extraction/types.ts:103

Stable identifier for this trigger kind, used in logging.

abstract attach(context): void;

Defined in: src/memory/extraction/types.ts:113

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