Skip to main content

Embeddable

Trait Embeddable 

Source
pub trait Embeddable: Send + Sync {
    // Required methods
    fn key(&self) -> &str;
    fn content_hash(&self) -> String;
    fn embed_text(&self) -> &str;
    fn to_payload(&self) -> Value;
}
Expand description

Domain type that can be stored in an EmbeddingRegistry.

Implement this trait for any struct that should be embedded and persisted in Qdrant. The registry uses key and content_hash to detect which items need to be re-embedded on each EmbeddingRegistry::sync call.

Required Methods§

Source

fn key(&self) -> &str

Unique string key used for point-ID generation and delta tracking.

Source

fn content_hash(&self) -> String

BLAKE3 hex hash of all semantically relevant fields.

When this hash changes between syncs the item’s embedding is recomputed.

Source

fn embed_text(&self) -> &str

Text that will be passed to the embedding model.

Source

fn to_payload(&self) -> Value

Full JSON payload to store in Qdrant alongside the vector.

Must include a "key" field equal to Self::key() so EmbeddingRegistry can recover items on scroll.

Implementors§