NOTE: Some of the links in this file require allowlist access to Generative AI App Builder in order to view. If you would like early access to the product, apply to become a Trusted Tester for Google Cloud Generative AI.
This demo illustrates how to search through a corpus of documents using Enterprise Search on Generative AI App Builder.
Additional features include how to search the public Cloud Knowledge Graph using the Enterprise Knowledge Graph API.
- Generative AI App Builder: Enterprise Search
- Generative AI App Builder: Recommendations
- Cloud Run
- Enterprise Knowledge Graph
-
Follow steps in Get started with Enterprise Search for Unstructured Data.
- Sample Data Sources used in the deployed demo:
- Contract Understanding Atticus Dataset (CUAD)
gs://cloud-samples-data/gen-app-builder/search/CUAD_v1
- Alphabet Earnings Reports
gs://cloud-samples-data/gen-app-builder/search/alphabet-investor-pdfs
- Contract Understanding Atticus Dataset (CUAD)
- Sample Data Sources used in the deployed demo:
-
Follow steps in Get started with Enterprise Search for Websites
- Google Cloud site
https://cloud.google.com
- Google Cloud site
-
Follow steps in Get started with Recommendations for Unstructured Data.
- Sample Data Sources used in the deployed demo:
- Natural language papers from ArXiv
gs://cloud-samples-data/gen-app-builder/search/arxiv
- Natural language papers from ArXiv
- Sample Data Sources used in the deployed demo:
- Install Python
- Install the Google Cloud SDK
- Install the prerequisites:
pip install -r requirements.txt
- Run
gcloud init
, create a new project, and enable billing - Enable the Generative AI App Builder API:
gcloud services enable discoveryengine.googleapis.com
- Enable the Enterprise Knowledge Graph API:
gcloud services enable enterpriseknowledgegraph.googleapis.com
- Enable Cloud Run:
gcloud services enable run.googleapis.com
- Setup application default authentication, run:
gcloud auth application-default login
-
Update the
consts.py
file with your ownPROJECT_ID
andLOCATION
. -
Configure Enterprise Search
- To use the prebuilt widget provided in the Cloud Console for Enterprise, Copy the
configId
from the<gen-search-widget>
in theIntegration > Widget
tab. - To use the Custom UI, add the datastore id for your search engine to
CUSTOM_UI_DATASTORE_IDS
inconsts.py
- This is the string after
/engines/
in the Cloud Console URL.https://console.cloud.google.com/gen-app-builder/engines/website-search-engine_1681248733152/...
- Datastore ID is
website-search-engine_1681248733152
- This is the string after
- To use the prebuilt widget provided in the Cloud Console for Enterprise, Copy the
-
Configure Recommendations
- Add the datastore id and engine id for your recommendations engine to
RECOMMENDATIONS_DATASTORE_IDs
inconsts.py
. - The datastore id is visible on the
Data > Details
page. - The engine id is the string after
/engines/
in the Cloud Console URL.https://console.cloud.google.com/gen-app-builder/engines/contracts-personalize_1687884886933/data/records
- Engine ID is
contracts-personalize_1687884886933
- Add the datastore id and engine id for your recommendations engine to
-
Configure Image Search
- Follow the instructions in the documentation to enable image search for a search engine.
- This feature is in early access and requires separate allowlisting from the rest of Enterprise Search in order to use.
- Add the datastore id for your search engine to
IMAGE_SEARCH_DATASTORE_IDs
inconsts.py
.
-
Deploy the Cloud Run app in your project.
gcloud run deploy genappbuilder-demo --source .
-
Visit the deployed web page
Copyright 2023 Google LLC Author: Holt Skinner @holtskinner