Skip to main content

Function: embeddingToBlob()

embeddingToBlob(embedding): Buffer

Defined in: packages/agentos/src/rag/utils/vectorMath.ts:125

Serialize a number[] embedding to a compact Float32Array Buffer. ~50% smaller than JSON.stringify and avoids JSON.parse on read.

Parameters

embedding

number[]

The embedding vector.

Returns

Buffer

Buffer containing raw float32 bytes.