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

Document Management: Tags and Metadata

Since a Knowledge Base may contain a large number of documents or FAQs to manage, MaiAgent provides tag management and metadata management features, allowing you to categorize and organize large volumes of documents and FAQs.

Tag Management

When your Knowledge Base contains a large amount of data, the tagging system helps you quickly organize documents, FAQ attributes, or control reference material permissions. For example:

Product Data Knowledge Base (categorized by product information)
|-- #Tent 
|-- #4-Person Tent 
|-- #3-Season Tent 
|-- #SnowPeak
Tutorial Content Knowledge Base (categorized by permission level)
|-- #Non-Member
|-- #Regular Member 
|-- #VIP

Add Tag

  1. Click the Add button

  1. Enter the tag name

  1. After clicking Add, the tag you just entered will be displayed as follows, including ID, name, etc.

The ID can be used for granting document access permissions. For details, see Technical Manual — Query Metadata Control Items

Add Tags to Documents

After adding tags, go to the document page.

  1. Click Edit File Information

  1. Select tags

Add corresponding tags based on the document's requirements (you can select multiple tags).

The added tags will then be displayed next to the corresponding document:

Add Tags to FAQs

If you want to add hierarchical categorization or tag management for FAQs, you can:

  1. Go to the FAQ management interface within the Knowledge Base, select the FAQ you want to edit, then click the Edit button

  1. Select the tags to add, then click "Confirm"

The added tags will appear in the FAQ field.


Tag Access Control

You can control what different users see based on different tags. For example, VIP customers can view more advanced product tutorials, while non-members can only see general tutorials.

Filtering can be applied to both FAQs and documents.

Label filtering conditions have two levels: "within a group" and "between groups." The interface presents them in plain language. Between labels in the same group, select "Include All Labels (AND)" or "Include Any Label (OR)." Between multiple condition groups, select "Match Every Group (AND)" or "Match Any Group (OR)." The previous interface displayed AND/OR buttons, but the meaning is the same. The following two examples explain how this works.

Include All Labels (AND)

"Include All Labels (AND)" allows access only to content that simultaneously matches every label in the group.

For example: If a conversation is a tutorial-related conversation with a non-member, you can use tag filtering to only open documents that simultaneously match the "Non-Member" and "Tutorial" tags for the AI Assistant to use.

As shown: After filtering, the AI Assistant can only use the beginner camping document, avoiding disclosure of irrelevant information in non-member conversations.

Include Any Label (OR)

For conversations with members, use "Include Any Label (OR)" so the AI Assistant can reference documents matching either Regular Member or Non-Member:

Members can see more document content than non-members, achieving tiered access control.

In label filtering, click "Include All Labels (AND)" or "Include Any Label (OR)" to switch how the group is evaluated (the figure below shows the previous AND/OR buttons in the same location). A sentence at the bottom of the builder describes the current conditions so you can confirm that the settings are correct.

For filtering results, refer to: Internal Q&A Features

Document Metadata Management

What Is Metadata?

Metadata is like a document's "ID card," recording detailed information about the document and helping the system better manage and use these documents.

Example: Beginner Camping.pdf

Why Use Metadata?

When data is complex and voluminous, using metadata helps you maintain data quality more conveniently and quickly by:

Improving Management Efficiency

  • Quickly identify document status and version information

  • Stay more organized when managing large volumes of documents in bulk

  • Reduce time spent on manual searching and verification

Ensuring Content Quality

  • Use the latest document versions

  • Track document update history and version status

  • Ensure the AI Assistant uses the latest and reviewed content

  • Set periodic review reminders to maintain data quality

Add Metadata to Documents

  1. Go to the document page and click Edit File Information:

  1. Switch to the Metadata tab and enter the metadata mappings

MaiAgent uses key-value pairs to store and retrieve metadata

After entering, click the "Add Metadata" button to add the key-value pair you just entered (you can add multiple metadata entries at once).

After adding, you can see the metadata you just added appearing in the field.

Add Metadata to FAQs

  1. Go to the FAQ management interface within the Knowledge Base, select the FAQ you want to edit, then click the Edit button

  1. Switch to the Metadata page, enter the values, then click Add Metadata

After entering all values, click "Confirm"

The added metadata will appear in the FAQ list.

Custom URL Mapping

url is a reserved word in the metadata system. If you set url: https://...your-specified-URL, the URL you set will override the original file location when viewing citation snippets in conversations, opening your specified URL instead.

Example Scenario: Brand Spring Promotional Campaign

Original Settings:

Usage Effect: When a user asks "What offers are available in the spring sale?" in a conversation:

  • The AI will cite this knowledge snippet to answer the question

  • When the user clicks the citation source, it will not open the internal file location

  • Instead, it will navigate directly to https://www.yourstore.com/spring-sale-2025, the official campaign page

  • The user can immediately see the latest event details, purchase buttons, countdown timers, and other dynamic content

Practical Scenarios:

  • Website Announcements: url: https://www.company.com/announcements/system-maintenance

  • Product Spec Pages: url: https://www.product.com/specs/model-x1

  • Customer Service Policies: url: https://support.company.com/return-policy

  • Event Registration: url: https://events.company.com/register/webinar-2025

The benefit of this setup is making AI responses more actionable -- not only providing information but also guiding users directly to relevant pages to take action, improving user experience and conversion rates.


Before Setting url

As shown below, before setting the url value, clicking a citation node and clicking any node (e.g., Beginner Camping.pdf) allows you to view the original document (you can configure whether to allow users to download original document files in the conversation platform):

View citation nodes
View original file location

After Setting url (Using Google as an Example)

Click the cited node file (Camping Precautions.txt) again. Instead of showing a document preview, it will open the Google homepage:

After setting the url field in metadata, when users see the AI Assistant citing that document in a conversation, they can click directly to navigate to the link you set for more complete information.

Last updated

Was this helpful?