Skip to Content
Anuma SDKReactInternalInterfacesCreateAutoExtractorOptions

CreateAutoExtractorOptions

Defined in: src/lib/memory/autoExtractWorker.ts:176 

Properties

consolidate?

optional consolidate: object

Defined in: src/lib/memory/autoExtractWorker.ts:238 

Enable the LLM-based consolidation pass (Hindsight facet-dedup) on every retain() write. Auth is NOT configured here — the consolidation call reuses the extract options’ credentials (apiKey / getToken) and defaults to its baseUrl unless overridden below. Absent → identical behavior to today: retain() runs the strict cosine-only auto-merge with no consolidation LLM calls.

baseUrl?

optional baseUrl: string

Portal base URL for consolidation calls. Default: the extract options’ baseUrl.

endpointOverride?

optional endpointOverride: string

model?

optional model: string

Override the consolidation model. Default: see consolidate.ts.

onFallback()?

optional onFallback: (reason: ConsolidationFallbackReason) => void

Notified on each degraded create-fallback (LLM failure or schema-violating response). See RetainOptions.consolidateOptions.onFallback.

Parameters

ParameterType

reason

ConsolidationFallbackReason

Returns

void


cursorStore?

optional cursorStore: ExtractionCursorStore

Defined in: src/lib/memory/autoExtractWorker.ts:218 

Durable per-conversation watermark store. When provided, the watermark is hydrated from it the first time each conversation is touched and written through on every advance, so extraction resumes exactly after the last extracted message across process restarts (and, with a process-shared store, across concurrent sessions). Build via createPlatformCursorStore. Omit for in-memory-only (legacy) behavior.


entityCtx?

optional entityCtx: EntityOperationsContext

Defined in: src/lib/memory/autoExtractWorker.ts:225 

Entity / memory_entity write context — when provided, each retained candidate’s entities[] is persisted via linkMemoryEntitiesOp, populating the W5 graph retrieval lane. Without this the lane stays empty and recall’s graph fusion is a no-op.


extract

extract: ExtractFactsOptions

Defined in: src/lib/memory/autoExtractWorker.ts:182 


folderId?

optional folderId: string | null

Defined in: src/lib/memory/autoExtractWorker.ts:229 

Override folderId for all retained facts.


injectionClassifier?

optional injectionClassifier: object

Defined in: src/lib/memory/autoExtractWorker.ts:259 

Tier-0 security (PR5) — enable the optional SECOND-layer LLM injection classifier over the candidates the deterministic screen passed as clean. Presence is the switch, so injectionClassifier: {} is how a client turns it on. Auth is NOT configured here — like consolidate, the call reuses the extract credentials and defaults to its baseUrl. See injectionClassifier.ts for the safety posture and the defaults.

baseUrl?

optional baseUrl: string

Portal base URL for classifier calls. Default: the extract options’ baseUrl.

maxCandidates?

optional maxCandidates: number

model?

optional model: string

totalTimeoutMs?

optional totalTimeoutMs: number


maxTrackedConversations?

optional maxTrackedConversations: number

Defined in: src/lib/memory/autoExtractWorker.ts:209 

Cap on the number of conversations whose extraction state (watermark + coalescing queue) is held in memory. When exceeded, the oldest entry with no queued turn is evicted — its conversation simply re-extracts from a trailing window next time (self-healing). The worker is session-scoped, so the default is generous; lower it for very long-lived, many-conversation sessions in RAM-constrained hosts. Default 200.


maxWindowSize?

optional maxWindowSize: number

Defined in: src/lib/memory/autoExtractWorker.ts:200 

Upper bound on the widened (post-watermark) window. Under an extreme burst — more un-extracted messages accumulate than this cap while an extraction is stuck — the window is truncated to the most recent maxWindowSize messages and a warning is logged. Bounds extraction LLM cost/latency. Default 20. Coerced to be ≥ windowSize.


memoryStore?

optional memoryStore: MemoryStore | null

Defined in: src/lib/memory/autoExtractWorker.ts:179 

Route retained facts and topics through this store; null disables memory writes.


minConfidence?

optional minConfidence: number

Defined in: src/lib/memory/autoExtractWorker.ts:184 

Confidence floor for retained facts. Default 0.7.


onCandidateFailed()?

optional onCandidateFailed: (event: object) => void

Defined in: src/lib/memory/autoExtractWorker.ts:286 

Per-candidate retain() failure. Lets UI layers (“Anuma is saving … — couldn’t save Lives in Portland”) surface the specific fact that dropped instead of only seeing the aggregate failedCount. Fires once per filtered candidate that threw during retain.

Parameters

ParameterType

event

object

event.candidate

ExtractedCandidate

event.conversationId?

string

event.error

unknown

Returns

void


onError()?

optional onError: (error: Error, conversationId?: string) => void

Defined in: src/lib/memory/autoExtractWorker.ts:279 

Diagnostic — fires on unexpected pipeline errors.

Parameters

ParameterType

error

Error

conversationId?

string

Returns

void


onMemoryExtracted()?

optional onMemoryExtracted: (event: MemoryExtractedEvent) => void

Defined in: src/lib/memory/autoExtractWorker.ts:267 

Per-fact event — fires once per memory written.

Parameters

ParameterType

event

MemoryExtractedEvent

Returns

void


onMemoryQuarantined()?

optional onMemoryQuarantined: (event: MemoryQuarantinedEvent) => void

Defined in: src/lib/memory/autoExtractWorker.ts:273 

Tier-0 security (PR3) — fires once per candidate quarantined by the injection screen (and persisted as an audit row). Lets a client surface a “held for review” state instead of the fact silently disappearing.

Parameters

ParameterType

event

MemoryQuarantinedEvent

Returns

void


onSkipped()?

optional onSkipped: (event: TurnSkippedEvent) => void

Defined in: src/lib/memory/autoExtractWorker.ts:277 

Diagnostic — fires when a turn is skipped.

Parameters

ParameterType

event

TurnSkippedEvent

Returns

void


onTurnComplete()?

optional onTurnComplete: (event: TurnCompleteEvent) => void

Defined in: src/lib/memory/autoExtractWorker.ts:275 

Per-turn event — fires once after the whole pipeline finishes.

Parameters

ParameterType

event

TurnCompleteEvent

Returns

void


retainCtx

retainCtx: RetainContext

Defined in: src/lib/memory/autoExtractWorker.ts:177 


scope?

optional scope: string

Defined in: src/lib/memory/autoExtractWorker.ts:227 

Override scope for all retained facts.


signal?

optional signal: AbortSignal

Defined in: src/lib/memory/autoExtractWorker.ts:181 

Cancel remote writes for an extraction batch.


windowSize?

optional windowSize: number

Defined in: src/lib/memory/autoExtractWorker.ts:192 

Trailing-window size used when there is no watermark yet for a conversation (the first extraction, or after the watermark scrolled out of the provided history): the extractor receives the last windowSize messages. Default 6. Once a watermark exists, the window is computed from it (everything since the watermark) rather than this fixed slice.

Last updated on