Skip to Content
SdkReactInternalFunctionschunkAndEmbedMessage

chunkAndEmbedMessage

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

Defined in: src/lib/memoryRetrieval/embeddings.ts:269 

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

MemoryRetrievalEmbeddingOptions & ChunkingOptions

Embedding and chunking options

Returns

Promise<StoredMessage | null>

The updated message, or null if message not found

Last updated on