> For the complete documentation index, see [llms.txt](https://docs.maiagent.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.maiagent.ai/build/agent/persistent-memory.md).

# 持久記憶

讓 Agent 從對話中提取事實與偏好長期保存，並在 Agent 設定頁檢視、刪除或重新啟用每一條記憶

持久記憶讓 Agent 在對話過程中提取值得記住的事實（例如聯絡人的偏好、曾提供的資訊），保存下來，並在同一位聯絡人之後的對話中直接沿用，不必每次重新詢問。

它與「對話記憶設定」裡的向量記憶、跨對話檢索不同：後兩者是回答時去**搜尋**過去的訊息；持久記憶則是把對話**整理成一條條結構化的記憶**，長期保留。三者的差異見 [Agent 的記憶](/build/agent.md#memory)。

## 開啟方式 <a href="#enable" id="enable"></a>

持久記憶由**組織層級**控制，個別 Agent 無法自行開啟或關閉。要啟用或停用，請聯繫組織管理員或 MaiAgent 窗口。

在 Agent 設定頁可以看到目前狀態：

1. 進入「<mark style="color:blue;">AI 功能</mark>」→「<mark style="color:blue;">AI 助理</mark>」，點進要查看的 Agent。
2. 在左側導覽點選「<mark style="color:blue;">管理與進階</mark>」→「<mark style="color:blue;">進階設定</mark>」。
3. 捲動到「<mark style="color:blue;">持久記憶</mark>」區塊，「<mark style="color:blue;">跨對話記憶</mark>」旁的標籤會顯示 <mark style="color:blue;">已啟用</mark> 或 <mark style="color:blue;">已停用</mark>。

{% hint style="info" %}
只有在組織已啟用、且 Agent 已建立完成（非建立視窗）時，區塊下方才會出現「<mark style="color:blue;">記憶列表</mark>」。
{% endhint %}

## 記憶列表 <a href="#memory-list" id="memory-list"></a>

「<mark style="color:blue;">記憶列表</mark>」列出這個 Agent 目前保存的所有記憶，標題旁的數字是總筆數，右側的「<mark style="color:blue;">重新整理</mark>」可重新載入。每一條記憶包含：

| 項目          | 說明                                                                                                                                                                                               |
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Topic**   | 記憶的主題代號，方便分類與對照                                                                                                                                                                                  |
| **Summary** | 這條記憶的一句話摘要，Agent 回答時主要參考這裡                                                                                                                                                                       |
| **Details** | 補充細節，逐條列出；沒有細節時顯示「—」                                                                                                                                                                             |
| 範圍標籤        | 這條記憶適用的範圍：<mark style="color:blue;">組織</mark>、<mark style="color:blue;">成員</mark>、<mark style="color:blue;">助理</mark>、<mark style="color:blue;">聯絡人</mark> 或 <mark style="color:blue;">對話</mark> |
| 類型標籤        | 記憶的性質：<mark style="color:blue;">事實</mark>、<mark style="color:blue;">偏好</mark>、<mark style="color:blue;">摘要</mark>、<mark style="color:blue;">指令</mark> 或 <mark style="color:blue;">個人檔案</mark>    |
| 日期          | 這條記憶建立的日期                                                                                                                                                                                        |

列表為空時會顯示「尚未記錄任何記憶」；Agent 從對話中提取到事實後，記憶就會出現在這裡。

### 刪除記憶 <a href="#delete-memory" id="delete-memory"></a>

每條記憶右側有「<mark style="color:blue;">刪除</mark>」，確認後即永久移除，Agent 之後的對話不會再參考它。遇到提取錯誤、或聯絡人要求忘記某項資訊時使用。

### 已過期的記憶 <a href="#expired-memories" id="expired-memories"></a>

記憶有效期過後不會立刻消失，而是收進列表下方的「<mark style="color:blue;">已過期的記憶</mark>」折疊區（括號內是筆數），以虛線框與灰色顯示，Agent 不會參考這些記憶。展開後每條記憶有兩個操作：

* **重新啟用**（↶ 圖示）：確認「確定要重新啟用這條記憶？」後，記憶回到有效狀態，Agent 會重新參考。
* **刪除**：永久移除。

{% hint style="warning" %}
記憶內容來自聯絡人在對話中提供的資訊。請依組織的資料使用與隱私規範管理，聯絡人要求刪除個人資料時，記得同時清掉相關記憶。
{% endhint %}

## 透過 API 管理 <a href="#api" id="api"></a>

要在自己的系統中讀取或維護記憶，可使用技術人員手冊的 [Member Memory API](https://docs.maiagent.ai/tech/api-integration/member-memory-api)。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.maiagent.ai/build/agent/persistent-memory.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
