# Contacts

## What are Contacts?

Contacts are one of MaiAgent's core features, like a business's "customer card file." It enables businesses to create dedicated identity profiles for each customer, ensuring that every conversation provides a personalized service experience.

<figure><img src="/files/rXObrxHMxTbVp1Dwf3wr" alt=""><figcaption><p>Identity Recognition Example</p></figcaption></figure>

Imagine when a customer interacts with you through a website chat room, the system can immediately identify "This is Mr. Zhang, he is a VIP member" or "This is a new visitor, only partial documents can be opened," and provide corresponding service content and permissions accordingly.

## Why do we need the Contacts feature?

### **Personalized Service Experience**

Every customer has unique needs and background. The Contacts feature enables AI assistants to:

* Remember conversation history with that customer
* Provide appropriate information based on customer identity
* Avoid repeatedly asking for known information

### **Precise Permission Management**

Different customers should see different content:

* VIP members can view exclusive offers
* Regular members see standard service content
* Visitors can only use public information

### **Data Security Protection**

* Ensure customers can only access their own data, preventing information leakage.

## How do Contacts work?

When a user opens the conversation box, the conversation request is sent to the enterprise's internal system for processing, determining whether member information has been included. Based on the judgment result, the system decides to find/create a contact (anonymous or non-anonymous). Regardless of which path is taken, personalized conversations will eventually unfold, ensuring that every user receives a suitable personalized experience.

Contact Operation Diagram

<figure><img src="/files/bH9zl2nkmqJthI0y6cGE" alt=""><figcaption><p>Contact Operation Diagram</p></figcaption></figure>

## Contact Type Description

MaiAgent's contact system is divided into two types based on user identity recognition methods:

## Contact Type Comparison Table

<table><thead><tr><th width="104.83331298828125">Item</th><th>Anonymous Contacts</th><th>Non-Anonymous Contacts</th></tr></thead><tbody><tr><td><strong>Applicable Situation</strong></td><td>Visitors entering directly from the web who have not logged into the enterprise member system, and therefore have no account to obtain user data</td><td>Logged-in members or those entering through other platform accounts (such as Facebook, LINE, etc.), where the system can obtain user name and account information</td></tr><tr><td><strong>Identity Recognition</strong></td><td>Unable to obtain specific personal information</td><td>Have clear identity recognition information (such as: name, profile picture, etc.)</td></tr><tr><td><strong>System Settings</strong></td><td>Set as "anonymous" in the MaiAgent system</td><td>Original member account ID will be converted to Source ID</td></tr><tr><td><strong>Permission Management</strong></td><td>Knowledge base document permissions, conversation platform management</td><td>Same for both</td></tr><tr><td><strong>Data Mapping</strong></td><td>No Source ID, cannot be mapped to enterprise member data</td><td>Ensure contacts can always be mapped to the correct user through Source ID</td></tr><tr><td><strong>Creation Method</strong></td><td>If entering as a visitor (without member identity), a new anonymous contact is automatically created for each conversation</td><td>System automatically creates or updates through MaiAgent API based on member login information<br>For detailed integration, please refer to: <a href="https://docs.maiagent.ai/tech/authorization-integration/contacts">Technical Manual—Contact Introduction and Integration</a></td></tr><tr><td><strong>Recording Mechanism</strong></td><td>System records user conversation history according to cache</td><td>Maintain conversation continuity through Source ID and contact mapping</td></tr></tbody></table>

{% hint style="info" %}
**Importance of Source ID**

Source ID is the key bridge connecting MaiAgent contacts with the enterprise member system. When users interact with the enterprise through different channels (website, APP, social platforms), the system can correctly identify user identity through Source ID, ensuring conversation continuity and personalized experience.
{% endhint %}

## Setting up Contacts

### Anonymous Users

User creates a new conversation, system automatically creates a new anonymous user in the background (each conversation is one anonymous user)⬇️

<div><figure><img src="/files/yrG1eQjHEwhdVBBDJmu4" alt=""><figcaption></figcaption></figure> <figure><img src="/files/Y7IDihBDnikklCAtvMsk" alt=""><figcaption></figcaption></figure></div>

Includes contact ID, conversation platform records, creation time, and other information

You can click edit to manually edit anonymous contact information:

<div><figure><img src="/files/5b4G3VfyPMlvdRfmttDP" alt=""><figcaption></figcaption></figure> <figure><img src="/files/Ez6HmyukdaCaYXlIDw5h" alt=""><figcaption></figcaption></figure></div>

**Through editing**, you can:

* Change linked member information: Link anonymous contacts to member data by entering Source ID
* Update permission levels: Open or restrict the scope of document reading
* Supplement customer name, contact information, and other basic data

### Non-Anonymous Users

