Provider-agnostic embedding trait for polychrome.
This crate defines the [EmbeddingProvider] trait that every concrete
embedding backend implements. It is the embedding-side analogue of
polyc-llm's LlmProvider: a thin
seam so the tool-search layer can swap backends — pure-Rust static
embeddings (model2vec-rs) by default, a heavier transformer
(candle + EmbeddingGemma) when shallow matching isn't enough — without
touching its own code.
Tool retrieval is a shallow-semantic task over short strings (a query vs. tool name+description), so the default backend is intentionally tiny and fully deterministic: a fixed lookup table + mean pooling embeds bit-for-bit identically for a pinned model across hardware, which lines up with the reproducible prompt-hash discipline elsewhere in the system.
Modules
- [
error] — the [EmbeddingError] bound that [EmbeddingProvider::Error] must satisfy. - [
erased] — type erasure to a single [DynEmbeddingProvider] trait object, mirroringpolyc-llm'serasedmodule.