Get started with Vertex AI Search
Vertex AI Search brings together the power of deep information retrieval, state-of-the-art natural language processing, and the latest in large language processing to understand user intent and return the most relevant results for the user.
This tutorial explains how to create three search apps, each for a different kind of data:
- Website content from crawling cloud.google.com
- Structured data in the form of an NDJSON-formatted dataset ingested from a Cloud Storage bucket
- Unstructured data in the form of PDFs ingested from a Cloud Storage bucket
Before following this tutorial, make sure you have done the steps in Before you begin.
To follow step-by-step guidance for this task directly in the Google Cloud console, click Guide me:
Before you begin
- Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
-
Make sure that billing is enabled for your Google Cloud project.
-
Enable the Vertex AI Search and Conversation, BigQuery, Cloud Storage APIs.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
-
Make sure that billing is enabled for your Google Cloud project.
-
Enable the Vertex AI Search and Conversation, BigQuery, Cloud Storage APIs.
Activate Vertex AI Search and Conversation
In the Google Cloud console, go to the Search and Conversation page.
Read and agree to the Terms of Service, then click Continue and activate the API.
Create a search app for website data
In the Google Cloud console, go to the Search and Conversation page.
Click
New app .In the Select app type pane, select Search.
In order to create a website search app, make sure Enterprise features is turned on.
If you don't plan to use Advanced LLM features for this app, turn off the Advanced LLM features option.
In the
Your app name field, enter a name for your app. Your app ID appears under the app name.In the External name of your company or organization field, enter the company or organization name.
Select global (Global) as the location for your app, and then click Continue.
In the Data stores pane, click Create new data store.
In the Select a data source pane, select Website URLs.
Make sure that Advanced website indexing is turned off.
In the Specify the websites for your data store pane, in the Sites to include field, enter
cloud.google.com/*
and then click Continue.In the Configure your data store pane, enter a name for your data store, and then click Create.
On the Data stores page, select your new data store, and then click Create.
Preview your app for website data
On the Apps page, click the name of your new app.
On the Preview page, perform a search for
Document AI
to view results about the product.Optional: Click the view icons to switch between mobile view and desktop view.
Click
Analytics to go to the analytics page.It can take up 12 hours after you set up search for analytics to be available for viewing.
Create and preview a search app for structured data from Cloud Storage
In the Google Cloud console, go to the Search and Conversation page.
Click New app.
In the Select app type pane, select Search.
If you don't plan to use Enterprise edition features for this app, turn off the Enterprise edition features option to avoid incurring additional costs.
If you don't plan to use Advanced LLM features for this app, turn off the Advanced LLM features option.
In the App name field, enter a name for your app. Your app ID appears under the app name.
Select global (Global) as the location for your app, and then click Continue.
In the Data stores pane, click Create new data store.
In the Select a data source pane, select Cloud Storage.
In the Import data from GCS pane, make sure Folder is selected.
In the gs:// field, enter the following value:
cloud-samples-data/gen-app-builder/search/kaggle_movies
This Cloud Storage bucket contains an NDJSON-formatted dataset of movies made available by Kaggle.
Select JSON for structured data (Preview), and then click Continue.
In the Configure your data store pane, select global (Global) as the location for your data store.
Enter a name for your data store, and then click Create.
On the Data stores page, select your new data store and click Create.
On your data store's Data page, click the Activity tab to see the status of your data ingestion. Import completed displays in the Status column when the import process is complete. For this dataset, this typically takes two to three minutes. You might need to click Refresh to see Import completed.
Click the Documents tab to see the number of documents imported.
In the navigation menu, click
Preview to test the search app.In the search bar, enter
Harry Potter
, and then press Enter to get results about the Harry Potter series of movies.
Create and preview a search app for unstructured data from Cloud Storage
In the Google Cloud console, go to the Search and Conversation page.
Click New app.
In the Select app type pane, select Search.
If you don't plan to use Enterprise edition features for this app, turn off the Enterprise edition features option to avoid incurring additional costs.
If you don't plan to use Advanced LLM features for this app, turn off the Advanced LLM features option.
In the App name field, enter a name for your app. Your app ID appears under the app name.
Select global (Global) as the location for your app, and then click Continue.
In the Data stores pane, click Create new data store.
In the Select a data source pane, select Cloud Storage.
In the Import data from GCS pane, make sure Folder is selected.
In the gs:// field, enter the following value:
cloud-samples-data/gen-app-builder/search/alphabet-investor-pdfs
This Cloud Storage bucket contains earnings report PDFs from the Alphabet investor site.
Select Unstructured documents, and then click Continue.
In the Configure your data store pane, select global (Global) as the location for your data store.
Enter a name for your data store, and then click Create.
In the Data stores pane, select your new data store and click Create.
On your data store's Data page, click the Activity tab to see the status of your data ingestion. Import completed displays in the Status column when the import process is complete.
Click the Documents tab to see the number of documents imported.
In the navigation menu, click
Preview to test the search app.In the search bar, enter
Google
, and then press Enter to view your results.
Deploy a search app
In the Google Cloud console, go to the Search and Conversation page.
Click the name of the app that you want to deploy.
In the navigation menu, click Integration.
Make sure the Widget tab is selected.
Select JWT or OAuth based as the widget authorization type.
In the Domain field, enter the domain name for web page where you will put the widget. For example, if you are going to copy the widget to the web page
example.com/ai.html
, enterexample.com
as the domain.Click Add, and then click Save.
Copy the code snippet provided in the Copy the following code to your web application section.
In your codebase, generate an authorization token.
To pass the authorization token to your widget, use the "Set authorization token" code snippet provided in the Copy the following code to your web application section and replace the text
<JWT or OAuth token provided by you backend>
with your authorization token.In the navigation menu, click Configurations to configure settings for the search app.
- For apps with website data: You can configure autocomplete.
- For apps with structured data: You can configure fields for search, configure autocomplete, and configure search results.
- For apps with unstructured data: You can configure autocomplete and configure search results.
Clean up
To avoid incurring charges to your Google Cloud account for the resources used on this page, follow these steps.
- To avoid unnecessary Google Cloud charges, use the Google Cloud console to delete your project if you do not need it.
- If you created a new project to learn about Vertex AI Search and Conversation and you no longer need the project, delete the project.
- If you used an existing Google Cloud project, delete the resources you created to avoid incurring charges to your account. For more information, see Delete an app.
- Follow the steps in Turn off Vertex AI Search and Conversation.