Create semantic filters for generative AI requests and responses to help filter out sensitive topics during interactions with generative AI in Virtual Agent.
Before you begin
You must have a Virtual Agent topic to switch to when a filter detects unwanted material. Examples include a text output topic signaling that an error has occurred or a topic that transfers the user to a Live Agent. The topic must be published and active.
Role required: admin
About this task
To help prevent generative AI conversations about sensitive topics, you can use semantic filtering to help identify phrases in Virtual Agent conversations. Identify material that you don't want to be included in a request or response of an LLM and add filters to remove that material. AI Semantic Search can be used to help determine if sensitive content is being discussed and trigger a switch to a designated Virtual Agent topic.
Procedure
-
In the navigator, go to the Generative AI Filter Group [sys_gen_ai_filter_group] table by entering sys_gen_ai_filter_group.list.
If you have Now Assist for HR Service Delivery (HRSD), there may be groups already created for you. You can add to these groups or create your own. If you don't have Now Assist for HRSD, you can still create your own.
-
Select New.
-
In the Name field, enter a name for the group.
-
In the Description field, enter a description for the group.
A filter group description could start with "This filter includes workplace issues/concerns such as employee well-being, fairness, and ethics." You could then add examples of these workplace issues/concerns in the
description for this category of sensitive material.
-
Select Submit to create the group.
-
In the navigator, go to the Generative AI Filter [sys_gen_ai_filter] table by entering sys_gen_ai_filter.list.
-
Select New.
-
In the Filter group category, choose a Generative AI Filter Group.
- Optional:
In the Filter configuration field, use the "portal" value to determine when the filter should be run, such as setting “portal” to “sp” to only apply the filter on the sp portal.
Use a comma-separated list to select multiple values.
-
In the Filter Threshold field, set the cutoff for determining when the LLM should generate the filter error.
The lower the value, the more sensitive the filter. Experiment with different filter thresholds to help set your preferred boundaries.
-
For the Order field, choose the order to apply the filters.
Filters are processed by lowest order to highest. A filter with order 100 is processed before a filter with order 200.
-
In the Description field, enter a description of the filter.
Like the Generative AI Filter Group record, the more descriptive you are, the more likely that the LLM will understand the purpose of the filter.
-
Set the Filter Error Topic to the topic that should run when the filter detects unwanted content, such as a Transfer to Live Agent topic or Error Handling Topic.
-
Select Apply to all to apply the filter to all capabilities (Summarize, Generate Content, etc.).
Important: If you did not select Apply to all, you need to create a Generative AI Filter Config record to map the filter to the capability. See the additional steps below to create the
mapping.
-
Select Submit to create the filter.
-
To map a filter to a capability, create a Generative AI Filter Config record.
-
In the navigator, go to the Generative AI Filter Config [sys_gen_ai_filter_config] table by entering sys_gen_ai_filter_config.list.
-
Select New.
-
In the Config Table field, select OneExtend Capability [sys_one_extend_capability].
-
In the Config ID field, select the list lookup icon (
) to select a Config.
-
In the Document field, select the capability you would like the filter to apply to.
If you want the filter to apply to some but not all capabilities, you need to create a Generative AI Filter Config record for each capability.
-
Select OK to make your selection and close the modal.
-
Select Submit.
-
In the navigator, go to the Generative AI Filter Sample [sys_gen_ai_filter_sample] table by entering sys_gen_ai_filter_sample.
-
Select New to create a sample.
-
In the Sample Text field, enter an example of what you want the filter to detect.
Each sample can be short, and having more sample records helps AI Semantic Search determine what the filter should catch. If you find that certain terms or statements aren't being caught by your filter, you can try
adding more examples to see if the filter improves.
-
To enable the filter on an attribute, go to the OneExtend Capability [sys_one_extend_capability] table by entering sys_one_extend_capability.list.
After you have created the Generative AI Filter Group, Generative AI Filter, and Generative AI Filter Samples, you need to enable the filter on an attribute for the capability you are configuring.
-
Open the record for the capability.
-
Set the Apply Filter field to true to apply the filter.
-
Repeat for each capability you want the filter to be on.
Result
Semantic filtering is now available for the capability on the attribute you configured.
What to do next
Configure sensitive data handling to replace personally identifiable information with placeholder text in requests sent to the LLM.