User enters using other conversation platforms (such as: LINE, FB Messenger, Telegram):

The backend automatically creates corresponding non-anonymous users based on FB user information (including Source ID, contact name, profile picture, etc.):

<div><figure><img src="/files/MENrONLds6WIFWZ7cZgo" alt=""><figcaption></figcaption></figure> <figure><img src="/files/7T8nDcK5yVdnOwhlpYfa" alt=""><figcaption></figcaption></figure></div>

You can still click the edit button to edit non-anonymous contact information

<figure><img src="/files/DlwFgdtL1dtUO03UmpDs" alt=""><figcaption></figcaption></figure>

**Through editing, you can:**

Complete and correct data

* Correct incorrect query metadata settings (update open scope based on permissions)
* Modify Source ID within the enterprise to link correct contact information with member information

{% hint style="danger" %}
Contacts rely on Source ID for mapping, so please ensure that the Source ID is synchronized with the enterprise internally when editing, otherwise it may cause data mapping errors during subsequent program synchronization with internal enterprise information.
{% endhint %}

### Adding Contacts

The add contact feature is mainly used for **proactively creating customer profiles with preset permissions**. If you have not specified permission scope in Web Chat, you can pre-create contacts to complete permission configuration and service preparation before customers actually initiate conversations.

{% hint style="info" %}
To use javascript scripts to specify permission scope in Web Chat initialization, please refer to: [Technical Manual: Getting Started—Using JSON Format](https://docs.maiagent.ai/tech/authorization-integration/zhi-shi-guan-li-quan-xian-query-metadata-cha-xun-yuan-zi-liao-zong-lan/json-interfaces#webchat-chu-shi-hua-she-ding)
{% endhint %}

#### Core Function Description

Through manually adding contacts, system administrators can pre-create user profiles with specific identities in the customer service system and configure corresponding **query metadata permissions** for them. When these pre-created contacts later interact with customer service through **specified conversation platforms**, the system will immediately apply pre-set permission levels through **Source ID automatic matching mechanism**, ensuring they can access data content that matches their identity.

You can click add contact to enter the edit page and add information:

<div><figure><img src="/files/tAtqktFj5IsawB1R8aNw" alt=""><figcaption></figcaption></figure> <figure><img src="/files/9AyBLBmEvZ3LfClBVrLp" alt=""><figcaption></figcaption></figure></div>

On the page, you can add contact name, specify conversation platform, and other information:

<figure><img src="/files/uXPak0TaeX0es4JBs5uI" alt=""><figcaption></figcaption></figure>

## Permission Management

According to enterprise needs, you can use query metadata to restrict the scope of document usage for different contacts, such as:

#### Restrict by Membership Level

* **VIP Members**: Can query all knowledge bases, advanced FAQs, product technical documents
* **Regular Members**: Can only query basic FAQs, product user manuals
* **Visitor Users**: Can only query public FAQs, basic product introductions

#### Distinguish by Department Permissions

* **Internal Employees**: Can query internal operation manuals, system maintenance documents, complete product information
* **Distributors**: Can query product specifications, price lists, sales data
* **General Customers**: Only limited to querying usage instructions, FAQs, warranty information

#### Classify by Product Tags

* **Enterprise Version Users**: Can query documents tagged with "Enterprise Features", "Advanced Settings"
* **Personal Version Users**: Can only query documents tagged with "Basic Features", "Personal Use"
* **Trial Users**: Can only query content tagged with "Trial Instructions", "Getting Started Guide"

{% hint style="info" %}
To learn more about query metadata, please refer to: [Knowledge Management Permissions: Query Metadata](/maiagent-user-guide/maiagent-user-guide-en/org/querymetadata.md)
{% endhint %}

In contacts, when setting query metadata, the system will only authorize you to configure based on the knowledge base of the conversation platform you specified. If you configure for knowledge bases of other conversation platforms, the following warning message will appear:

<figure><img src="/files/MB3u4xKv4KP6Aur14X1Z" alt=""><figcaption></figcaption></figure>

## Automated Integration

For technical teams, MaiAgent also provides API interfaces that can seamlessly integrate with existing enterprise systems

{% hint style="info" %}
For details, please refer to: [Technical Manual—Contact Introduction and Integration](https://docs.maiagent.ai/tech/authorization-integration/contacts)
{% endhint %}

Regardless of enterprise size, the Contacts feature can help you provide better customer service experiences while ensuring data security and operational efficiency. Through classified management of anonymous and non-anonymous contacts, precise Source ID mapping mechanisms, and flexible creation methods, enterprises can provide the most suitable service experience for different types of users and be fully prepared before customer interactions.


---

# 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/maiagent-user-guide/maiagent-user-guide-en/org/contact.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.
