Harnessing the Power of Generative AI for Next-Gen Search Experiences using Google Vertex AI Search

Dream AI
11 min readApr 29, 2024

--

Author: Syed Ali Naqi at DreamAI Software

In today’s data-driven world, the ability to access and understand information across a multitude of platforms is paramount. Organizations face the critical challenge of enhancing discoverability amidst scattered data — from documents to databases and web pages. This blog explores how generative AI can transform search services to meet the high demands of today’s enterprises.

Challenges in Building Effective Search Services

The process of creating a robust enterprise search service presents several challenges:

  1. High Service Level Requirements: Enterprise search services must manage vast amounts of data across various formats while being scalable and available 24/7.
  2. Limitations of Traditional Search: Keyword searches are often inadequate for the dynamic needs of modern users accustomed to AI-enhanced search experiences, such as those offered by platforms like YouTube and Instagram.
  3. Leveraging Generative AI and Large Language Models (LLMs): These technologies represent the cutting edge of information retrieval, yet harnessing their full potential is complex.

Introducing the Generative AI App Builder

To address these challenges, the Generative AI App Builder from Google Cloud offers a streamlined solution for enterprise search. This platform not only simplifies the integration of scattered information but also enhances the search experience through advanced AI technologies.

Key Features:

  • Ease of Setup: Quickly deploy a fully managed search engine without the need for an extensive DevOps team.
  • Semantic Search Capabilities: Offers next-generation search experiences that go beyond simple keyword matching.
  • Multimodal Search and Chatbot Integration: Utilizes the latest generative AI technologies to provide comprehensive and intuitive search functionalities.

Gen App Builder supports creating search engines and chat interfaces. However, in this blog, we’ll be focusing on how to bring the power of search to your applications. It’s an out of the box solution, which means you can deploy the fully managed search engine quickly and you don’t have to build and lead an entire DevOps team to manage it.

Overview:

By utilizing the power of Gen AI App Builder, we can create search engine for different kinds of data. This blog post provides detailed guidance on developing three distinct search applications, each tailored to handle various types of data:

  1. Crawling Website Content: Learn how to efficiently extract and index content from cloud.google.com, enabling powerful search capabilities over web-based data.
  2. Structured Data Search: Discover methods for ingesting structured data from an NDJSON-formatted dataset stored in a Cloud Storage bucket, and implement a search system to query this data effectively.
  3. Unstructured Data Search: Explore techniques for processing and searching through unstructured data, specifically PDF files, that are stored in a Cloud Storage bucket.

To begin, first we need to create an app using Agent Builder. Subsequently, establish a data store for this app. There are multiple types of Apps that we can create using Agent Builder (i.e., Search, Chat, Recommendations and Agent). Since we are creating a search engine, we will opt for a Search App. The data store creation is required to store and specify which type of data we need for our search engine.

Let go through a step-by-step guide of how you can setup your search engine using Gen App Builder.

Step-by-Step Guide to Setting Up Your Search Engine

Before creating a Vertex AI Search engine, make sure the Vertex AI Search APIs are enabled and you have activated the Vertex AI Search. To do that, follow these steps:

  1. First log in to your Google Cloud console and go to the Agent Builder page.
  2. Read and agree to the Terms of Service, then click Continue and activate the API.
Figure 01: Enable Vertex AI Search APIs

Create Vertex AI Search engine for a public website

First we will create a search engine for a public website. Follow the steps below to create it:

  1. In the Google Cloud console, go to the Agent Builder page and click New app.
Figure 02: Create new app in Agent Builder

2. In the Select app type pane, select Search.

Figure 03: Select search option for creating search engine

3. You will be offered a choice of Generic, Media or Healthcare content, click Generic.

4. In order to create a website search app, make sure Enterprise features is turned on. Also, enable Advanced LLM features option as it will allow you to do Search Summarization and Search with follow-ups for Advanced website search.

Figure 04: Search app configuration page

5. In the Your app name field, enter a name for your app (e.g. website_search_engine). Your app ID appears under the app name.

6. In the External name of your company or organization field, enter the company or organization name (e.g., dreamai in our case).

7. Select the global (Global) as the location for your app, and then click Continue.

Figure 05: Search Engine App name and other info

8. After you click continue, it will take you to the datastore page where you need to create a datastore for your website data.

9. In the Data stores pane, click Create new data store.

Figure 06: Create data store page

10. In the Select a data source pane, select Website URLs.

Figure 07: Select data source pane

11. In this tutorial, we will not enable Advanced website Indexing as it will incur additional cost. You can learn more about its features and pricing by clicking the link provided under this option.

