Vettore-backed semantic index and embedding acquisition for the learned cache.
Builds and caches per-content collections from embeddings already stored on
rows, runs threshold-gated vector search, and resolves embeddings for new
online rows through the configured adapter. The index cache table name is
the Learned module itself, preserved as an operational contract.
Summary
Functions
Drops the cached collections of one agent, raising if the owner is down.
Embeds text through the configured embedding adapter.
Searches the cached collection for rows semantically close to the text.
Resolves the embedding stored with a learn result, reusing or embedding.
Warms the index for rows that already store embeddings.
Functions
@spec clear(module()) :: :ok
Drops the cached collections of one agent, raising if the owner is down.
Embeds text through the configured embedding adapter.
@spec search(String.t(), [Spectre.Router.SemanticCache.Learned.row()], keyword()) :: {:ok, map(), map()} | {:error, term(), map()}
Searches the cached collection for rows semantically close to the text.
@spec stored_embedding( String.t(), map(), Spectre.Router.SemanticCache.Learned.row() | nil, keyword() ) :: {:ok, [float()] | nil} | {:error, term()}
Resolves the embedding stored with a learn result, reusing or embedding.
@spec warm( [Spectre.Router.SemanticCache.Learned.row()], keyword() ) :: {:ok, non_neg_integer()} | {:error, term()}
Warms the index for rows that already store embeddings.