# Getting Started—Using "Query Builder"

## Contact Query Metadata Configuration

You can use the "Query Builder" in MaiAgent service to create QueryMetadata graphically. Here's an example of creating Contact Query Metadata:

### Step 1: Access the Contacts Area in MaiAgent Backend Service

<figure><img src="https://github.com/Playma-Co-Ltd/maiagent-tech-gitbook/blob/main/en/zh-tw/.gitbook/assets/螢幕擷取畫面%202025-08-07%20165727.png" alt=""><figcaption><p>Contacts Area Entry</p></figcaption></figure>

### Step 2: Configure Settings for the Desired Contact

1. Find the contact you want to configure and click edit

<figure><img src="https://github.com/Playma-Co-Ltd/maiagent-tech-gitbook/blob/main/en/zh-tw/.gitbook/assets/螢幕擷取畫面%202025-08-07%20165859.png" alt=""><figcaption><p>Contact Edit Entry</p></figcaption></figure>

2. The following screen will appear after clicking

<figure><img src="https://github.com/Playma-Co-Ltd/maiagent-tech-gitbook/blob/main/en/zh-tw/.gitbook/assets/query%20metadata%20maker.png" alt=""><figcaption><p>Query Builder Entry</p></figcaption></figure>

Click directly on Query Builder to enter the graphical interface

### Step 3: Select Desired Permissions

1. Select the knowledge bases you want to grant access to, and optionally select specific documents within those knowledge bases

<figure><img src="https://github.com/Playma-Co-Ltd/maiagent-tech-gitbook/blob/main/en/zh-tw/.gitbook/assets/螢幕擷取畫面%202025-08-07%20170306.png" alt=""><figcaption><p>Select Knowledge Base and Documents</p></figcaption></figure>

2. If you want to grant access to documents with specific tags, click "Show Tag Filter" to open the tag settings area

<figure><img src="https://github.com/Playma-Co-Ltd/maiagent-tech-gitbook/blob/main/en/zh-tw/.gitbook/assets/螢幕擷取畫面%202025-08-07%20170306-1.png" alt=""><figcaption><p>Tag Filter Settings</p></figcaption></figure>

You can choose the conditions you want to create, selecting either `"OR"` (matches any condition) or `"AND"` (matches all conditions) as the access criteria for documents in the enabled knowledge bases

## Message Settings

You can also use the right-side menu shown below to select the knowledge permissions to grant:

<figure><img src="https://github.com/Playma-Co-Ltd/maiagent-tech-gitbook/blob/main/en/zh-tw/.gitbook/assets/螢幕擷取畫面%202025-08-08%20095028.png" alt=""><figcaption><p>Internal Chat: Select Available Knowledge Permissions</p></figcaption></figure>

You can also use "Show Tag Filter" to set tag filtering conditions

{% hint style="info" %}
You can adjust permissions on the right before sending each different message to manage knowledge access
{% endhint %}

<figure><img src="https://github.com/Playma-Co-Ltd/maiagent-tech-gitbook/blob/main/en/zh-tw/.gitbook/assets/螢幕擷取畫面%202025-08-08%20124143.png" alt=""><figcaption><p>Available Documents List</p></figcaption></figure>

<figure><img src="https://github.com/Playma-Co-Ltd/maiagent-tech-gitbook/blob/main/en/zh-tw/.gitbook/assets/螢幕擷取畫面%202025-08-08%20124344.png" alt=""><figcaption><p>Selected Documents Status</p></figcaption></figure>

Currently able to reference three files: CV, SOP, and Survey

After unchecking CV in the next message and sending again:

<figure><img src="https://github.com/Playma-Co-Ltd/maiagent-tech-gitbook/blob/main/en/zh-tw/.gitbook/assets/螢幕擷取畫面%202025-08-08%20124830.png" alt=""><figcaption><p>Example of Unchecking Document</p></figcaption></figure>

The Agent can no longer use the CV file, and the reference library no longer shows CV references:

<figure><img src="https://github.com/Playma-Co-Ltd/maiagent-tech-gitbook/blob/main/en/zh-tw/.gitbook/assets/螢幕擷取畫面%202025-08-08%20124958.png" alt=""><figcaption><p>Reference Library Change: After Removing CV</p></figcaption></figure>

Permissions can be adjusted before sending each message, affecting what content can be referenced in that round of responses.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.maiagent.ai/tech/maiagent-tech-en/authorization-integration/zhi-shi-guan-li-quan-xian-query-metadata-cha-xun-yuan-zi-liao-zong-lan/graphical-interface.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
