Skip to main content

embedder_from_env

Function embedder_from_env 

Source
pub fn embedder_from_env() -> Arc<dyn EmbeddingProvider>
Expand description

Build an embedding provider from the SOCHDB_EMBEDDER environment variable.

Accepted values:

  • fastembed:<model> — real semantic embeddings (requires the fastembed feature; e.g. fastembed:bge-small-en).
  • mock / hash / unset — deterministic MockEmbeddingProvider (384-d).

When SOCHDB_EMBEDDER=fastembed:... is set but cannot be honored (binary built without the feature, or the model fails to load), this PANICS at startup rather than silently falling back to the non-semantic mock embedder — a silent fallback corrupts retrieval quality without any error. An unset or mock/hash spec uses the mock provider normally.