To create a data store and ingest data for generic recommendations, go to the section for which source you plan to use:
Website URLs
Console
To use the Google Cloud console to create a data store and index data from a website, follow these steps:
In the Google Cloud console, go to the Agent Builder page.
In the navigation menu, click Data Stores.
Click New data store.
On the Select a data source page, select Website Content.
Choose whether to turn on Advanced website indexing for this data store. This option can't be turned off later.
Advanced website indexing provides additional features such as search summarization, search with follow-ups, and extractive answers. Advanced website indexing incurs additional cost, and requires that you verify domain ownership for any website that you index. For more information, see Advanced website indexing and Pricing.
In the Sites to include field, specify the URLs of the websites that you want to index. Include one URL per line, without comma separators.
Optional: In the Sites to exclude field, enter websites that you want to exclude from your app.
Click Continue.
Enter a name for your data store.
Select a location for your data store. Advanced website indexing must be turned on to select a location.
Click Create. Vertex AI Agent Builder creates your data store and displays your data stores on the Data Stores page.
To view information about your data store, click the name of your data store in the Name column. Your data store page appears.
If you turned on Advanced website indexing, a warning appears prompting you to verify your domain ownership. If you have a quota shortfall (the number of pages in the websites that you specified exceeds the "Number of documents per project" quota for your project), an additional warning appears prompting you to upgrade your quota. The following steps show you how to verify domain ownership and upgrade your quota.
To verify your domain ownership, follow these steps:
- Click Verify in Google Search console. The Welcome to the Google Search Console page appears.
- Follow the on-screen instructions to verify a domain or a URL prefix, depending on whether you are verifying an entire domain or a URL prefix that is part of a domain. For more information, see Verify your site ownership in the Search Console Help.
- When you have finished the domain verification workflow, go back to the Agent Builder page and click Data Stores in the navigation menu.
- Click the name of your data store in the Name column. Your data store page appears.
- Click Refresh status to update the values in the Status column. The Status column for your website indicates that indexing is in progress.
- Repeat the domain verification steps for every website that requires domain verification until all of them begin indexing. When the Status column for a URL shows Indexed, advanced website indexing features are available for that URL or URL pattern.
To upgrade your quota, follow these steps:
- Click Upgrade quota. The Discovery Engine API pane appears, with the Quotas tab selected.
- Follow the instructions at Request a higher quota limit in the Google Cloud documentation. The quota to increase is Number of documents.
- After submitting your request for a higher quota limit, go back to the Agent Builder page and click Data Stores in the navigation menu.
- Click the name of your data store in the Name column. The Status column indicates that indexing is in progress for the websites that had surpassed the quota. When the Status column for a URL shows Indexed, advanced website indexing features are available for that URL or URL pattern.
Next steps
To attach your data store to an app, create an app and select your data store following the steps in Create a generic recommendations app.
To preview how your recommendations appear after your app and data store are set up, see Get recommendations.
BigQuery
To ingest data from BigQuery, use the following steps to create a data store and ingest data using either the Google Cloud console or the API.
Before importing your data, review Prepare data for ingesting.
Console
To use the Google Cloud console to ingest data from BigQuery, follow these steps:
In the Google Cloud console, go to the Agent Builder page.
Go to the Data Stores page.
Click New data store.
On the Type page, select BigQuery.
In the BigQuery path field, click Browse, select a table that you have prepared for ingesting, and then click Select. Alternatively, enter the table location directly in the BigQuery path field.
Select what kind of data you are importing.
Click Continue.
If you are doing one-time import of structured data:
Map fields to key properties.
If there are important fields missing from the schema, use Add new field to add them.
For more information, see About auto-detect and edit.
Click Continue.
Choose a region for your data store.
Enter a name for your data store.
Click Create.
To confirm that your data store was created, go to the Data Stores page and click your data store name to see details about it on its Data page.
To check the status of your ingestion, go to the Data Stores page and click your data store name to see details about it on its Data page. When the status column on the Activity tab changes from In progress to Import completed, the ingestion is complete.
Depending on the size of your data, ingestion can take several minutes or several hours.
REST
To use the command line to create a data store and import data from BigQuery, follow these steps:
Create a data store.
curl -X POST \ -H "Authorization: Bearer $(gcloud auth print-access-token)" \ -H "Content-Type: application/json" \ -H "X-Goog-User-Project: PROJECT_ID" \ "https://discoveryengine.googleapis.com/v1alpha/projects/PROJECT_ID/locations/global/collections/default_collection/dataStores?dataStoreId=DATA_STORE_ID" \ -d '{ "displayName": "DATA_STORE_DISPLAY_NAME", "industryVertical": "GENERIC", "solutionTypes": ["SOLUTION_TYPE_RECOMMENDATION"] }'
Replace the following:
PROJECT_ID
: the ID of your Google Cloud project.DATA_STORE_ID
: the ID of the recommendations data store that you want to create. This ID can contain only lowercase letters, digits, underscores, and hyphens.DATA_STORE_DISPLAY_NAME
: the display name of the recommendations data store that you want to create.
Optional: If you're uploading structured data with your own schema, you can provide the schema. When you provide the schema, you typically get better results. Otherwise, the schema is auto-detected. For more information, see Provide or auto-detect a schema.
curl -X PATCH \ -H "Authorization: Bearer $(gcloud auth print-access-token)" \ -H "Content-Type: application/json" \ "https://discoveryengine.googleapis.com/v1/projects/PROJECT_ID/locations/global/collections/default_collection/dataStores/DATA_STORE_ID/schemas/default_schema" \ -d '{ "structSchema": JSON_SCHEMA_OBJECT }'
Replace the following:
PROJECT_ID
: the ID of your Google Cloud project.DATA_STORE_ID
: the ID of the recommendations data store.JSON_SCHEMA_OBJECT
: your JSON schema as a JSON object—for example:{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "title": { "type": "string", "keyPropertyMapping": "title" }, "categories": { "type": "array", "items": { "type": "string", "keyPropertyMapping": "category" } }, "uri": { "type": "string", "keyPropertyMapping": "uri" } } }
Import data from BigQuery.
If you defined a schema, make sure the data conforms to that schema.
curl -X POST \ -H "Authorization: Bearer $(gcloud auth print-access-token)" \ -H "Content-Type: application/json" \ "https://discoveryengine.googleapis.com/v1/projects/PROJECT_ID/locations/global/collections/default_collection/dataStores/DATA_STORE_ID/branches/0/documents:import" \ -d '{ "bigquerySource": { "projectId": "PROJECT_ID", "datasetId":"DATASET_ID", "tableId": "TABLE_ID", "dataSchema": "DATA_SCHEMA", }, "reconciliationMode": "RECONCILIATION_MODE", "autoGenerateIds": "AUTO_GENERATE_IDS", "idField": "ID_FIELD", "errorConfig": { "gcsPrefix": "ERROR_DIRECTORY" } }'
Replace the following:
PROJECT_ID
: the ID of your Google Cloud project.DATA_STORE_ID
: the ID of the recommendations data store.DATASET_ID
: the ID of the BigQuery dataset.TABLE_ID
: the ID of the BigQuery table.- If the BigQuery table is not under
PROJECT_ID
, you need to give the service accountservice-<project number>@gcp-sa-discoveryengine.iam.gserviceaccount.com
"BigQuery Data Viewer" permission for the BigQuery table. For example, if you are importing a BigQuery table from source project "123" to destination project "456", giveservice-456@gcp-sa-discoveryengine.iam.gserviceaccount.com
permissions for the BigQuery table under project "123".
- If the BigQuery table is not under
DATA_SCHEMA
: Optional. Values aredocument
andcustom
. The default isdocument
.document
: the BigQuery table that you use must conform to the default BigQuery schema provided in Prepare data for ingesting. You can define the ID of each document yourself, while wrapping all the data in the jsonData string.custom
: Any BigQuery table schema is accepted, and Recommendations automatically generates the IDs for each document that is imported.
ERROR_DIRECTORY
: Optional. A Cloud Storage directory for error information about the import—for example,gs://<your-gcs-bucket>/directory/import_errors
. Google recommends leaving this field empty to let Recommendations automatically create a temporary directory.RECONCILIATION_MODE
: Optional. Values areFULL
andINCREMENTAL
. Default isINCREMENTAL
. SpecifyingINCREMENTAL
causes an incremental refresh of data from BigQuery to your data store. This does an upsert operation, which adds new documents and replaces existing documents with updated documents with the same ID. SpecifyingFULL
causes a full rebase of the documents in your data store. In other words, new and updated documents are added to your data store, and documents that are not in BigQuery are removed from your data store. TheFULL
mode is helpful if you want to automatically delete documents that you no longer need.AUTO_GENERATE_IDS
: Optional. Specifies whether to automatically generate document IDs. If set totrue
, document IDs are generated based on a hash of the payload. Note that generated document IDs might not remain consistent over multiple imports. If you auto-generate IDs over multiple imports, Google highly recommends settingreconciliationMode
toFULL
to maintain consistent document IDs.Specify
autoGenerateIds
only whenbigquerySource.dataSchema
is set tocustom
. Otherwise anINVALID_ARGUMENT
error is returned. If you don't specifyautoGenerateIds
or set it tofalse
, you must specifyidField
. Otherwise the documents fail to import.ID_FIELD
: Optional. Specifies which fields are the document IDs. For BigQuery source files,idField
indicates the name of the column in the BigQuery table that contains the document IDs.Specify
idField
only when: (1)bigquerySource.dataSchema
is set tocustom
, and (2)auto_generate_ids
is set tofalse
or is unspecified. Otherwise anINVALID_ARGUMENT
error is returned.The value of the BigQuery column name must be of string type, must be between 1 and 63 characters, and must conform to RFC-1034. Otherwise, the documents fail to import.
C#
For more information, see the Vertex AI Agent Builder C# API reference documentation.
To authenticate to Vertex AI Agent Builder, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
This sample ingests unstructured data from either BigQuery or Cloud Storage into an existing data store.
Go
For more information, see the Vertex AI Agent Builder Go API reference documentation.
To authenticate to Vertex AI Agent Builder, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
This sample ingests unstructured data from either BigQuery or Cloud Storage into an existing data store.
Java
For more information, see the Vertex AI Agent Builder Java API reference documentation.
To authenticate to Vertex AI Agent Builder, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
This sample ingests unstructured data from either BigQuery or Cloud Storage into an existing data store.
Node.js
For more information, see the Vertex AI Agent Builder Node.js API reference documentation.
To authenticate to Vertex AI Agent Builder, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
This sample ingests unstructured data from either BigQuery or Cloud Storage into an existing data store.
Python
For more information, see the Vertex AI Agent Builder Python API reference documentation.
To authenticate to Vertex AI Agent Builder, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
This sample ingests unstructured data from either BigQuery or Cloud Storage into an existing data store.
Ruby
For more information, see the Vertex AI Agent Builder Ruby API reference documentation.
To authenticate to Vertex AI Agent Builder, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
This sample ingests unstructured data from either BigQuery or Cloud Storage into an existing data store.
Next steps
To attach your data store to an app, create an app and select your data store following the steps in Create a generic recommendations app.
To preview how your recommendations appear after your app and data store are set up, see Get recommendations.
Cloud Storage
To ingest data from Cloud Storage, use the following steps to create a data store and ingest data using either the Google Cloud console or the API.
Before importing your data, review Prepare data for ingesting.
Console
To use the console to ingest data from a Cloud Storage bucket, follow these steps:
In the Google Cloud console, go to the Agent Builder page.
Go to the Data Stores page.
Click New data store.
On the Type page, select Cloud Storage.
In the Select a folder or file you want to import section, select Folder or File.
Click Browse and choose the data you have prepared for ingesting, and then click Select. Alternatively, enter the location directly in the
gs://
field.Select what kind of data you are importing.
Click Continue.
If you are doing one-time import of structured data:
Map fields to key properties.
If there are important fields missing from the schema, use Add new field to add them.
For more information, see About auto-detect and edit.
Click Continue.
Choose a region for your data store.
Enter a name for your data store.
Click Create.
To confirm that your data store was created, go to the Data Stores page and click your data store name to see details about it on its Data page.
To check the status of your ingestion, go to the Data Stores page and click your data store name to see details about it on its Data page. When the status column on the Activity tab changes from In progress to Import completed, the ingestion is complete.
Depending on the size of your data, ingestion can take several minutes or several hours.
REST
To use the command line to create a data store and ingest data from Cloud Storage, follow these steps:
Create a data store.
curl -X POST \ -H "Authorization: Bearer $(gcloud auth print-access-token)" \ -H "Content-Type: application/json" \ -H "X-Goog-User-Project: PROJECT_ID" \ "https://discoveryengine.googleapis.com/v1alpha/projects/PROJECT_ID/locations/global/collections/default_collection/dataStores?dataStoreId=DATA_STORE_ID" \ -d '{ "displayName": "DATA_STORE_DISPLAY_NAME", "industryVertical": "GENERIC", "solutionTypes": ["SOLUTION_TYPE_RECOMMENDATION"], "contentConfig": "CONTENT_REQUIRED" }'
Replace the following:
PROJECT_ID
: the ID of your Google Cloud project.DATA_STORE_ID
: the ID of the recommendations data store that you want to create. This ID can contain only lowercase letters, digits, underscores, and hyphens.DATA_STORE_DISPLAY_NAME
: the display name of the recommendations data store that you want to create.
Import data from Cloud Storage.
curl -X POST \ -H "Authorization: Bearer $(gcloud auth print-access-token)" \ -H "Content-Type: application/json" \ "https://discoveryengine.googleapis.com/v1/projects/PROJECT_ID/locations/global/collections/default_collection/dataStores/DATA_STORE_ID/branches/0/documents:import" \ -d '{ "gcsSource": { "inputUris": ["INPUT_FILE_PATTERN_1", "INPUT_FILE_PATTERN_2"], "dataSchema": "DATA_SCHEMA", }, "reconciliationMode": "RECONCILIATION_MODE", "autoGenerateIds": "AUTO_GENERATE_IDS", "idField": "ID_FIELD", "errorConfig": { "gcsPrefix": "ERROR_DIRECTORY" } }'
Replace the following:
PROJECT_ID
: the ID of your Google Cloud project.DATA_STORE_ID
: the ID of the recommendations data store.INPUT_FILE_PATTERN
: a file pattern in Cloud Storage containing your documents.For structured data, or for unstructured data with metadata for unstructured documents, an example of the input file pattern is
gs://<your-gcs-bucket>/directory/object.json
, or a pattern matching one or more files, such asgs://<your-gcs-bucket>/directory/*.json
.For unstructured documents, an example is
gs://<your-gcs-bucket>/directory/*.pdf
. Each file that is matched by the pattern becomes a document.If
<your-gcs-bucket>
is not underPROJECT_ID
, you need to give the service accountservice-<project number>@gcp-sa-discoveryengine.iam.gserviceaccount.com
"Storage Object Viewer" permissions for the Cloud Storage bucket. For example, if you are importing a Cloud Storage bucket from source project "123" to destination project "456", giveservice-456@gcp-sa-discoveryengine.iam.gserviceaccount.com
permissions on the Cloud Storage bucket under project "123".DATA_SCHEMA
: Optional. Values aredocument
,custom
,csv
, andcontent
. The default isdocument
.document
: Upload unstructured data with metadata for unstructured documents. Each line of the file has to follow one of the following formats. You can define the ID of each document:{ "id": "<your-id>", "jsonData": "<JSON string>", "content": { "mimeType": "<application/pdf or text/html>", "uri": "gs://<your-gcs-bucket>/directory/filename.pdf" } }
{ "id": "<your-id>", "structData": <JSON object>, "content": { "mimeType": "<application/pdf or text/html>", "uri": "gs://<your-gcs-bucket>/directory/filename.pdf" } }
custom
: Upload JSON for structured documents. The data is organized according to a schema. You can specify the schema; otherwise it is auto-detected. You can put the JSON string of the document in a consistent format directly in each line, and Recommendations automatically generates the IDs for each document imported.content
: Upload unstructured documents (PDF, HTML, DOC, TXT, PPTX). The ID of each document is automatically generated as the first 128 bits of SHA256(GCS_URI) encoded as a hex string. You can specify multiple input file patterns as long as the matched files don't exceed the 100K files limit.csv
: Include a header row in your CSV file, with each header mapped to a document field. Specify the path to the CSV file using theinputUris
field.
ERROR_DIRECTORY
: Optional. A Cloud Storage directory for error information about the import—for example,gs://<your-gcs-bucket>/directory/import_errors
. Google recommends leaving this field empty to let Recommendations automatically create a temporary directory.RECONCILIATION_MODE
: Optional. Values areFULL
andINCREMENTAL
. Default isINCREMENTAL
. SpecifyingINCREMENTAL
causes an incremental refresh of data from Cloud Storage to your data store. This does an upsert operation, which adds new documents and replaces existing documents with updated documents with the same ID. SpecifyingFULL
causes a full rebase of the documents in your data store. In other words, new and updated documents are added to your data store, and documents that are not in Cloud Storage are removed from your data store. TheFULL
mode is helpful if you want to automatically delete documents that you no longer need.AUTO_GENERATE_IDS
: Optional. Specifies whether to automatically generate document IDs. If set totrue
, document IDs are generated based on a hash of the payload. Note that generated document IDs might not remain consistent over multiple imports. If you auto-generate IDs over multiple imports, Google highly recommends settingreconciliationMode
toFULL
to maintain consistent document IDs.Specify
autoGenerateIds
only whengcsSource.dataSchema
is set tocustom
orcsv
. Otherwise anINVALID_ARGUMENT
error is returned. If you don't specifyautoGenerateIds
or set it tofalse
, you must specifyidField
. Otherwise the documents fail to import.ID_FIELD
: Optional. Specifies which fields are the document IDs. For Cloud Storage source documents,idField
specifies the name in the JSON fields that are document IDs. For example, if{"my_id":"some_uuid"}
is the document ID field in one of your documents, specify"idField":"my_id"
. This identifies all JSON fields with the name"my_id"
as document IDs.Specify this field only when: (1)
gcsSource.dataSchema
is set tocustom
orcsv
, and (2)auto_generate_ids
is set tofalse
or is unspecified. Otherwise anINVALID_ARGUMENT
error is returned.Note that the value of the Cloud Storage JSON field must be of string type, must be between 1-63 characters, and must conform to RFC-1034. Otherwise, the documents fail to import.
Note that the JSON field name specified by
id_field
must be of string type, must be between 1 and 63 characters, and must conform to RFC-1034. Otherwise, the documents fail to import.
C#
For more information, see the Vertex AI Agent Builder C# API reference documentation.
To authenticate to Vertex AI Agent Builder, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
This sample ingests unstructured data from either BigQuery or Cloud Storage into an existing data store.
Go
For more information, see the Vertex AI Agent Builder Go API reference documentation.
To authenticate to Vertex AI Agent Builder, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
This sample ingests unstructured data from either BigQuery or Cloud Storage into an existing data store.
Java
For more information, see the Vertex AI Agent Builder Java API reference documentation.
To authenticate to Vertex AI Agent Builder, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
This sample ingests unstructured data from either BigQuery or Cloud Storage into an existing data store.
Node.js
For more information, see the Vertex AI Agent Builder Node.js API reference documentation.
To authenticate to Vertex AI Agent Builder, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
This sample ingests unstructured data from either BigQuery or Cloud Storage into an existing data store.
Python
For more information, see the Vertex AI Agent Builder Python API reference documentation.
To authenticate to Vertex AI Agent Builder, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
This sample ingests unstructured data from either BigQuery or Cloud Storage into an existing data store.
Ruby
For more information, see the Vertex AI Agent Builder Ruby API reference documentation.
To authenticate to Vertex AI Agent Builder, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
This sample ingests unstructured data from either BigQuery or Cloud Storage into an existing data store.
Next steps
To attach your data store to an app, create an app and select your data store following the steps in Create a generic recommendations app.
To preview how your recommendations appear after your app and data store are set up, see Get recommendations.
Upload structured JSON data with the API
To directly upload a JSON document or object using the API, follow these steps.
Before importing your data, Prepare data for ingesting.
REST
To use the command line to create a data store and import structured JSON data, follow these steps:
Create a data store.
curl -X POST \ -H "Authorization: Bearer $(gcloud auth print-access-token)" \ -H "Content-Type: application/json" \ -H "X-Goog-User-Project: PROJECT_ID" \ "https://discoveryengine.googleapis.com/v1alpha/projects/PROJECT_ID/locations/global/collections/default_collection/dataStores?dataStoreId=DATA_STORE_ID" \ -d '{ "displayName": "DATA_STORE_DISPLAY_NAME", "industryVertical": "GENERIC", "solutionTypes": ["SOLUTION_TYPE_RECOMMENDATION"] }'
Replace the following:
PROJECT_ID
: the ID of your Google Cloud project.DATA_STORE_ID
: the ID of the recommendations data store that you want to create. This ID can contain only lowercase letters, digits, underscores, and hyphens.DATA_STORE_DISPLAY_NAME
: the display name of the recommendations data store that you want to create.
Optional: Provide your own schema. When you provide a schema, you typically get better results. For more information, see Provide or auto-detect a schema.
curl -X PATCH \ -H "Authorization: Bearer $(gcloud auth print-access-token)" \ -H "Content-Type: application/json" \ "https://discoveryengine.googleapis.com/v1beta/projects/PROJECT_ID/locations/global/collections/default_collection/dataStores/DATA_STORE_ID/schemas/default_schema" \ -d '{ "structSchema": JSON_SCHEMA_OBJECT }'
Replace the following:
PROJECT_ID
: the ID of your Google Cloud project.DATA_STORE_ID
: the ID of the recommendations data store.JSON_SCHEMA_OBJECT
: your JSON schema as a JSON object—for example:{ "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "title": { "type": "string", "keyPropertyMapping": "title" }, "categories": { "type": "array", "items": { "type": "string", "keyPropertyMapping": "category" } }, "uri": { "type": "string", "keyPropertyMapping": "uri" } } }
Import structured data that conforms to the defined schema.
There are a few approaches that you can use to upload data, including:
Upload a JSON document.
curl -X POST \ -H "Authorization: Bearer $(gcloud auth print-access-token)" \ -H "Content-Type: application/json" \ "https://discoveryengine.googleapis.com/v1beta/projects/PROJECT_ID/locations/global/collections/default_collection/dataStores/DATA_STORE_ID/branches/0/documents?documentId=DOCUMENT_ID" \ -d '{ "jsonData": "JSON_DOCUMENT_STRING" }'
Replace
JSON_DOCUMENT_STRING
with the JSON document as a single string. This must conform to the JSON schema that you provided in the previous step—for example:```none { \"title\": \"test title\", \"categories\": [\"cat_1\", \"cat_2\"], \"uri\": \"test uri\"} ```
Upload a JSON object.
curl -X POST \ -H "Authorization: Bearer $(gcloud auth print-access-token)" \ -H "Content-Type: application/json" \ "https://discoveryengine.googleapis.com/v1beta/projects/PROJECT_ID/locations/global/collections/default_collection/dataStores/DATA_STORE_ID/branches/0/documents?documentId=DOCUMENT_ID" \ -d '{ "structData": JSON_DOCUMENT_OBJECT }'
Replace
JSON_DOCUMENT_OBJECT
with the JSON document as a JSON object. This must conform to the JSON schema that you provided in the previous step—for example:```json { "title": "test title", "categories": [ "cat_1", "cat_2" ], "uri": "test uri" } ```
Update with a JSON document.
curl -X PATCH \ -H "Authorization: Bearer $(gcloud auth print-access-token)" \ -H "Content-Type: application/json" \ "https://discoveryengine.googleapis.com/v1beta/projects/PROJECT_ID/locations/global/collections/default_collection/dataStores/DATA_STORE_ID/branches/0/documents/DOCUMENT_ID" \ -d '{ "jsonData": "JSON_DOCUMENT_STRING" }'
Update with a JSON object.
curl -X PATCH \ -H "Authorization: Bearer $(gcloud auth print-access-token)" \ -H "Content-Type: application/json" \ "https://discoveryengine.googleapis.com/v1beta/projects/PROJECT_ID/locations/global/collections/default_collection/dataStores/DATA_STORE_ID/branches/0/documents/DOCUMENT_ID" \ -d '{ "structData": JSON_DOCUMENT_OBJECT }'
Next steps
To attach your data store to an app, create an app and select your data store following the steps in Create a generic recommendations app.
To preview how your recommendations appear after your app and data store are set up, see Get recommendations.
Create a data store using Terraform
You can use Terraform to create an empty data store. After the empty data store is created, you can ingest data into the data store using the Google Cloud console or API commands.
To learn how to apply or remove a Terraform configuration, see Basic Terraform commands.
To create an empty data store using Terraform, see
google_discovery_engine_data_store
.