# Document Management: Tags and Metadata

Due to the potential large volume of documents or FAQs in the knowledge base, MaiAgent provides tag management and metadata management features, allowing you to categorize and organize extensive documents and FAQs.

## Tag Management

When your knowledge base contains a large amount of data, the tag system helps you quickly organize document and FAQ attributes, or control access permissions for reference materials. For example:

```
Product Information Knowledge Base (Categorized by Product Information)
|-- #Tent 
|-- #4-Person Tent 
|-- #Three-Season Tent 
|-- #SnowPeak
```

```
Educational Content Knowledge Base (Categorized by Permission Level)
|-- #Non-Member
|-- #Regular Member 
|-- #VIP
```

### Adding Tags

1. Click the add button

<figure><img src="https://1360999650-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6v6TNkkOQVfRYfcNirHL%2Fuploads%2Fgit-blob-00bd98ff99408eec10691f1f015409e8061114e5%2Fimage%20(185).png?alt=media" alt=""><figcaption></figcaption></figure>

2. Enter the tag name

<figure><img src="https://1360999650-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6v6TNkkOQVfRYfcNirHL%2Fuploads%2Fgit-blob-0f4c9e1e2f4a092afaa565bb828a35b4e59f4c24%2Fimage%20(186).png?alt=media" alt=""><figcaption></figcaption></figure>

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

