Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Erste Schritte mit benutzerdefinierten Empfehlungen
Sie können schnell eine hochmoderne benutzerdefinierte Empfehlungsanwendung auf Basis Ihrer eigenen Daten erstellen, die ähnliche Inhalte wie die vom Nutzer gerade angezeigten Inhalte vorschlägt.
In dieser Anleitung wird erläutert, wie Sie eine benutzerdefinierte Empfehlungsanwendung für strukturierte Daten erstellen. In diesem Fall haben die strukturierten Daten das Format NDJSON und wurden aus einem Cloud Storage-Bucket aufgenommen.
Bevor Sie mit dieser Anleitung beginnen, führen Sie die Schritte unter Bevor Sie beginnen aus.
Eine detaillierte Anleitung dazu finden Sie direkt in der Google Cloud Console. Klicken Sie dazu einfach auf Anleitung:
Sign in to your Google Cloud account. If you're new to
Google Cloud,
create an account to evaluate how our products perform in
real-world scenarios. New customers also get $300 in free credits to
run, test, and deploy workloads.
In the Google Cloud console, on the project selector page,
select or create a Google Cloud project.
Dieser Cloud Storage-Bucket enthält eine NDJSON-formatiertes Datei mit Filmen, die von Kaggle zur Verfügung gestellt werden.
Klicken Sie auf Weiter.
Weisen Sie die wichtigsten Attribute so zu:
Feldname
Schlüsselattribut
homepage
uri
overview
description
Und klicken Sie auf Weiter.
Geben Sie einen Anzeigenamen für den Datenspeicher ein und klicken Sie auf Erstellen.
Klicken Sie auf den Namen des Datenspeichers.
Wechseln Sie auf der Seite Daten zum Tab Aktivität, um den Status der Datenaufnahme zu sehen. In der Spalte Status wird Import abgeschlossen angezeigt, wenn der Importvorgang abgeschlossen ist. Bei diesem Dataset dauert dies in der Regel zwei bis drei Minuten. Möglicherweise müssen Sie auf Aktualisieren klicken, damit Import abgeschlossen angezeigt wird.
Klicken Sie auf den Tab Dokumente, um die importierten Dokumente aufzurufen.
App erstellen
Als Nächstes erstellen Sie eine Empfehlungs-App und verknüpfen den zuvor erstellten Datenspeicher.
Gehen Sie auf die Seite Apps
Klicken Sie auf App erstellen.
Klicken Sie auf der Seite App erstellen unter Empfehlungsmechanismus auf Erstellen.
Geben Sie im Feld Anwendungsname einen Namen für die Anwendung ein. Die Anwendungs-ID wird unter dem Namen der Anwendung angezeigt.
Klicken Sie auf Weiter.
Wählen Sie in der Liste den Datenspeicher aus, den Sie zuvor erstellt haben.
Klicken Sie auf Erstellen.
App als Vorschau
Klicken Sie im Navigationsmenü auf Vorschau, um die Anwendung zu testen.
Wenn Sie die Meldung „Sie werden hier auf eine Vorschau Ihres Empfehlungssystems zugreifen können, aber die Engine wird noch vorbereitet. Bitte versuchen Sie es später noch einmal.“ sehen, warten Sie und aktualisieren Sie die Seite regelmäßig. Möglicherweise müssen Sie einige Stunden oder bis zum nächsten Tag warten, um eine Vorschau der Daten zu sehen.
Klicken Sie auf das Feld Dokument-ID. Eine Liste der Dokument-IDs wird angezeigt.
Klicken Sie auf die ID des Dokuments, für das Sie Empfehlungen erhalten möchten.
Alternativ können Sie eine Dokument-ID in das Feld Dokument-ID eingeben.
Klicken Sie auf Empfehlungen erhalten. Eine Liste mit empfohlenen Dokumenten wird angezeigt.
Klicken Sie auf ein Dokument, um Details dazu abzurufen.
Anwendung bereitstellen
Es gibt kein Empfehlungs-Widget für die Bereitstellung Ihrer App. So testen Sie Ihre Anwendung vor der Bereitstellung:
Rufen Sie die Seite Daten auf und kopieren Sie die ID eines Dokuments.
Rufen Sie die Seite Einbindung auf. Diese Seite enthält einen Beispielbefehl für die Methode servingConfigs.recommend in der REST API.
Fügen Sie die zuvor kopierte Dokument-ID in das Feld Dokument-ID ein.
Lassen Sie das Feld Pseudo-ID des Nutzers unverändert.
Kopieren Sie die Beispielanfrage und führen Sie sie in Cloud Shell aus.
Die Ergebnisse sind die IDs der Dokumente, die auf Grundlage des von Ihnen ausgewählten Dokuments empfohlen werden.
Informationen zur Integration der Empfehlungsanwendung in Ihre Webanwendung finden Sie in den Codebeispielen für C#, Go, Java, Node.js, PHP und Ruby im Abschnitt Empfehlungen für eine strukturierte Anwendung erhalten.
Bereinigen
Mit den folgenden Schritten vermeiden Sie, dass Ihrem Google Cloud -Konto die auf dieser Seite verwendeten Ressourcen in Rechnung gestellt werden:
Löschen Sie das Projekt mitGoogle Cloud console , wenn Sie es nicht benötigen, um unnötige Google Cloud Kosten zu vermeiden.
Wenn Sie ein neues Projekt erstellt haben, um mehr über die KI-Anwendungen zu erfahren, und dieses Projekt nicht mehr benötigen, löschen Sie das Projekt.
Wenn Sie ein vorhandenes Google Cloud Projekt verwendet haben, löschen Sie die von Ihnen erstellten Ressourcen. So vermeiden Sie, dass Ihrem Konto Gebühren in Rechnung gestellt werden: Weitere Informationen finden Sie im Abschnitt Anwendung löschen.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-08-19 (UTC)."],[[["\u003cp\u003eThis tutorial guides you through building a generic recommendations app that suggests content similar to what users are currently viewing, utilizing structured data in NDJSON format from a Cloud Storage bucket.\u003c/p\u003e\n"],["\u003cp\u003eBefore starting, you must enable Vertex AI Agent Builder and follow the steps outlined in the "Before you begin" section.\u003c/p\u003e\n"],["\u003cp\u003eYou will learn to create a data store by importing structured data (JSONL) from a specified Cloud Storage bucket containing movie metadata, then configure key properties to map data fields.\u003c/p\u003e\n"],["\u003cp\u003eThe tutorial also covers the creation of a recommendations app, linking it to the previously created data store, and using the preview feature to test the recommendations engine.\u003c/p\u003e\n"],["\u003cp\u003eThe final steps involve demonstrating how to deploy your app, including using the REST API's \u003ccode\u003eservingConfigs.recommend\u003c/code\u003e method to get document recommendations, as well as cleaning up resources to avoid unnecessary charges.\u003c/p\u003e\n"]]],[],null,["# Get started with custom recommendations\n=======================================\n\n| **Note:** This feature is a Preview offering, subject to the \"Pre-GA Offerings Terms\" of the [GCP Service Specific Terms](https://cloud.google.com/terms/service-terms). Pre-GA products and features may have limited support, and changes to pre-GA products and features may not be compatible with other pre-GA versions. For more information, see the [launch stage descriptions](https://cloud.google.com/products#product-launch-stages). Further, by using this feature, you agree to the [Generative AI Preview terms and conditions](https://cloud.google.com/trustedtester/aitos) (\"Preview Terms\"). For this feature, you can process personal data as outlined in the [Cloud Data Processing Addendum](https://cloud.google.com/terms/data-processing-terms), subject to applicable restrictions and obligations in the Agreement (as defined in the Preview Terms).\n|\n| \u003cbr /\u003e\n|\nYou can quickly build a state-of-the-art custom recommendations app on your own\ndata that can suggest content similar to the content that the user is currently\nviewing.\n\nThis tutorial explains how to create a custom recommendations app for\nstructured data. In this case, the structured data is in the form of NDJSON\ningested from a Cloud Storage bucket.\n\nBefore following this tutorial, make sure you have done the steps in [Before you\nbegin](/generative-ai-app-builder/docs/before-you-begin).\n\n*** ** * ** ***\n\nTo follow step-by-step guidance for this task directly in the\nGoogle Cloud console, click **Guide me**:\n\n[Guide me](https://console.cloud.google.com/gen-app-builder/?tutorial=generative-ai-app-builder--genappbuilder-recommendations-intro)\n\n*** ** * ** ***\n\nBefore you begin\n----------------\n\n- Sign in to your Google Cloud account. If you're new to Google Cloud, [create an account](https://console.cloud.google.com/freetrial) to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.\n- In the Google Cloud console, on the project selector page,\n select or create a Google Cloud project.\n\n | **Note**: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.\n\n [Go to project selector](https://console.cloud.google.com/projectselector2/home/dashboard)\n-\n [Verify that billing is enabled for your Google Cloud project](/billing/docs/how-to/verify-billing-enabled#confirm_billing_is_enabled_on_a_project).\n\n-\n\n\n Enable the AI Applications, Cloud Storage APIs.\n\n\n [Enable the APIs](https://console.cloud.google.com/flows/enableapi?apiid=discoveryengine.googleapis.com,storage.googleapis.com)\n\n- In the Google Cloud console, on the project selector page,\n select or create a Google Cloud project.\n\n | **Note**: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.\n\n [Go to project selector](https://console.cloud.google.com/projectselector2/home/dashboard)\n-\n [Verify that billing is enabled for your Google Cloud project](/billing/docs/how-to/verify-billing-enabled#confirm_billing_is_enabled_on_a_project).\n\n-\n\n\n Enable the AI Applications, Cloud Storage APIs.\n\n\n [Enable the APIs](https://console.cloud.google.com/flows/enableapi?apiid=discoveryengine.googleapis.com,storage.googleapis.com)\n\n\u003cbr /\u003e\n\nEnable AI Applications\n----------------------\n\n1. In the Google Cloud console, go to the **AI Applications** page.\n\n [AI Applications](https://console.cloud.google.com/gen-app-builder/start)\n2. Optional: Click **Allow Google to selectively sample model input and\n responses**.\n\n3. Click **Continue and activate the API**.\n\nCreate a data store\n-------------------\n\nThis procedure guides you through creating a data store and uploading sample\ndata provided.\n\n1. Go to the **Data Stores** page.\n\n2. Click **Create data store**.\n\n3. On the **Select a data source** page, select **Cloud Storage**.\n\n4. On the **Import data from Cloud Storage** page, select **Structured\n data (JSONL)**.\n\n5. Click **File**.\n\n6. In the **gs://** field, enter the following value:\n\n ```\n cloud-samples-data/gen-app-builder/search/kaggle_movies/movie_metadata.ndjson\n ```\n\n This Cloud Storage bucket contains an NDJSON-formatted file of movies\n made available by\n [Kaggle](https://www.kaggle.com/datasets/rounakbanik/the-movies-dataset?select=movies_metadata.csv).\n7. Click **Continue**.\n\n8. Assign key properties as follows:\n\n And, click **Continue**.\n9. Enter a display name for your data store, and then click **Create**.\n\n10. Click the name of your data store.\n\n11. On the **Data** page, go to the **Activity** tab to see the\n status of your data ingestion. **Import completed** displays in the\n **Status** column when the import process is complete. For this dataset,\n this typically takes two to three minutes. You might need to click\n **Refresh** to see **Import completed**.\n\n12. Click the **Documents** tab to see the imported documents.\n\nCreate an app\n-------------\n\nNext, you create a recommendations app and link the data store you created previously.\n\n1. Go to the **Apps** page.\n\n2. Click **Create app**.\n\n3. On the **Create App** page, under **Recommendations engine** , click **Create**.\n\n4. In the **App name** field, enter a name for your app. Your app ID\n appears under the app name.\n\n5. Click **Continue**.\n\n6. In the list of data stores, select the data store that you created earlier.\n\n7. Click **Create**.\n\n### Preview your app\n\n1. In the navigation menu, click\n **Preview**\n to test the app.\n\n2. If you see the message \"You will be able to preview your recommendation\n engine here We are still preparing your engine, please check back\n later\", wait and periodically refresh the page. You might have to wait\n some hours or until the next day to preview your data.\n\n3. Click the **Document ID** field. A list of document IDs appears.\n\n4. Click the document ID for the document that you want recommendations for.\n Alternatively, enter a document ID into the **Document ID** field.\n\n5. Click **Get recommendations**. A list of recommended documents appears.\n\n6. Click a document to get document details.\n\n### Deploy your app\n\nThere is no recommendations widget for deploying your app. To test your app\nbefore deployment:\n\n1. Go to the **Data** page and copy a document **ID**.\n\n2. Go to the **Integration** page. This page includes a sample command for the\n [`servingConfigs.recommend`](/generative-ai-app-builder/docs/reference/rest/v1beta/projects.locations.dataStores.servingConfigs/recommend) method in the REST API.\n\n3. Paste the document ID you copied earlier into the **Document ID** field.\n\n4. Leave the **User Pseudo ID** field as is.\n\n5. Copy the example request and run it in Cloud Shell.\n\n The results are the IDs of documents recommended based on the document that you chose.\n\nFor help integrating the recommendations app into your web app,\nsee the code samples for C#, Go, Java, Node.js, PHP, and Ruby at\n[Get recommendations for an app](/generative-ai-app-builder/docs/preview-recommendations).\n\nClean up\n--------\n\n\nTo avoid incurring charges to your Google Cloud account for\nthe resources used on this page, follow these steps.\n\n1. To avoid unnecessary Google Cloud charges, use the [Google Cloud console](https://console.cloud.google.com/) to delete your project if you don't need it.\n2. If you created a new project to learn about AI Applications and you no longer need the project, [delete the project](https://console.cloud.google.com/cloud-resource-manager).\n3. If you used an existing Google Cloud project, delete the resources you created to avoid incurring charges to your account. For more information, see [Delete an app](/generative-ai-app-builder/docs/delete-engine).\n4. Follow the steps in [Turn off\n Vertex AI Search](/generative-ai-app-builder/docs/turn-off-enterprise-search).\n\nWhat's next\n-----------\n\n- [Introduction to Vertex AI Search](/generative-ai-app-builder/docs/enterprise-search-introduction)\n- [About apps and data stores](/generative-ai-app-builder/docs/create-datastore-ingest)"]]