SPEAKER: In this video, we will learn
what is vector search, why it is becoming
so important for businesses, and how
to get started with building production quality vector
search services with Google Cloud Vertex AI.
Did you know that you use dozens of different vector search
services every day?
Vector search technology is now one
of the most essential component in AI/ML services,
just like the relational databases in IT systems.
For example, Google uses vector search
to organize data across its various services,
such as Google Search, YouTube, and Google Play
to provide search results and recommendations that
are relevant to users.
Vector search can also be used for search and recommendation
of different types of things in businesses, such as products,
users, user activities, conversations, music
and videos, and signals from IoT sensors.
In the age of generative AI, vector search
is becoming more and more a crucial part.
For example, this demo uses vector search
to find product items, matching the query "handmade accessories
with black and white beads" from six million product items
in milliseconds.
Notably, it does not use any item titles, descriptions,
or tags for the search.
Instead, it retrieves the results
by looking only at the item images.
This kind of multimodal search is made possible
with a combination of vector search and Gen AI models.
You may be wondering what the difference is
between traditional databases and vector search technology?
In traditional IT systems, most data
is organized as structured or tabular data,
using simple keywords, labels, and categories
in databases and keyword-based search engines.
Unlike the traditional IT systems,
modern AI-based services use a simple data structure
called "embeddings," which is a special type of vector.
Let's see how AI organizes data using embeddings.
Once trained with a specific content,
like text, images, or any content,
AI creates a space called embedding
space, which is essentially a map of the content's meaning.
AI can identify the location of each content on the map.
That's what embedding is.
Let's take an example, where a text discusses movies, music,
and actors with a distribution of 10%, 2%, and 30%,
respectively.
In this case, the AI can create an embedding
with three values, 0.1, 0.02, and 0.3
in three-dimensional space.
And AI can put the content with similar meanings
closely together in this space.
Please keep in mind that this is a simplified example
for illustrative purposes.
In reality, the embedding spaces can have hundreds or thousands
of dimensions, which can capture subtle differences
or nuances in the content and sort it
into an almost infinite number of different categories.
Let's see how the real embedding space looks like.
Here, you can see the six million images
are sorted into extremely specific categories
by their meaning, providing a glimpse
into the human-level intelligence
that the AI model has.
Using vector search with this embedding space,
you can find items by their meanings
in milliseconds, which was almost impossible
with traditional databases and keyword-based search engines.
Vector search and embeddings are now playing a crucial role
in creating a new way of human-computer interaction.
AI organizes data into embeddings
which represent what users are really looking for,
the meaning of content, or the essential signatures
of your business data.
Vector search can find these embeddings in milliseconds,
creating a new level of user experience
that is becoming the new standard.
As vector search becomes as essential to many IT
systems as databases, many people
are looking for ways to build production-ready vector search
services.
Google has a long history in this area.
Let's explore how Google has developed
its highly scalable and reliable vector search
infrastructure, which underpins many major Google services.
Embeddings are vectors, lists of hundreds of numbers.
To find similar embeddings, we can simply
calculate the distance between two embeddings
and select the closer ones.
But calculating this for millions of embeddings
can be challenging.
For example, if you have eight million embeddings
with 700 dimensions, you would need to perform 8 million
times 700 calculations.
This would take tens of seconds.
Researchers are studying a technique
called approximate nearest neighbor, or ANN, to speed up
vector search and uses vector quantization
to divide this space into multiple spaces with a tree
structure, similar to an index in a database.
This enables very fast and scalable search
with billions of embeddings.
In 2020, Google research published ScaNN, a new ANN
algorithm that is considered one of the best in the industry
and the most important foundation for search
and recommendation in major Google services,
like Google Search, YouTube, and many others.
ScaNN is the foundation of Google's business,
user experience, and core competency
in pursuing its mission to organize the world's
information and make it universally
accessible and useful.
Google Cloud developers can now take full advantage
of Google's ScaNN-based web search technology
with Vertex AI Search.
It is a fully-managed service that
makes it easy to add embeddings to an index
and perform blazingly-fast vector searches
with a simple search query.
Vector Search offers not only top-notch performance, but also
high scalability and reliability,
making it a solid foundation for Google-scale enterprise
services.
With its tight integration with Google Cloud Services,
like BigQuery, Vertex AI Embeddings API,
and Feature Store, you can quickly build and operate
a production MLOps pipeline for data extraction,
embedding generation and sharing, and embedding search
all in one platform.
Let's take a look at how vector search
can be easily used for building a production
service in enterprises.
For example, what if you want to show
similar items to a specific item the user specify?
First, you get embeddings for each item.
Second, build an index on Vector Search with the embeddings.
Then you can just run a query on Vector Search
to find similar items by their names.
That's it.
Let's get started.
This is the BigQuery table of the items and their names.
In this example, let's simply use
embeddings for the item names.
You can also use descriptions or images
to capture more detailed meanings with the embeddings.
On BigQuery, it's so easy to get embeddings for text.
Just use ML.EMBED_TEXT function in your query so you will get
the embeddings for this specified text column.
Despite of this simplicity, what you are getting here is
the state-of-the-art LLM-powered text embeddings.
That means they are carefully organized
in the embedding space with the human-level intelligence
and common sense as we saw earlier.
Then, export the embeddings as a JSON file on the Cloud Storage.
This is the exported JSON file.
Each embedding row has 768 dimensions
that represents the meaning of an item name.
Next, create an index with vector search.
You can specify the Cloud Storage path of the JSON file,
along with the parameters, such as the dimensions, number
of items to fetch, similarity measure type, et cetera.
If you are building an index with small or mid-sized item
table, this process should finish within some minutes.
The last thing is to deploy the index on an index endpoint that
receives the query request from your front end
and execute the vector search.
Now it's ready to serve.
You can run a query by passing an embedding of the specified
item so you will receive a list of similar items
within tens of milliseconds.
Please note that this is not just
a keyword search on the item names.
This is a so-called semantic search,
finding items by understanding the meaning of the names
with the power of LLM.
So you can expect much better user experience
for exploring and spotting relevant items.
That's it.
Once you get the embeddings based on what you want to do,
then using Vector Search is quite simple
and doesn't require any rocket science, as we saw.
Vector Search has already been deployed in many customers
production systems.
For example, Mercari, the popular marketplace app,
uses the technology for showing product recommendations.
They were able to build and deploy
the system within one month with one person--
significantly reduced the time and cost
for AI service development.
Would you like to bring the success with AI
to your business?
Please go to this URL to get started with Vector Search.