Skip to main content

Module embedder

Module embedder 

Source
Expand description

Embedder trait + reference implementations.

The Embedder trait abstracts over local (fastembed/ONNX) and cloud (OpenAI/Voyage) embedding backends. The SqliteMemoryProvider takes a Box<dyn Embedder> at construction and uses it for write-time embedding and retrieval-time query embedding.

v1 ships two implementations:

  • MockEmbedder — deterministic small-dim vectors for tests. No external dependencies; always available.
  • FastEmbedEmbedder — real bge-small-en-v1.5 model (384 dim) via the fastembed crate. Gated behind the fastembed feature because the model file downloads on first instantiation (~130 MB) and onnxruntime is a heavy dep.

Structs§

MockEmbedder
Deterministic test embedder. Hashes the input text to a small vector of pseudo-random floats. Never use in production — produces meaningless vectors.

Traits§

Embedder
An embedder turns text into a fixed-dimension vector.

Type Aliases§

EmbedResult
Embedding result alias.