Search by meaning
Find rows in a warehouse table by what their text means, narrow them with filter conditions, and read each similarity score.
This page explains how to search one warehouse table by meaning with Balto, the API, or MCP. Ask what the text says, even when you don't know the exact words. Search works in chat, Background Agents, the API, and MCP. For the closest rows in each group, joins, or several texts in one query, see Rank by meaning in SQL.
The search compares your question with vectors that the table already stores, and returns the closest rows, best first.
Before you begin
- Make sure that the table is a Snowflake table that a deployed source model or SQL model describes.
- Make sure that the table has a searchable vector column. For more information, see Make a column searchable.
- Make sure that you have read access to the Project. Anyone with read access can search every searchable table in the Project.
Make a column searchable
A column is searchable when the deployed Blueprint declares all of the following facts about it:
The following schema declares a searchable text_embedding column:
schema:
columns:
- name: text
type: string
- name: text_embedding
type: VECTOR
dimension: 1024
embedded_from:
column: text
provider: <provider>
model: <model>The question and the stored vectors must come from the same model. The provider, model, and vector length must match exactly. A column that your own embedding step made with that provider, model, and length is searchable too.
Bobsled AI refuses any other column and names the model that made it. It also refuses a column with no embedded_from.
get_blueprint_models and query context show embedding.searchable for each vector column. When the value is false, unsearchableReason gives the reason.
Search with Balto
In a chat, name the subject, the table if you know it, and the limits, as in the following example:
In the 2025 filings, find what banks say about losses on office loans. Quote the text.
Balto sends filter conditions with the search. The filters remove rows before the ranking starts. Balto uses SQL, not search, for counts, totals, dates, and exact matches.
Use the API
Send POST /api/v1/projects/:projectId/semantic-search. The caller needs data:read on the Project. The request body has the following fields:
The following request returns the five passages from 2025 that are closest to the question:
{
"table": "filing_passages",
"question": "losses on office loans",
"vectorColumns": [{ "column": "text_embedding" }],
"filter": [{ "column": "fiscal_year", "operator": "equals", "value": 2025 }],
"columns": ["fiscal_year", "text"],
"topK": 5
}For MCP, call data_query with action: "search". For more information, see MCP workflows.
Filter the rows
filter is a list. Every item must be true for a row to stay. An item is one condition, or a group of 2 to 10 conditions in any, of which one must be true.
The following filter keeps rows filed in 2025 that have a matching topic or title:
[
{ "column": "filed_on", "operator": "between", "values": ["2025-01-01", "2025-12-31"] },
{
"any": [
{ "column": "topic", "operator": "in", "values": ["credit", "capital"] },
{ "column": "title", "operator": "contains", "value": "office loans" }
]
}
]The following table lists the operators:
The type of the warehouse column decides how Bobsled AI reads a value:
A filter has the following limits:
- A number,
true, orfalsecan also be sent as text. - One value holds up to 2,000 characters.
- A filter holds up to 2,000 values and 60,000 characters in total.
- Other column types, such as semi-structured, array, and vector columns, can't be filtered.
A condition can't compare two columns, use an expression on a column, or read a path inside semi-structured data. For a join or the closest rows in each group, use SQL that ranks by meaning. For the other cases, and for a pattern, run a query first. Then search with in on the identifiers that the query returned.
Filter values and the question vector go to Snowflake as bound values, outside the SQL text.
Snowflake lets readers of its query history see bound values unless the account turns that off with ALLOW_BIND_VALUES_ACCESS. The setting is on by default.
Read the result
The response has the following fields:
The similarity runs from 0 to 1. It ranks the rows of one search. It isn't a probability, and scores from two searches don't compare. Low scores can mean that the table holds nothing that matches the question. The model can return slightly different numbers for the same question, so a score can change in its fifth decimal place.
With several vector columns, the similarity is the weighted sum of the column similarities. The weights always add up to 1. Bobsled AI drops a row that has no value in a searched column, or that stores a vector of zeros.
You can't export a search result, refresh it, or use it in an Artifact. To read the same rows, use SQL with their identifiers.
Rank by meaning in SQL
A search returns one list from one table. For other result shapes, Balto writes SQL that ranks by meaning. Use it for the following:
- The closest rows in each group, such as the 3 closest tickets in each region.
- A join over several tables.
- Several different texts in one query.
- A score that combines the similarity with other columns.
The SQL holds a placeholder, {{embedding:name}}, where the vector of a text belongs. Balto sends each text and its name with the SQL. Bobsled AI turns each text into a vector, binds the vector in place of each placeholder, and then runs the query. On Snowflake, the similarity is VECTOR_COSINE_SIMILARITY(column, {{embedding:name}}).
For example, a user asks for the 3 closest support tickets in each region. The text is "customer asks for money back after a late delivery". Balto writes SQL similar to the following:
SELECT region, ticket_id, subject,
VECTOR_COSINE_SIMILARITY(body_embedding, {{embedding:refund}}) AS similarity
FROM ANALYTICS.SUPPORT.TICKETS
QUALIFY ROW_NUMBER() OVER (PARTITION BY region ORDER BY similarity DESC) <= 3To run the same query through the API, send the following body to POST /api/v1/projects/:projectId/semantic-sql:
{
"sql": "SELECT region, ticket_id, subject, VECTOR_COSINE_SIMILARITY(body_embedding, {{embedding:refund}}) AS similarity FROM ANALYTICS.SUPPORT.TICKETS QUALIFY ROW_NUMBER() OVER (PARTITION BY region ORDER BY similarity DESC) <= 3",
"embeddings": [
{ "name": "refund", "text": "customer asks for money back after a late delivery" }
]
}The caller needs data:read on the Project. In MCP, call data_query with action: "semantic_sql". In chat and Background Agents, Balto uses the semantic_sql tool.
The following table describes the request fields:
Follow these rules when you write the SQL:
- Write a placeholder only as a direct argument of
VECTOR_COSINE_SIMILARITY. Bobsled AI refuses a placeholder that is selected, cast, passed to another function, or written in a string, a quoted name, or a comment. - Give every placeholder an entry in
embeddings, and use every entry. A name can appear more than once. - Start each name with a letter. A name holds up to 32 letters, digits, and underscores.
- Don't write bind markers such as
?or:1. - Name each table by the full address of a deployed model, such as
ANALYTICS.SUPPORT.TICKETS. Bobsled AI refuses other warehouse tables. It refuses a shorter name of a model and returns the full address. - Read at most 20 models in one query.
- When two connections hold a model at the same address, pass
connectionId. - Follow the same checks as for a query: one read-only statement on tables of the Project.
- Give every selected column its own name.
- Select the text column, not the vector column. Filter and limit the rows in the SQL.
Read the similarity as in a search. It ranks rows and isn't a probability. To compare rows whose vectors are both stored, such as rows compared with each other, use a plain query. No text needs a vector in that case.
Which vectors can be compared
The SQL doesn't say which column each placeholder meets, so Bobsled AI checks every table that the query reads:
- Each table is a deployed model stored in Snowflake, named by its full address. Bobsled AI refuses live models.
- Every vector column that the model declares is searchable, as described in Make a column searchable.
- At least one such column exists, and all of them come from one managed embedding model.
- The warehouse table holds no vector column that the model doesn't declare.
If a check fails, Bobsled AI refuses the query and names the model and column. The checks cover stored vector columns. Don't cast another column to a vector to compare it with a text.
Cost and stored results
Before Bobsled AI makes the vectors, it checks the query and runs it once with zero vectors and no rows. A refused query makes no embedding call. All texts of one query go to the model in one request. Usage counts as one search question, in the chat, the Background Agent run, or the Project.
executedSql shows each vector as a bound value, such as PARSE_JSON(?)::ARRAY::VECTOR(FLOAT, 1024). It holds no numbers of a vector. Vector cells in the rows show as their length. You can't export the result, refresh it, or use it in an Artifact. To read the same rows, use SQL with their identifiers.
The following table lists the errors and how to fix them:
Vectors in query results
Query results, row samples, exports, Artifacts, and Background Agents get a stored vector as its length, such as vector(1024). This also applies to run-query in the API and MCP. There's no setting to turn it off.
The following rules decide which columns show this way:
- Snowflake vector columns always show this way. In file and cross-connection queries, fixed-size float arrays of 32 or more numbers also always show this way.
- Other arrays, such as BigQuery arrays and Postgres vectors, show this way by declaration. A deployed model in the query must declare that column as a vector of that length. A declared length of 32 or more also matches a renamed column.
- A query that joins two connections hides only declared vectors. Partner warehouse queries don't change.
To read the numbers in Snowflake, convert the vector in SQL with ARRAY_TO_STRING(text_embedding::ARRAY, ',').
Errors
The following table lists the error codes and the action for each. A refused search makes no embedding call.
What's next
- Embed extracted text: create vector columns with a pipeline.
- Query files with SQL: query files in a storage connection and join them with warehouse tables.
- MCP workflows: search from an MCP client.