Create a generic recommendations app

This page describes how to create a generic recommendations app.

Console

To use the Google Cloud console to create a generic recommendations app, follow these steps:

  1. In the Google Cloud console, go to the Agent Builder page.

    Agent Builder

  2. On the Apps page, click New app.

  3. On the Create app page, select Recommendations.

  4. In the Your app name field, enter a name for your app. Your app ID appears under the engine name.

  5. Optional: Click Edit to edit your app ID.

  6. Under Content, make sure Generic is selected.

  7. Click Continue.

  8. Connect a data store to your app. You can select a data store that you previously created or create a new data store. Do one of the following:

    • Select an existing data store, if one is available. A data store can be attached to only one app, and it can't be removed from the app later.

    • Create a new data store and ingest data into it. Do this by clicking Create new data store and following the steps in the Create a new data store pane that opens. Then select your new data store. For more information about creating a data store, see Create a Recommendations data store.

  9. Click Create.

REST

Before you use the command line to create an app, you must have an existing data store. If you don't have a data store, create one following the steps in Create a Recommendations data store.

To use the command line to create a recommendations app, follow these steps:

  1. Find your data store ID. If you already have your data store ID, skip to the next step.

    1. In the Google Cloud console, go to the Agent Builder page and in the navigation menu, click Data stores.

      Go to the Data stores page

    2. Click the name of your data store.

    3. On the Data page for your data store, get the data store ID.

  2. Create an app and connect it to a data store. A data store can be attached to only one app and can't be removed from the app later.

    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/engines?engineId=APP_ID" \
    -d '{
      "displayName": "APP_DISPLAY_NAME",
      "dataStoreIds": ["DATA_STORE_ID"],
      "solutionType": ["SOLUTION_TYPE_RECOMMENDATION"],
      "similarDocumentsConfig": {}
    }'
    

    Replace the following:

    • PROJECT_ID: the ID of your Google Cloud project.
    • APP_ID: the ID of the recommendations app that you want to create.
    • APP_DISPLAY_NAME: the display name of the recommendations app that you want to create.
    • DATA_STORE_ID: the ID of an existing recommendations data store that you want to add to the recommendations app.

What's next