Behaviour for embedding providers.
Implement this behaviour to use any embedding provider with the memory system. If no embedding provider is configured, the memory system falls back to keyword-only search.
Summary
Functions
Get the embedding dimension for a provider.
Embed a single text using the given provider module and options. Returns {:ok, embedding} or {:error, reason}.
Embed a batch of texts. Falls back to sequential embed/2 calls if embed_batch/2 is not implemented.
Callbacks
Functions
@spec dimension(module()) :: pos_integer()
Get the embedding dimension for a provider.
Embed a single text using the given provider module and options. Returns {:ok, embedding} or {:error, reason}.
Embed a batch of texts. Falls back to sequential embed/2 calls if embed_batch/2 is not implemented.