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
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.
Components
Configure Profiles
A profile hides provider, model, dimensions, distance function, and credentials.Configure Bindings
A binding maps a source table and text column to the projection table and profile.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:Credential References
Credential references can point to environment variables, direct config, or a secret manager integration.Create a Projection Table
The projection table stores embeddings and mirrored filter columns. It is separate from the user-facing source table. Example schema:Query Syntax
Basic Semantic Search
With Metadata Filters
Rewritten Query Shape
The broker rewrites the semantic predicate to a vector predicate against the projection table:60 comes from topK=20 multiplied by topKOversampleFactor=3.0.
Realtime Embedding Pipeline
Realtime ingestion does not block on embedding. The expected flow is:- Raw rows ingest immediately into the source table.
- The embedding scheduler queues work for semantic columns.
- Embedding workers batch calls to the configured provider.
- Embeddings are published to the projection table.
- Retryable failures use backoff.
- Permanent failures move to a dead-letter or failed state for inspection.
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
UseEmbeddingBackfillTask 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.
Local Model Settings
For local providers such as TEI, vLLM, Ollama, and ONNX, configure a cache directory and model allowlist.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.

