Skip to Content

retain

retain(content: string, ctx: RetainContext, options: RetainOptions): Promise<RetainResult>

Defined in: src/lib/memory/retain.ts:51 

Persist a memory, merging into the nearest existing record if its cosine similarity exceeds the auto-merge threshold.

Default behavior (autoMerge ON): proof_count increments on the merged target, source_chunk_ids accumulate (union), content is left untouched. The caller doesn’t see a duplicate and the original memory’s UI badge shows it has been re-observed.

Pass enableAutoMerge: false for a force-create (W2 resolver path after it has explicitly decided “create new”).

Parameters

ParameterType

content

string

ctx

RetainContext

options

RetainOptions

Returns

Promise<RetainResult>

Last updated on