Skip to content

Chapter 1: Goal and preparation

In this use case you’ll build a customer service system for an online shop. Each enquiry first goes through an agent that classifies it into one of three levels, and then a specialised agent handles it:

LevelWhich enquiries it handlesHow it resolves them
Level 1General questions: shipping, returns, opening hours…It looks for the answer in a document with the shop’s policies.
Level 2The status of an order or product detailsIt queries the shop’s API.
Level 3Returns, or cases where the customer asks to speak to a personIt alerts the support team on Telegram and tells the customer.

This is an advanced case: it’s best to do the email and calendar assistant first, which explains how an agent uses tools.

What you need

  • A document with the shop’s policies saved in Google Drive, for example a PDF.
  • The address of your shop’s orders API and, if it requires one, its key.
  • A Telegram bot and the support team’s chat it will send alerts to.

Prepare the credentials

In Credentials, create these three. If it’s your first time, see Credentials.

ServiceExample nameWhat to fill in
Google GeminiShop GeminiYour Gemini key in Google Api Key. The models and the document search will use it.
Google DriveShop DriveLeave NappAI in Select Project, choose Read Only access and click Sign in with Google.
Telegram bot APISupport botYour bot’s token in Telegram bot token. BotFather gives it to you when you create the bot.

The shop’s API doesn’t need a credential: if it asks for a key, you’ll type it into the component that calls it, in chapter 3.

In the next chapter you’ll create the knowledge base with the policies document.