Skip to Content

searchChunksOp

searchChunksOp(ctx: StorageOperationsContext, queryVector: number[], options?: object): Promise<ChunkSearchResult[]>

Defined in: src/lib/db/chat/operations.ts:2051 

Search through message chunks for fine-grained semantic search. Returns the matching chunk text along with the parent message.

Parameters

ParameterTypeDescription

ctx

StorageOperationsContext

‐

queryVector

number[]

‐

options?

object

‐

options.chunkCache?

ChunkVectorCache

Decrypted-vector cache, validated by updated_at.

options.conversationId?

string

‐

options.embeddingModel?

string

Current embedding model; messages stored under a different non-null model are skipped.

options.excludeConversationId?

string

Skip every message in this conversation before scoring.

options.limit?

number

‐

options.minSimilarity?

number

‐

options.onStats?

(stats: ChunkSearchStats) => void

Receives row counts for the call.

Returns

Promise<ChunkSearchResult[]>

Last updated on