Retail prebuilt agent

The Retail prebuilt agent allows users to search for items, get product recommendations, and place an order.

Sample dialogs

The following sample dialogs demonstrate common scenarios handled by this prebuilt agent.

Search products and purchase items

User asks about watches available in the store. The agent recommends products that meet this criteria, and the user adds them to their shopping cart. The user confirms that they would like to place an order, and the agent confirms the order with a confirmation number. The user then requests phone recommendations and the agent suggests phones, adds one to the user's cart, and places an order for the user.

User input Agent response
hi
Hi, I'm your Google shopping assistant. I can help you search for items and place orders. How can I help you today?
what watches do you have
We have the Google Watch. Would you like to add it to your cart?
yes add two please
You got it. I've added two Google Watches to your cart. Anything else?
can you add one Google Pixel 8 to my cart as well?
You got it. I've added one Google Pixel 8 to your cart. Anything else?
what's in my cart?
You have one Google Pixel 8 and two Google Watches in your cart. Would you like to check out?
yes please
Okay, I've placed an order containing one Google Pixel 8 and two Google Watches. Your confirmation number is QKA67DW2.
Is there anything else I can help you with today?
actually can you help me find a new phone too?
We have the Google Phone Pixel 8, and Google Phone Pixel 7, would you like to purchase one of these?
yes, give me a Pixel 8
You got it. I've added one Google Phone Pixel 8 to your cart. Anything else?
no we can check out
You have one Google Phone Pixel 8 in your cart. Would you like to check out using this cart?
yes
Okay, I've placed an order for you. Your order contains one Google Phone Pixel 8. Your confirmation number is Y43KTF0T.
Is there anything else I can help you with today?
no that's all for me, thanks
Okay, thank you for shopping with Google! Have a nice day.

Cart management

The user asks to add some items to their cart, then removes one before placing an order.

User input Agent response
hi I want to buy a phone
We have the Google Phone Pixel 8 and Google Phone Pixel 7. Which one would you like to purchase?
give me two of the 8
You got it. I've added two Google Phone Pixel 8 to your cart. Anything else?
actually can you remove one of them?
Sure, I've removed one Google Phone Pixel 8 from your cart. Anything else?
I'm ready to place my order
Okay, I've placed an order containing one Google Phone Pixel 8. Your confirmation number is X0KP6K5T.
Is there anything else I can help you with today?
no, that's it
Okay, thank you for shopping with Google! Have a nice day.

Product not found

The user asks about a product that is not carried by the store.

User input Agent response
hi
Hi, I'm your Google shopping assistant. I can help you search for items and place orders. How can I help you today?
I want to buy a car
Sorry, we don't have any cars in stock. Is there anything else you'd like to find?
yeah, what about watches?
We have the Google Watch. Would you like to add it to your cart?
no thanks
Is there anything else I can help you with today?
nope
Okay, thank you for shopping with Google! Have a nice day.

Unrecognized input

User asks about a topic unrelated to products or ordering. Agent responds by repeating what topics the agent covers, and asks the user what they would like help with.

User input Agent response
hi
Hi, I'm your Google shopping assistant. I can help you search for items and place orders. How can I help you today?
I want to book a hotel
Sorry, I can't help you with that. I can help you search for products including phones, watches, and headphones. I can also help you place orders. How can I help you today?

Basic setup

To set up this prebuilt agent:

  1. Import the prebuilt agent.
  2. Configure the provided tools with your external services, see Tool setup.

Tool setup

This agent includes tools that are used to integrate with external services. You can use the prebuilt tool installer to deploy sample code and data for your prebuilt agent.

To deploy and configure sample code and data for the Retail prebuilt agent, expand for instructions.

  1. Download the prebuilt tool installer to a local directory.
  2. Navigate to the local directory where you downloaded installer.zip.
  3. Unzip installer.zip and open the installer folder.
  4. Review README.md for a detailed overview of the installer and its requirements.
  5. Run pip install -r requirements.txt to install requirements.
  6. Run gcloud auth application-default login to authenticate using gcloud auth.
  7. Run the installer using python installer.py --project-id=YOUR_GCP_PROJECT_ID --prebuilt-id=retail
  8. After deploying all required services, configure each tool in the prebuilt agent with the provided URL(s) logged by the installer:

    Vertex AI Search and Conversation

    1. If you have not yet imported the prebuilt agent, import the agent into your project.
    2. In the Agent Builder console, go to the Search and Conversation page.

      Search and Conversation

    3. Select your project from the console drop-down.
    4. Select your app.
    5. Click on the icon for Tools.
    6. For each tool in the agent, edit the schema to replace the URL in the servers: field with the endpoint logged by the installer.
    7. Click Save.

    Dialogflow CX

    1. If you have not yet imported the prebuilt agent, import the agent into your project.
    2. Open the Dialogflow CX Console.
    3. Choose your Google Cloud project.
    4. Select your agent.
    5. Click on the icon for Generative resources.
    6. Click Tools.
    7. For each tool in the agent, edit the schema to replace the URL in the servers field with the endpoint logged by the installer.
    8. Click Save.

Google Store API

The Google Store API tool is used to fetch items from the Google Store based on a search term.

Manage shopping cart

The Manage Shopping Cart tool allows the user to manage their shopping cart by viewing all items in the cart, adding items to the cart, and removing items from the cart.

Place order

The Place Order tool is used to place an order with the user's current shopping cart and returns a confirmation number for the order placed.

Complete

Your agent and its integrations should now be set up and ready to test.