For the complete documentation index, see llms.txt. This page is also available as Markdown.

Knowledge Base Label Filtering

Set label filtering conditions once for an AI Assistant so it references only files with matching labels across all conversation platforms

Knowledge Base label filtering lets you configure a default set of label conditions for each AI Assistant. Once configured, the assistant references only files and FAQs that match the conditions when answering questions and ignores all other content. The same rules apply whether users ask questions through Web Chat, LINE, the API, or back-office conversations.

When label filtering is not configured, the assistant references all files in every mounted Knowledge Base, exactly as it did before.

Previously, limiting an assistant to files with specific labels required passing query metadata with every API call or configuring contacts individually. Now you only need to configure it once on the assistant settings page.

Use Case

A retail chain's Knowledge Base contains public return and exchange policies, a membership points program, and store-opening and cashier SOPs intended only for employees. The Knowledge Base administrator adds the "Public for Customer Service" label to public documents and the "Internal Operations" label to internal documents. On the customer service assistant's settings page, the administrator then enables "Label Filtering," selects "Public for Customer Service," and saves the settings. From then on, the assistant cites only public documents when customers ask questions through the website's Web Chat or LINE. Even if a customer asks about store-opening procedures, the assistant cannot find the internal SOP and will not disclose internal information. No integration code changes are required.

Prerequisites

  • The assistant has at least one mounted Knowledge Base (configured under "Knowledge Base Settings" on the assistant settings page).

  • Labels have been created in the Knowledge Base and applied to files or FAQs. For instructions on creating and applying labels, see Document Management: Tags and Metadata.

Available labels come from the Knowledge Bases mounted by this assistant. If the assistant has multiple mounted Knowledge Bases, the same set of conditions applies to all of them.

Configure Label Filtering

1

In the left menu, click "AI Assistants," select the assistant you want to configure, and open "Settings."

2

Under "Knowledge and Data," click "Label Filtering." The scope appears in the upper-right corner, showing the Knowledge Bases currently mounted by this assistant.

The label filtering section on the AI Assistant settings page before any conditions have been added
When no conditions are configured, the assistant references all files
3

Under "Condition Group 1," click labels to add them to the condition. You can add multiple labels and choose "Include All Labels" or "Include Any Label" to determine how the group is evaluated.

4

Scroll down to the "Affected Files" panel to confirm which files will be retrieved and which will be excluded. The panel calculates the result in real time based on the conditions currently shown, including unsaved changes.

After adding the Public for Customer Service label, the Affected Files panel shows that 3 of 4 files can be retrieved
After a label is added, the plain-language description and Affected Files panel update in real time
5

Click "Save" in the lower-right corner. After saving, "Configured" appears next to "Label Filtering" in the left menu.

How to Read Conditions

The builder describes conditions in plain language instead of displaying AND/OR. This guide includes the corresponding logic in parentheses for comparison with the previous interface or API documentation. Conditions have two levels: "within a group" and "between groups."

Level
Option
Meaning

Within a group (between labels in the same condition group)

Include All Labels (AND)

A file must have every label listed in the group

Within a group

Include Any Label (OR)

A file only needs one of the labels in the group

Between groups (between multiple condition groups)

Match Every Group (AND)

A file must satisfy every condition group

Between groups

Match Any Group (OR)

A file only needs to satisfy one condition group

For combinations such as "A or B," click "Add Condition Group" to add another group. The "For Multiple Groups" selector appears only when there are two or more groups.

Two condition groups joined with Match Any Group
Two condition groups: files labeled "Public for Customer Service" or files labeled "Internal Operations"

At the bottom of the builder, a sentence describes the current conditions, such as: "The assistant will only reference files labeled 'Public for Customer Service' or 'Internal Operations.'" If you are unsure whether the conditions are correct, refer to this sentence and the "Affected Files" panel.

The "Affected Files" panel counts files that have been loaded on the page. If the Knowledge Base contains many files, the panel displays "Only the first N loaded files are counted." Actual retrieval still applies the conditions to all files.

Scope and Priority

The assistant's label filtering acts as a "default" for all conversations handled through that assistant, including Web Chat, conversation platforms such as LINE, API integrations, and back-office conversations.

If query metadata has already been specified at another level for a conversation, that level takes precedence and the assistant default is not used. The priority from highest to lowest is:

  1. Query metadata passed with an individual message (for example, in an API call or Web Chat embed)

  2. Conversation-level query metadata

  3. Contact query metadata

  4. Assistant label filtering (configured on this page)

In other words, existing contact or API settings are unaffected. The assistant's default conditions apply only when none of the first three levels specifies query metadata. For configuration instructions at each level, see Knowledge Management Permissions: Query Metadata and Getting Started with the Query Builder.

The Knowledge Base "Search Test" is a tool for checking retrieval quality and does not apply the assistant's label filtering.

Invalid Labels

If a label referenced by a condition has been renamed or deleted, or if its Knowledge Base has been unmounted from the assistant, reopening the settings page displays an invalid-label warning listing the affected labels. Click "Remove Invalid Labels" to remove them all at once, or select other labels and save.

Clear Settings

Click "Clear All Conditions" in the upper-right corner of the builder and save. The assistant will return to referencing all files.

If the Knowledge Bases mounted by the assistant do not contain any labels, this page displays "The mounted Knowledge Bases do not have any labels." Add labels to files in the Knowledge Base first.

Message displayed when the mounted Knowledge Bases do not contain any labels
Message displayed when the Knowledge Base does not contain any labels

Last updated

Was this helpful?