
TL;DR: BigQuery has launched Autonomous Embedding Generation and AI.SEARCH (Public Preview), effectively removing the need for external embedding pipelines. You can now define an embedding column in your DDL using GENERATED ALWAYS AS AI.EMBED, which automatically handles vector generation in the background whenever you insert data. This allows you to run semantic searches on raw text immediately using the new AI.SEARCH function, enabling you to build RAG workflows entirely within SQL.
If you have ever built a Retrieval-Augmented Generation (RAG) system or a semantic search engine, you know that the “Hello World” tutorials are easy, but production is a different beast.
The friction usually isn’t the vector database itself , it’s the pipeline. You have to set up an event trigger, write a Cloud Function or Dataflow job to call an embedding model API, handle retries, and write the vector back to your database. It’s brittle, it’s complex, and honestly, it’s a lot of glue code for something that should be simple.
That is why I am incredibly excited about the new Autonomous Embedding Generation and AI.SEARCH features now in Public Preview for BigQuery.
We are moving from “managing pipelines” to “managing data.” Let’s look at how we can go from raw text to full semantic search in literal seconds, without leaving SQL.
The Old Way vs. The Autonomous Way
Previously, if you wanted to run vector search on your data in BigQuery, you had to manually orchestrate the embedding process. You were responsible for keeping the embeddings in sync with your source data.
With this launch, BigQuery abstracts away that complexity. We now have three game-changing capabilities:
- GENERATED ALWAYS AS AI.EMBED(…): A DDL syntax that automatically generates embeddings for new records.
- AI.SEARCH(): A new function that lets you perform similarity searches directly on text data without needing to handle the embedding vector yourself.
- Enhanced VECTOR_SEARCH(): The ability to pass natural language text directly into vector search for more granular control.
The Use Case: Analyzing Food Delivery Reviews
Let’s try this out with a real-world scenario. Imagine we are analyzing customer feedback for a food delivery platform. We want to find reviews about “food safety” or “delivery speed,” but customers phrase these things in infinite ways (“it arrived cold”, “the driver was late”, “weird taste”). Keyword search fails here, that is why we need semantic search.
Step 1: Create Table
Instead of creating a standard table and building a separate pipeline to fill it, we define the embedding logic directly in the table schema.
CREATE TABLE my_project.reviews_dataset.customer_feedback (
review_id STRING,
customer_id STRING,
review_text STRING,
-- Here is the magic:
text_embedding STRUCT<result ARRAY<FLOAT64>, status STRING>
GENERATED ALWAYS AS (AI.EMBED(
review_text,
connection_id => 'us.my_connection',
endpoint => 'text-embedding-005'
))
STORED OPTIONS (asynchronous = TRUE)
);
Notice the GENERATED ALWAYS clause. We are telling BigQuery: "Whenever a row is added to this table, automatically call the text-embedding-005 model via Vertex AI and store the vector in this column."
The STORED OPTIONS (asynchronous = TRUE) part is critical, since it ensures that your INSERT statements remain fast. The embeddings are processed in the background, so your transactional applications aren't blocked waiting for the model to respond.
Step 2: Insert Data
Now, we just insert data.
INSERT INTO my_project.reviews_dataset.customer_feedback
(review_id, customer_id, review_text)
VALUES
('101', 'cust_A', 'The driver got lost and the pizza was basically frozen by the time it arrived.'),
('102', 'cust_B', 'Absolutely delicious, piping hot, and arrived 10 minutes early!'),
('103', 'cust_C', 'I found a hair in my soup. Unacceptable hygiene standards.');
Behind the scenes, BigQuery sends these descriptions to the embedding model, and populates the text_embedding column for us.
Step 3: Search
This is where the new AI.SEARCH function shines. In the past, to query this, you would have to generate an embedding for your query ("late delivery") and then run a vector distance calculation.
Now, you just ask the question.
SELECT
base.review_text,
distance
FROM AI.SEARCH(
TABLE `my_project.reviews_dataset.customer_feedback`,
'review_text',
'late delivery'
)
ORDER BY distance ASC
LIMIT 5;
BigQuery handles the embedding of your query text and the similarity search against the table.
The Result: You’ll see the review about “driver got lost” at the top of the list, even though the word “late” didn’t appear in the text. The semantic meaning matched.
When to use what?
You might be wondering, “Do I use AI.SEARCH or the classic VECTOR_SEARCH?"
- Use AI.SEARCH when you want speed and simplicity. It’s "content-first," meaning you don't need to worry about the underlying mathematics of the vectors. It is perfect for rapid prototyping and standard RAG applications.
- Use VECTOR_SEARCH when you need fine-tuned control. The team has upgraded this function to accept natural language text input now as well, but it exposes every tunable parameter in the API, giving you maximum control over performance and recall.
Why This Matters
This launch is about lowering the barrier to entry for AI analytics. We often talk about “democratizing AI,” and this is what it looks like in practice. By treating embeddings as just another generated column, similar to a calculated field, we enable anyone who knows SQL to build sophisticated semantic search engines.
There is no Python boilerplate. No managed pipelines. Just CREATE, INSERT, and SEARCH.
This feature is currently in preview, but even now, for anyone building GenAI applications on Google Cloud, this is the most streamlined way to handle vector data.
Give it a spin and let me know what you build!
Goodbye, Pipelines: Building AI Search in Seconds with BigQuery Autonomous Embeddings was originally published in Google Cloud – Community on Medium, where people are continuing the conversation by highlighting and responding to this story.
Source Credit: https://medium.com/google-cloud/goodbye-pipelines-building-ai-search-in-seconds-with-bigquery-autonomous-embeddings-bd7dd68e2fe8?source=rss—-e52cf94d98af—4
