Retrieval
What is an embedding index?
An embedding index ranks nearest neighbors for a query and stays attached to the table that owns those rows.
Updated · Part of What is an embedding?
How it works
- You name the column and the embedding function.
- New and changed rows are embedded. Unchanged rows stay as they are.
- A similarity query orders rows by distance to the question.
What it is not
It is not a standalone vector database you load and sync yourself.
embedding index: this, and the thing it is confused with
| This | Not this | |
|---|---|---|
| Lives on | The table that holds the pieces | A second database you copy into |
| When rows change | Those rows are re-embedded | A sync job you operate |
| Query | Nearest rows of that table | Nearest vectors with no source row |
Where Pixeltable fits
Pixeltable declares it as __indexes__ = [pxt.EmbeddingIndex(...)] on the class. Insert updates the index for that row.
import pixeltable as pxtfrom pixeltable.functions.huggingface import sentence_transformerTableModel = pxt.model_base()text_embed = sentence_transformer.using(model_id='all-MiniLM-L6-v2')class Passages(TableModel, name='passages'):text: pxt.String__indexes__ = [pxt.EmbeddingIndex(text, string_embed=text_embed),]
Questions
- How does embedding index work?
- You name the column and the embedding function. New and changed rows are embedded. Unchanged rows stay as they are. A similarity query orders rows by distance to the question.
- What is embedding index often confused with?
- It is not a standalone vector database you load and sync yourself.