12. In the Specify the websites for your data store pane, in the Sites to include field, enter cloud.google.com/* and then click Continue. At this stage, you may also exclude any websites you prefer not to include in your datastore by listing them in the appropriate field. For the purpose of this demonstration, we will leave the exclusion field blank.

Figure 08: Specify the websites for your data store page

13. In the Configure your data store pane, enter a name for your data store (e.g. website_search_engine_datastore), and then click Create.

Figure 09: Configure your data store page

14. On the Data stores page, select your new data store, and then click Create. Data store creating will take few minutes according to your website data.

Figure 10: Creating data store from Data stores page

15. After creating data store, you will land to the Data page where you can see the details of your data store like datastore name, data store id, type, region and the include/excluded sites.

Figure 11: Data store details page

Preview your app for website data:

In order to preview your app for website data, follow the steps below:

  1. On the Apps page, click the name of your new app (e.g. in our case it is website_search_engine).

2. 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.

Figure 12: Preview your app for website data

3. Click Analytics to go to the analytics page where you can view different analytics of your website search engine.
(Please note that it can take up 12 hours after you set up search for analytics to be available for viewing)

Figure 13: Website search engine analytics

Create Vertex AI Search engine for a Structured data from Cloud Storage

To develop a Vertex AI Search engine for Structured data, follow the same procedures used in the application creation process up to step 7, as previously outlined for the website search engine. Once completed, proceed with the steps below:

  1. In the Data stores pane, click Create new data store. This time, instead of selecting Website URLs, we will select Cloud Storage as data store option.
Figure 14: Data store creation for structured data

2. In the Import data from GCS pane, make sure Folder is selected.

3. 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, which we will use for demonstration purposes.

4. Select JSON for structured data (Preview), and then click Continue.

Figure 15: Import data from cloud storage for structured data

5. In the Configure your data store pane, select global (Global) as the location for your data store.

6. Enter a name for your data store (e.g. in our case, we have entered structured_data_search_engine_datastore), and then click Create.

Figure 16: Structured Data data store configuration page

7. On the Data stores page, select your new data store and click Create.

8. On the Data page of your datastore, navigate to the Activity tab to monitor the status of your data ingestion. The Status column will display “Import completed” once the import process has concluded. Typically, for this dataset, the process should take approximately two to three minutes. You may need to click “Refresh” to update the status and view “Import completed.”

Figure 17.1: Structured data details page Activity Tab

9. To view the number of documents imported, click the Documents tab.

Figure 17.2: Structured data details page Documents Tab

Preview your app for Structured data:

Once the data is imported successfully, you can preview your app for structured data from cloud storage. In order to do that, follow the steps below:

  1. In the navigation menu, click Preview to test the search app.

2. In the search bar, enter Harry Potter, and then press Enter to get results about the Harry Potter series of movies.

Figure 18: Preview you app for structured data

Create Vertex AI Search engine for unstructured data from Cloud Storage

Finally, we will develop a Vertex AI Search engine for Unstructured Data. In order to do that, adhere to the same procedures used in the application creation process prior to the import data from cloud storage page, as previously demonstrated for the structured data search engine. Once it’s done, follow the steps below:

  1. In the Import data from GCS pane, make sure Folder is selected.

2. 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. For now, we will use it for demo purpose.

3. Select Unstructured documents, and then click Continue.

Figure 19: Import data from cloud storage for unstructured data

4. In the Configure your data store pane, select global (Global) as the location for your data store.

5. Enter a name for your data store (e.g. in our case, we have entered unstructured_data_search_engine_datastore), and then click Create.

Figure 20: Unstructured Data data store configuration page

6. In the Data stores pane, select your new data store and click Create.

7. 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.

8. Click the Documents tab to see the number of documents imported.

Preview your app for Unstructured data:

After data import completion, you can preview your app for unstructured data. To do that, follow the steps below:

  1. In the navigation menu, click Preview to test the search app.

2. In the search bar, enter Google, and then press Enter to view your results.

Figure 21: Preview your app for unstructured data

Search engine integration

There are two ways by which you can integrate your Vertex AI search engine to an external App. Widget and API.

Integration through Widget:

In order to integrate your search engine to an external App via Widget, follow the steps below:

  1. Select your App and in the navigation menu, click Integration.

2. Select JWT or OAuth based as the widget authorization type.

3. 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, enter example.com as the domain.

4. Click Add, and then click Save.

Figure 22: Search Engine App Integration via Widget

5. Copy the code snippet provided in the Copy the following code to your web application section.

6. In your codebase, generate an authorization token.

7. 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.

Figure 23: Search Engine App Integration widget code

Integration through API:

As an alternative to creating a widget to add to an HTML page, you can make API calls and integrate those into your server or applications.

To integrate via API call, go to the Integration page through navigation menu and select API tab. Under API tab, you will find the curl command designed to make a POST request. You can use this curl command to make the API calls and integrate the search engine into your sever or applications.

Figure 24: Search Engine App Integration via API

Conclusion

The Generative AI App Builder provides a robust framework for enterprises looking to enhance their search capabilities. By integrating advanced AI technologies, organizations can dramatically improve the accessibility and usability of their information assets, creating a more informed and efficient workplace.

Ready to transform your search capabilities? Explore the Generative AI App Builder and take the first step towards a smarter, more connected enterprise environment.

References

  1. Google Cloud Documentation Comprehensive resource for all features and services offered by Google Cloud, including detailed guides on setting up and managing AI-powered search services.
  2. Google Cloud — Vertex AI Search: Detailed documentation specifically for Vertex AI Search capabilities, providing insights into API usage, configuration options, and advanced features.
  3. Google Cloud Blog: Articles and updates from Google Cloud experts, offering industry insights, success stories, and technical tips for leveraging cloud technologies effectively.

These resources are integral for anyone looking to delve deeper into the technical aspects and capabilities of Google Cloud’s AI solutions and enterprise search functionalities.

--

--