---
title: "Embedding Indices"
description: "Create an embedding index, query it with similarity search and keep it current as data changes. Covers several indexes on one column, custom embedding UDFs and precomputed embeddings."
url: "https://www.pixeltable.com/notebooks/embedding-indexes"
updated: "2026-09-22"
---

# Embedding Indices

Create an embedding index, query it with similarity search and keep it current as data changes. Covers several indexes on one column, custom embedding UDFs and precomputed embeddings.

- **Type:** Notebook
- **Group:** Tutorials

## What it covers

- Creating an index
- Using the index in queries
- Index updates
- Similarity search on different types
- Creating multiple indexes on a single column
- Using a UDF for a custom embedding
- Indexing precomputed embeddings (Array columns)
- Deleting an index

## What it uses

- **Install:** `pip install pixeltable transformers sentence-transformers tensorflow tensorflow-hub tensorflow-text 'setuptools<82'`
- **Pixeltable calls:** `pxt.create_table()`, `@pxt.udf`, `insert()`, `add_embedding_index()`, `similarity()`

## A look at the code

```python
import PIL.Image
from pixeltable.functions.huggingface import clip

# create embedding index on the 'img' column
imgs.add_embedding_index(
    'img', embedding=clip.using(model_id='openai/clip-vit-base-patch32')
)
```

## Open it

- **Open in Colab:** https://colab.research.google.com/github/pixeltable/pixeltable/blob/release/docs/release/platform/embedding-indexes.ipynb
- **Docs page:** https://docs.pixeltable.com/platform/embedding-indexes
- **Source on GitHub:** https://github.com/pixeltable/pixeltable/blob/release/docs/release/platform/embedding-indexes.ipynb
