Skip to Content

chunkAndEmbedMessage

chunkAndEmbedMessage(ctx: StorageOperationsContext, messageId: string, options: MemoryEngineEmbeddingOptions & ChunkingOptions): Promise<StoredMessage | null>

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

Chunk and embed a single message, storing chunk embeddings in the database. For messages shorter than chunkSize, falls back to whole-message embedding.

Parameters

ParameterTypeDescription

ctx

StorageOperationsContext

Storage operations context

messageId

string

Unique ID of the message to chunk and embed

options

MemoryEngineEmbeddingOptions & ChunkingOptions

Embedding and chunking options

Returns

Promise<StoredMessage | null>

The updated message, or null if message not found

Last updated on