Skip to main content

Module embedding

Module embedding 

Source
Expand description

Embedding generation for semantic search.

Provides embedding generation using fastembed (when available) or a hash-based fallback for deterministic pseudo-embeddings.

§Feature Flags

  • fastembed-embeddings: Enables FastEmbed with BGE-M3 (1024 dimensions, 8192 token max)
  • Without the feature: Uses hash-based fallback (deterministic but not semantic)

Structs§

FallbackEmbedder
Hash-based fallback embedder.
FastEmbedEmbedder
FastEmbed embedder using BGE-M3.

Constants§

DEFAULT_DIMENSIONS
Default embedding dimensions for the BGE-M3 model.

Traits§

Embedder
Trait for embedding generators.

Functions§

cosine_similarity
Computes cosine similarity between two embedding vectors.
create_embedder
Creates the default embedder based on available features.