Skip to main content

Configuration

Embeddings are configured via options when opening the database:
Dimension and distance metric are immutable after creation.

Distance metrics

PutEmbedding

Store a vector embedding for a cell coordinate.
Dimension must match EmbeddingDimension. HNSW graph is maintained automatically.

GetEmbedding

Retrieve the vector embedding for a cell coordinate.

DeleteEmbedding

Remove an embedding. Idempotent.

SearchByEmbedding

HNSW-accelerated nearest-neighbor search with flat-scan fallback. Returns top-K results sorted by score.
Search config:
  • MaxResults — Maximum results to return (default 10)
  • MinScore — Minimum similarity threshold
Result:
  • Coord — Packed coordinate of the matching cell
  • Score — Similarity score

ReindexEmbeddings

Bulk recompute all embeddings via a user-supplied function. Intended for model changes.

Integration with query engine

CellQuery.Embedding and CellSearchConfig.Embedding trigger ANN-accelerated seed selection in QueryCells / SearchCells. Embedding similarity is added to the composite relevance score; all other predicates (tags, temporal, spatial) apply as post-filters.

Errors

Cascade behavior

DeleteCell cascades to remove the cell’s embedding and HNSW node automatically.

See also

  • Query — Query engine with embedding integration
  • Search — Content search with embeddings