iTranslated by AI
Exploring Enterprise Search in Gen App Builder: A Case Study with Zenn
In June 2023, a blog post was published regarding Enterprise Search in Generative AI App Builder (hereinafter referred to as "Enterprise Search").
Subsequently, registration for the waitlist opened, so I registered the Zenn verification project and waited. It recently became available to use. I will start by sharing my initial impressions.
Let's try it out
Open the Gen App Builder management console on Google Cloud: https://console.cloud.google.com/gen-app-builder/engines
From there, you can create a new app, which will take you to a wizard. You will see a screen like this, so proceed with the input.

- App type: Search
- Engine name setting: Optional. I used
zenn-test-app-search. - Advanced LLM features: Enabled
Next, I selected Website for the data store creation.

Create it. Finally, specify the website for the data store—that is, the URL you want to search.

Since I want to search the entire Zenn site, I specified zenn.dev/*. It will look like the following, so proceed to the preview.

In the preview, you can actually execute a search. Here is the result of entering Next.js app router.

It feels quite good! I was able to implement site search in just a few steps. Since you can embed widgets or retrieve JSON via HTTP to integrate it into your application, these methods should be available for use.
Use Cases
Having explored it thoroughly, let's consider the use cases. To begin with, what exactly is Google Cloud's Gen App Builder?
According to the blog post, it is described as a part of generative AI services that provides the following quickly:
- Creation of foundation models
- Search interface for foundation models
- Conversational interface for foundation models
The simplest form is a Google-like search for already published sites, as configured above. In this case, Google automatically generates the model from the public website data, so in terms of developer experience, the first step is practically non-existent. It is so readily available that I suspect they are just reusing the models already employed by Google Search 🤔
Regardless, Gen App Builder can be considered a generative AI integration kit specialized for finding information. Let's think about use cases, focusing specifically on Zenn as a public website.
Site Search
The first use case that comes to mind is site search. Zenn provides a search page, but it does not support searching within the body of articles. By using Enterprise Search, it seems possible to implement a simple yet powerful site search feature. Unlike Google Custom Search, it is provided as a Google Cloud service, offering the advantage of being easy to integrate as part of an application. On the other hand, as shown in the preview, the information obtained as a result seems to be limited to what Google has indexed, making the experience likely to resemble standard Google Search. While I considered using it as a substitute for full-text search on Zenn, it might feel a bit unnatural to use as-is.
Searching within a Book
Zenn publishes a wide variety of Books, some of which exceed 50 chapters. While the assumption is usually that readers will read from Chapter 1 in sequence, there may be times when readers want to search the entire Book, such as when revisiting content. Let's try searching within my Book.

Assuming a scenario where you think, "I feel like the benefits of GraphQL were written about in this book, but where was it?"

The accuracy is quite impressive! A high point is that it prioritizes parts that discuss the benefits of GraphQL itself, rather than the benefits of NestJS or Cloud Run. Since you can jump directly to the relevant chapter, I thought this is a viable option if you are comfortable with a Google-like search experience.
Searching within a Publication
This would likely be positioned as a feature for everyone utilizing Publications. Here is an image of what a search on the top page of a Publication might look like (though it's a patchwork job).

While the UI could certainly use some polish, the functionality might be sufficient.
Usage via API
While I have been using the preview up to this point, it is also possible to use it via the API. You can retrieve the commands from the Google Cloud console.
curl -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
"https://discoveryengine.googleapis.com/v1alpha/projects/xxxxxxxxxx/locations/global/collections/default_collection/dataStores/zenn-test-app-search/servingConfigs/default_search:search" \
-d '{"query":"GraphQL benefits","pageSize":10,"queryExpansionSpec":{"condition":"AUTO"},"spellCorrectionSpec":{"mode":"AUTO"}}'
{
"results": [
{
"id": "0",
"document": {
"id": "0",
"derivedStructData": {
"htmlFormattedUrl": "https://zenn.dev/waddy/books/\u003cb\u003egraphql\u003c/b\u003e-nestjs.../overview_from_frontend",
"htmlTitle": "GraphQL as seen from the frontend|GraphQL Starter Pack ...",
"pagemap": {
"cse_image": [
{
"src": "https://res.cloudinary.com/zenn/image/upload/s--fBV2XRoH--/g_center%2Ch_280%2Cl_fetch:aHR0cHM6Ly9zdG9yYWdlLmdvb2dsZWFwaXMuY29tL3plbm4tdXNlci11cGxvYWQvYm9va19jb3Zlci9mM2RjMTNmZDkwLnBuZw==%2Cw_200/v1627283836/default/og-base-book_yz4z02.jpg"
}
],
"cse_thumbnail": [
{
"width": "310",
"src": "https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcTXNXwhcb9cQ4lxVdCMEEqVUioGZ3J2j8W7h53tfqc6v_t3jHekfH6AmLk",
"height": "162"
}
],
"metatags": [
{
"og:type": "article",
"og:url": "https://zenn.dev/waddy/books/graphql-nestjs-nextjs-bootcamp/viewer/overview_from_frontend",
"zenn:description": "A book by waddy_u",
"og:image": "https://res.cloudinary.com/zenn/image/upload/s--fBV2XRoH--/g_center%2Ch_280%2Cl_fetch:aHR0cHM6Ly9zdG9yYWdlLmdvb2dsZWFwaXMuY29tL3plbm4tdXNlci11cGxvYWQvYm9va19jb3Zlci9mM2RjMTNmZDkwLnBuZw==%2Cw_200/v1627283836/default/og-base-book_yz4z02.jpg",
"viewport": "width=device-width, initial-scale=1",
"og:site_name": "Zenn",
"next-head-count": "12",
"apple-mobile-web-app-title": "Zenn",
"twitter:card": "summary_large_image",
"og:title": "GraphQL as seen from the frontend|GraphQL Starter Pack | Running a Prisma + NestJS + Next.JS based personal blog site on Cloud Run"
}
]
},
"title": "GraphQL as seen from the frontend|GraphQL Starter Pack ...",
"link": "https://zenn.dev/waddy/books/graphql-nestjs-nextjs-bootcamp/viewer/overview_from_frontend",
"formattedUrl": "https://zenn.dev/waddy/books/graphql-nestjs.../overview_from_frontend",
"displayLink": "zenn.dev",
"snippets": [
{
"htmlSnippet": "May 9, 2022 \u003cb\u003e...\u003c/b\u003e Installation; Initializing Apollo Client; Backend side: \u003cb\u003eGraphQL\u003c/b\u003e ... The \u003cb\u003ebenefits\u003c/b\u003e of using \u003cb\u003eGraphQL\u003c/b\u003e in the frontend are easy to understand, communication with the backend\u0026nbsp;...",
"snippet": "May 9, 2022 ... Installation; Initializing Apollo Client; Backend side: GraphQL ... The benefits of using GraphQL in the frontend are easy to understand, communication with the backend ..."
}
]
}
}
}
]
}
You can see that the URL, title, and snippets for display in the search results can be retrieved. By fetching data via the API and integrating it well into the UI, it seems possible to reduce any sense of discordance.
Pricing
At the time of writing, this information was private.
Summary
I have explored how one might use Enterprise Search with Zenn, focusing on data from public websites. While there are several potentially useful cases, I will continue to think about the following points:
UI Integration
The results obtained from Enterprise Search rely heavily on public HTML, and as a result, the search experience tends to resemble standard Google Search. To blend it more naturally into an application, it might be worth considering importing structured data for search purposes instead of relying solely on public HTML.
Specifying Paths during Search
Currently, the specification requires defining target search paths per App. If one were to prepare Enterprise Search for each individual Book or Publication, creating an App for every one of them would be difficult. While the feasibility is uncertain, it would expand the range of potential use cases if one could embed sites or paths into the search query itself rather than setting them at the App configuration level.
I hope this helps provide an image of what it is like to use Enterprise Search.
Starting with something other than Website Data
In this article, I used data from an already published website to try out Enterprise Search. Yamamoto-san at DevelopersIO has implemented an example where PDF files are imported for search, so please refer to that as well.
References
Discussion