Skip to main content
StarTree Semantic Search lets users issue text-only SQL predicates such as SEMANTIC_MATCH(body, 'usb-c dock', 20). StarTree resolves the text column to an embedding profile, embeds the query text, rewrites the query to Pinot vector search on a hidden embedding column, and runs the rewritten query against Pinot.
This page covers the operator-facing configuration path. Users who query the table only need the SQL syntax and the columns that are enabled for semantic search.

How It Works

Users do not reference embedding columns, model IDs, providers, or credentials in SQL. Those details are configured through semantic profiles and bindings.

When to Use

Use Semantic Search when:
  • Users search by natural language rather than exact keywords.
  • You want embeddings managed behind a familiar SQL predicate.
  • You need metadata filters, such as tenant, category, or region, to combine with semantic similarity.
  • You can maintain a projection table that stores embeddings and mirrored filter columns.
Use direct vector search when users already provide embedding vectors or when you need full control over the vector-search SQL shape.

Components

Configure Profiles

A profile hides provider, model, dimensions, distance function, and credentials.
Supported provider types include:

Configure Bindings

A binding maps a source table and text column to the projection table and profile.
The mirrored filter columns let Pinot apply structured predicates before or during vector search. Mirror columns that are common in WHERE clauses, such as tenant, workspace, category, language, or region.

Enable the Query Rewriter

Add the semantic query rewriter to the broker query rewriter chain:
Keep existing rewriters in the chain. Append the semantic rewriter in the same broker configuration used by the tenant that serves semantic queries.

Credential References

Credential references can point to environment variables, direct config, or a secret manager integration.
Do not store provider API keys directly in table configs or query text. Prefer environment variables, mounted secrets, or StarTree-supported secret manager references.

Create a Projection Table

The projection table stores embeddings and mirrored filter columns. It is separate from the user-facing source table. Example schema:
Add a vector index to the embedding column in the projection table config:
Match the projection table’s vector dimensions and distance function to the profile.

Query Syntax

With Metadata Filters

Rewritten Query Shape

The broker rewrites the semantic predicate to a vector predicate against the projection table:
In this example, 60 comes from topK=20 multiplied by topKOversampleFactor=3.0.

Realtime Embedding Pipeline

Realtime ingestion does not block on embedding. The expected flow is:
  1. Raw rows ingest immediately into the source table.
  2. The embedding scheduler queues work for semantic columns.
  3. Embedding workers batch calls to the configured provider.
  4. Embeddings are published to the projection table.
  5. Retryable failures use backoff.
  6. Permanent failures move to a dead-letter or failed state for inspection.
Embedding jobs use status values such as: To avoid stale writes, embedding results include the source text hash and source version. If the source row changed after the embedding job started, the stale result is discarded.

Backfill and Re-Embedding

Use EmbeddingBackfillTask for:
  • Source rows that do not yet have embeddings.
  • Rows whose text changed.
  • Rows embedded with an older profile version.
  • Re-embedding after changing providers, models, dimensions, or distance function.
Example task config:
Schedule backfill through the standard minion task workflow after the projection table and binding exist.

Local Model Settings

For local providers such as TEI, vLLM, Ollama, and ONNX, configure a cache directory and model allowlist.
Use revision-pinned models for reproducible embeddings.

Failure Modes

Choose failure behavior based on whether semantic recall is required for correctness or is an optional ranking/filtering enhancement.

Observability

Track the embedding service and pipeline with metrics such as:

Security Notes

  • SQL queries reference only source columns and text; they do not expose provider credentials.
  • Credentials should be resolved from environment variables or a secret manager.
  • Keep model allowlists tight for local runtimes.
  • Avoid returning raw embedding vectors to end users unless your application explicitly needs them.

Troubleshooting