{% hint style="info" %}
The ID can be used when opening document permissions. For details, please see [Technical Manual—Query Metadata Control Items](https://docs.maiagent.ai/tech/authorization-integration/zhi-shi-guan-li-quan-xian-query-metadata-cha-xun-yuan-zi-liao-zong-lan/json-interfaces#querymetadata-kong-zhi-xiang-mu-shuo-ming)
{% endhint %}

<figure><img src="https://1360999650-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6v6TNkkOQVfRYfcNirHL%2Fuploads%2Fgit-blob-d5efb971745b4bd5297e31119ee1e45093192cb2%2Fimage%20(189).png?alt=media" alt=""><figcaption></figcaption></figure>

### Adding Tags to Documents

After tags are added, proceed to the document page

1. Click edit file information

<figure><img src="https://1360999650-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6v6TNkkOQVfRYfcNirHL%2Fuploads%2Fgit-blob-9d52c164994d7a2c4b96f3782fdba3a5357ac0d9%2F%E8%9E%A2%E5%B9%95%E6%93%B7%E5%8F%96%E7%95%AB%E9%9D%A2%202025-08-18%20174411.png?alt=media" alt=""><figcaption></figcaption></figure>

2. Select tags

According to different document requirements, add corresponding tags (you can select multiple tags)

<figure><img src="https://1360999650-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6v6TNkkOQVfRYfcNirHL%2Fuploads%2Fgit-blob-c1f4229d90f6e5b2796e969d31ac433b7bd2ff9b%2Fimage%20(193).png?alt=media" alt=""><figcaption></figcaption></figure>

Thus, the added tags will be displayed after the corresponding document:

<figure><img src="https://1360999650-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6v6TNkkOQVfRYfcNirHL%2Fuploads%2Fgit-blob-12fa488c87c8faad401ab5aa06df2f0ab7c7d431%2Fimage%20(194)%20(1)%20(1).png?alt=media" alt=""><figcaption></figcaption></figure>

### Adding Tags to FAQs

If you wish to add hierarchical classification or tag management to FAQs, you can:

1. Enter the FAQ management interface within the knowledge base, select the FAQ to edit, and click the edit button

<figure><img src="https://1360999650-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6v6TNkkOQVfRYfcNirHL%2Fuploads%2Fgit-blob-ff5846eadc0e05b5d0e23d4cf87eab8877ba7ad7%2F%E8%9E%A2%E5%B9%95%E6%93%B7%E5%8F%96%E7%95%AB%E9%9D%A2%202025-08-19%20171433%20(1).png?alt=media" alt=""><figcaption></figcaption></figure>

2. Select the tags to add, and after adding, click "<mark style="color:blue;">Confirm</mark>"

<div><figure><img src="https://1360999650-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6v6TNkkOQVfRYfcNirHL%2Fuploads%2Fgit-blob-e3a464d671878da74fc3b45506c5c4d0e6c29e38%2Fimage%20(174).png?alt=media" alt=""><figcaption></figcaption></figure> <figure><img src="https://1360999650-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6v6TNkkOQVfRYfcNirHL%2Fuploads%2Fgit-blob-a2a9363722f24ac61d91273c32c9e1a09f98ec01%2Fimage%20(175).png?alt=media" alt=""><figcaption></figcaption></figure></div>

The added tags will appear in the FAQ field

<figure><img src="https://1360999650-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6v6TNkkOQVfRYfcNirHL%2Fuploads%2Fgit-blob-f74621f006e8057ab5b6f11f544dda782203da6a%2F%E8%9E%A2%E5%B9%95%E6%93%B7%E5%8F%96%E7%95%AB%E9%9D%A2%202025-08-19%20172123.png?alt=media" alt=""><figcaption></figcaption></figure>

***

### Tag-Based Access Control

You can control different users to see different content based on different tags, such as VIP customers being able to see more advanced product demonstrations, while non-members can only see general demonstrations.

{% hint style="info" %}
Both FAQs and documents can apply filtering
{% endhint %}

#### AND Filter

The AND tag filter opens content that simultaneously meets all tag conditions.

For example: if this conversation is related to educational content for non-members, you can use tag filtering to only open documents that simultaneously meet the "<mark style="color:blue;">non-member</mark>" and "<mark style="color:blue;">educational</mark>" tags for the AI assistant to use.

As shown: after filtering, the AI assistant can only use beginner camping documents, avoiding disclosure of irrelevant information to non-member conversations.

<figure><img src="https://1360999650-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6v6TNkkOQVfRYfcNirHL%2Fuploads%2Fgit-blob-ac0761fb82bb4bcd9a1564cdf5eb190398e39695%2F%E8%9E%A2%E5%B9%95%E6%93%B7%E5%8F%96%E7%95%AB%E9%9D%A2%202025-08-28%20124301.png?alt=media" alt=""><figcaption></figcaption></figure>

#### OR Filter

For conversations with members, you can use the OR filter to allow documents that meet either regular member or non-member conditions to be referenced by the AI assistant:

<figure><img src="https://1360999650-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6v6TNkkOQVfRYfcNirHL%2Fuploads%2Fgit-blob-b41ff641039d59dcbe21a70ef0dd6c014528c812%2F%E8%9E%A2%E5%B9%95%E6%93%B7%E5%8F%96%E7%95%AB%E9%9D%A2%202025-08-28%20124405.png?alt=media" alt=""><figcaption></figcaption></figure>

Members will be able to see more document content than non-members, achieving permission tiering.

{% hint style="info" %}
You can switch filtering mechanisms by clicking "AND" or "OR" in the tag filter
{% endhint %}

<figure><img src="https://1360999650-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6v6TNkkOQVfRYfcNirHL%2Fuploads%2Fgit-blob-0fe58d851aefc0a1256a26a0f265ba5a9ba1f9bc%2Fimage%20(156).png?alt=media" alt=""><figcaption></figcaption></figure>

> For filtering results, please refer to: [Internal Q\&A Features](https://docs.maiagent.ai/release/explain)

## Document Metadata Management

### **What is Metadata?**

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

**Example: Beginner Camping.pdf**

```
Metadata Settings:
├── Document Version: v2.1
├── Creation Date: 2024-03-15
├── Last Updated: 2024-11-20
├── Next Review: 2025-05-20
├── Update Department: Marketing
└── Version Status: Reviewed and Available
```

### Why Use Metadata?

In situations with complex data, using metadata helps you maintain data quality more conveniently and quickly, assisting you in:

**Improving Management Efficiency**

* Quickly identify document status and version information
* More organized when batch managing large numbers of documents
* Reduce manual search and verification time

**Ensuring Content Quality**

* Use the latest document versions
* Track document update history and version status
* Ensure AI assistants use the latest and reviewed content
* Set periodic review reminders to maintain data quality

### Adding Metadata to Documents

1. Enter the document page and click edit document information:

<figure><img src="https://1360999650-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6v6TNkkOQVfRYfcNirHL%2Fuploads%2Fgit-blob-9d52c164994d7a2c4b96f3782fdba3a5357ac0d9%2F%E8%9E%A2%E5%B9%95%E6%93%B7%E5%8F%96%E7%95%AB%E9%9D%A2%202025-08-18%20174411.png?alt=media" alt=""><figcaption></figcaption></figure>

2. Switch to the metadata tab and enter metadata mappings

> MaiAgent uses key-value pairs to store and retrieve metadata

<div><figure><img src="https://1360999650-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6v6TNkkOQVfRYfcNirHL%2Fuploads%2Fgit-blob-d214e20dbb079f0c87ec8d22719fc03d5c79c196%2Fimage%20(142).png?alt=media" alt=""><figcaption></figcaption></figure> <figure><img src="https://1360999650-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6v6TNkkOQVfRYfcNirHL%2Fuploads%2Fgit-blob-9cce0ff156c9b371e02ec40a8276f12a958c3ccb%2Fimage%20(143).png?alt=media" alt=""><figcaption></figcaption></figure></div>

After entering, click the "<mark style="color:blue;">Add Metadata</mark>" button to add the key-value mapping you just entered (you can add multiple metadata entries at once).

<figure><img src="https://1360999650-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6v6TNkkOQVfRYfcNirHL%2Fuploads%2Fgit-blob-011bf009a0b4bd5dabe3ef5a6bc76f00fbd3360c%2Fimage%20(202).png?alt=media" alt=""><figcaption></figcaption></figure>

After completion, you will see the metadata you just added appear in the field.

### Adding Metadata to FAQs

1. Enter the FAQ management interface within the knowledge base, select the FAQ to edit, and click the edit button

<figure><img src="https://1360999650-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6v6TNkkOQVfRYfcNirHL%2Fuploads%2Fgit-blob-ff5846eadc0e05b5d0e23d4cf87eab8877ba7ad7%2F%E8%9E%A2%E5%B9%95%E6%93%B7%E5%8F%96%E7%95%AB%E9%9D%A2%202025-08-19%20171433%20(1)%20(1).png?alt=media" alt=""><figcaption></figcaption></figure>

2. Switch to the metadata page, enter information and click add metadata

After completing all entries, click "Confirm"

<figure><img src="https://1360999650-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6v6TNkkOQVfRYfcNirHL%2Fuploads%2Fgit-blob-08208baf117c66b801d1ef1a61b5c9f0a685aaff%2Fimage%20(176).png?alt=media" alt=""><figcaption></figcaption></figure>

The added metadata will appear in the FAQ list

<figure><img src="https://1360999650-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6v6TNkkOQVfRYfcNirHL%2Fuploads%2Fgit-blob-cbc2c61f59c8b5f38fcbd561916ff731eadc4687%2Fimage%20(177).png?alt=media" alt=""><figcaption></figcaption></figure>

### 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 reference snippets in conversations, and will instead open your specified URL.

**Example Scenario: Brand Spring Promotion Campaign**

**Original Settings:**

```yaml
title: "2025 Spring Big Promotion Details"
content: "This campaign includes 20% off storewide, free gifts with purchase, and many other offers..."
url: https://www.yourstore.com/spring-sale-2025
```

**Usage Effect:** When users ask "What offers are in the spring promotion?" in the conversation:

* The AI will reference this knowledge snippet to answer the question
* When users click the reference source, it won't open the internal file location
* Instead, it will directly jump to `https://www.yourstore.com/spring-sale-2025` official campaign page
* Users can immediately see the latest campaign details, purchase buttons, countdown timers, and other dynamic content

**Practical Scenarios:**

* **Website Announcements**: `url: https://www.company.com/announcements/system-maintenance`
* **Product Specifications**: `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 advantage of this setup is making AI responses more practical — not just 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, when clicking on reference nodes, clicking any node (e.g., Beginner Camping.pdf) allows viewing the original document (you can set whether to allow users to download original document files on the conversation platform):

{% hint style="info" %}
[Conversation Platform - Allow Download of Referenced Documents Setting](https://docs.maiagent.ai/release/website#id-3.-gong-neng-she-ding)
{% endhint %}

<div><figure><img src="https://1360999650-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6v6TNkkOQVfRYfcNirHL%2Fuploads%2Fgit-blob-8344183badd7e8fdd95aa5f1e778701af26bcc7e%2Fimage%20(167).png?alt=media" alt=""><figcaption><p>View reference nodes</p></figcaption></figure> <figure><img src="https://1360999650-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6v6TNkkOQVfRYfcNirHL%2Fuploads%2Fgit-blob-156940c18e495edd0ec2d91f8d188c777605d01f%2Fimage%20(168).png?alt=media" alt=""><figcaption><p>View original file location</p></figcaption></figure></div>

#### After Setting URL (Using Google as Example)

<figure><img src="https://1360999650-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6v6TNkkOQVfRYfcNirHL%2Fuploads%2Fgit-blob-5ffe6b54062d9c5cceaccffb6b189011dbc19e98%2F%E8%9E%A2%E5%B9%95%E6%93%B7%E5%8F%96%E7%95%AB%E9%9D%A2%202025-08-19%20145947.png?alt=media" alt=""><figcaption></figcaption></figure>

When clicking on the referenced node file (Camping Precautions.txt) again, it will not display the document preview, but instead override to open the Google homepage:

<div><figure><img src="https://1360999650-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6v6TNkkOQVfRYfcNirHL%2Fuploads%2Fgit-blob-1610be021a9a165d138832964ce0e9e9b88482e5%2F%E8%9E%A2%E5%B9%95%E6%93%B7%E5%8F%96%E7%95%AB%E9%9D%A2%202025-08-19%20145734.png?alt=media" alt=""><figcaption></figcaption></figure> <figure><img src="https://1360999650-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6v6TNkkOQVfRYfcNirHL%2Fuploads%2Fgit-blob-5dd779938cea62c819f6df072ec2cfdb7c1dcb5a%2F%E8%9E%A2%E5%B9%95%E6%93%B7%E5%8F%96%E7%95%AB%E9%9D%A2%202025-08-19%20150246.png?alt=media" alt=""><figcaption></figcaption></figure></div>

When you set the `url` field in metadata, users can directly click to jump to your set link when they see the AI assistant referencing that document in conversations, obtaining more complete information
