Skip to main content
Open in Kaggle  Open in Colab  Download Notebook
This documentation page is also available as an interactive notebook. You can launch the notebook in Kaggle or Colab, or download it for use with an IDE or local Jupyter installation, by clicking one of the above links.
Create a searchable knowledge base that finds content by meaning, not just keywords.

Problem

You have a collection of text content (articles, notes, documentation) and need to find relevant items based on meaning. Keyword search fails when users phrase queries differently from the source text:

Solution

What’s in this recipe:
  • Create a text table with embeddings
  • Search by semantic similarity
  • Combine with metadata filters
You add an embedding index to your text column. Pixeltable automatically generates embeddings for each row and enables similarity search.

Setup

Create knowledge base

Connected to Pixeltable database at: postgresql+psycopg://postgres:@/pixeltable?host=/Users/pjlb/.pixeltable/pgdata
Created directory ‘search_demo’.
<pixeltable.catalog.dir.Dir at 0x14208ca10>
Created table ‘articles’.
Inserting rows into `articles`: 4 rows [00:00, 577.69 rows/s]
Inserted 4 rows with 0 errors.
4 rows inserted, 12 values computed.
Create an embedding index on the content column:

Search by meaning

Find content semantically similar to your query:

Filter by metadata

Combine semantic search with metadata filters:

Explanation

How similarity search works:
  1. Your query is converted to an embedding vector
  2. Pixeltable finds the most similar vectors in the index
  3. Results are ranked by cosine similarity (0 to 1)
Embedding models:
New content is indexed automatically: When you insert new rows, embeddings are generated without extra code.

See also

Last modified on June 24, 2026