Expand description
Local embedding generation backed by fastembed.
fastembed wrapper and per-process embedding cache.
Owns the in-process TextEmbedding model and exposes batch encode/query
helpers used by remember, recall, and related commands.
Functionsยง
- controlled_
batch_ count - Returns the number of batches that
embed_passages_controlledwould produce for the giventoken_countsslice without running inference. - embed_
passage - Embeds a single passage using the
passage:prefix required by E5 models. - embed_
passages_ batch - Embeds multiple passages in a single ONNX batch call.
- embed_
passages_ controlled - Embeds passages grouped into token-budget-aware batches to avoid OOM on variable-length inputs.
- embed_
passages_ serial - Embed multiple passages one-by-one (serial ONNX inference).
- embed_
query - Embeds a search query using the
query:prefix required by E5 models. - f32_
to_ bytes - Convert
&[f32]to&[u8]for sqlite-vec storage. - get_
embedder - Returns the process-wide singleton embedder, initializing it on first call.
Subsequent calls return the cached instance regardless of
models_dir.