Skip to Content

embedAllMessages

embedAllMessages(ctx: StorageOperationsContext, options: MemoryEngineEmbeddingOptions, filter?: object): Promise<number>

Defined in: src/lib/memoryEngine/embeddings.ts:128 

Embed all messages without embeddings in the database

Parameters

ParameterTypeDescription

ctx

StorageOperationsContext

Storage operations context

options

MemoryEngineEmbeddingOptions

Embedding options

filter?

object

Optional filter for which messages to embed

filter.conversationId?

string

Only embed messages from this conversation

filter.minContentLength?

number

Minimum content length to embed (default: 30). Shorter messages are skipped.

filter.reembedDiscarded?

boolean

Re-index rows the ciphertext sweep marked CHUNKS_DISCARDED_ORIGIN. Off by default: this spends the user’s own embedding credits, so it belongs to an explicit user action, never to a background pass. Opens that marker only — tool_result rows stay excluded.

A successful repair clears the marker. Later model migrations include the repaired row without this flag. See CHUNKS_DISCARDED_ORIGIN.

filter.roles?

("user" | "assistant")[]

Only embed messages with these roles

Returns

Promise<number>

Number of messages embedded

Last updated on