Build semantic search for text

Create a searchable knowledge base that finds content by meaning, not just keywords.

Search & Embeddings · Notebook · Updated

Colab runs it in your browser. If it calls a model provider, it asks for that provider's API key in a cell.

How it works

You add an embedding index to your text column. Pixeltable automatically generates embeddings for each row and enables similarity search.

What it covers

  • Create a text table with embeddings
  • Search by semantic similarity
  • Combine with metadata filters

What it uses

Install
terminal
pip install pixeltable sentence-transformers
Pixeltable calls
pxt.create_table()insert()add_embedding_index()similarity()

A look at the code

search-semantic-text.ipynb
# Add embedding index
kb.add_embedding_index(
column='content',
string_embed=sentence_transformer.using(model_id='all-MiniLM-L6-v2'),
)

One cell of the notebook, copied as it is. Open it in Colab for the rest.

Browse all 103