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.
Extended by
Section titled “Extended by”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ExtractionTrigger(): ExtractionTrigger;Returns
Section titled “Returns”ExtractionTrigger
Properties
Section titled “Properties”abstract readonly name: string;Defined in: src/memory/extraction/types.ts:103
Stable identifier for this trigger kind, used in logging.
Methods
Section titled “Methods”attach()
Section titled “attach()”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.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
context | ExtractionTriggerContext | The agent to attach to and the fire callback bound to this trigger’s store |
Returns
Section titled “Returns”void