Adding a use case to GenerativeAgent involves creating a Task that represents the business scenario you want your agent to handle, along with the Functions that enable it to perform the necessary actions.
Tasks represent use cases - they define what GenerativeAgent can accomplish for your customers. Functions are the tools that enable those tasks by connecting to your backend systems.

Step 1: Define Your Use Case

Start by clearly defining the business scenario you want GenerativeAgent to handle:
  • Customer goal: What does the customer want to accomplish?
  • Business context: What type of issue or request is this?
  • Success criteria: How do you know when the task is complete?
  • Required actions: What backend operations are needed?
Customer goal: “I want to check where my order is”Business context: Customer service inquiry about order trackingSuccess criteria: Customer receives current order status and tracking informationRequired actions: Look up order details, retrieve tracking information, provide status update
Customer goal: “I need to book a doctor’s appointment”Business context: Healthcare appointment bookingSuccess criteria: Customer has a confirmed appointment with detailsRequired actions: Check availability, book appointment, send confirmation

Step 2: Create the Task

Navigate to the Tasks page and create a new task that represents your use case:
1

Navigate to Tasks

Go to the Tasks page in your GenerativeAgent configuration.
2

Create New Task

Click “Create task” to start defining your use case.
3

Define Task Details

Provide the following information:
  • Task name: Clear, descriptive name for your use case
  • Task selector description: How GenerativeAgent identifies when to use this task
  • Task message (optional): Initial response when this task is selected
  • General Instructions: Detailed guidance on how to handle this use case
  • Functions: Select the functions this task should use
GenerativeAgent Task creation interface
4

Write Task Instructions

This is the most critical part of creating a successful use case. Your task instructions determine how GenerativeAgent behaves and whether it handles your use case correctly.Effective task instructions should:
  • Be specific and actionable: Tell GenerativeAgent exactly what to do in each scenario
  • Include examples: Provide common customer requests and expected responses
  • Plan for edge cases: Define what to do when things go wrong
  • Set clear boundaries: Specify when to escalate to human agents
Need help writing effective instructions? See our comprehensive guides:
5

Configure Knowledge Base Filtering

Specify knowledge base metadata to restrict GenerativeAgent to using only articles with matching metadata for this specific use case.This helps ensure GenerativeAgent uses the most relevant information for each specific use case, improving accuracy and reducing irrelevant responses.
If you followed the Build your first GenerativeAgent guide, you already have a Knowledge Base imported.Otherwise you can connect your knowledge base now.

Step 3: Create Required Functions

Functions enable GenerativeAgent to perform actions similar to a live agent. For each action your use case requires, create the appropriate function.

Available Function Types

Creating Functions

1

Navigate to Functions

Go to the Functions page in your GenerativeAgent configuration.
2

Create New Function

Click “Create Function” to start defining your function.
3

Define Function Details

Provide the following information:
  • Function name: Clear, descriptive name for the function
  • Description: How GenerativeAgent should use this function
  • API Connection: The backend system this function connects to
4

Choose Function Type

Select the appropriate function type based on your use case needs:
For functions that need to interact with your live backend systems.
  1. Select an existing API connection
  2. Choose the API version if multiple are available
  3. Save the function
GenerativeAgent will call the real API during customer interactions.

Step 4: Connect Functions to Your Task

Once you’ve created the necessary functions, connect them to your task:
  1. Return to your task configuration
  2. Select the functions this task should use
  3. Ensure the functions align with the actions your use case requires
  4. Test the task with the Previewer to verify everything works correctly

Step 5: Test Your Use Case

Use the Previewer tool to test your new use case:
1

Access the Previewer

Navigate to the Previewer in your GenerativeAgent configuration.
2

Test Realistic Scenarios

Create test conversations that represent how customers would interact with your use case. Use Test Scenarios to define customer profiles and test different edge cases.
3

Verify Function Execution

Ensure all functions are called correctly and return expected results.
4

Refine as Needed

Make adjustments to task instructions or function configurations based on test results.

Next Steps