Vector Engines
🎓 Learn how it works with the Amazon S3 Vectors with Spice engineering blog post.
Data sourced by Data Connectors, or views built atop them with vector embedding columns can be indexed and efficiently searched using a vector engine.
A vector engine will store all vector embeddings associated with columns in a dataset/view, provide efficient vector search operations and avoid unnecessary recomputation of embeddings.
A vector engine is configured by setting the vectors configuration. E.g.
datasets:
- name: dataset_with_embeddings
vectors:
enabled: true
For the complete reference specification see datasets.
Supported Vector engines:
| Name | Description |
|---|---|
s3_vectors | AWS S3 vectors |
elasticsearch | Elasticsearch (Spice.ai Enterprise) |
Choosing an engine
The engines differ in where the index lives:
- External engines, for high-QPS serving where the index lives outside the Spice process and survives a restart of it. S3 Vectors stores vectors in S3 and pushes predicates on columns marked
metadata.vectors: filterableinto the index query. Elasticsearch keeps the kNN index in the cluster (and can combine it with full-text in that cluster). - No vector engine, when the dataset or view is accelerated with Spice Cayenne. Cayenne indexes embedding columns for
vector_searchitself, without avectorsblock. Its index is exact: it scores every candidate row, so query time grows with the rows searched.
The DuckDB vector engine (vectors.engine: duckdb) is removed in v2.5. See Migrating the DuckDB vector engine.
Add vector search only when semantic retrieval is required. Hybrid retrieval (rrf over vector_search and text_search) is for queries that need both semantic and literal matches. Otherwise stay on SQL, regex, or full-text search. See Where indexes are built.
- A dataset or view must be accelerated (i.e.
datasets[].acceleration.enabled: true, see docs) for a vector engine to be provided the appropriate data to ingest.
Vector Engine Docs
Amazon S3 Vectors
Amazon S3 Vectors Engine Documentation
Elasticsearch
Use Elasticsearch as a vector engine in Spice for kNN vector search, full-text search, and hybrid search.
DuckDB
The DuckDB vector engine is deprecated in v2.4 and removed in v2.5. Use a Spice Cayenne acceleration for vector search instead.
