> 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/work/maigpt/ai-memory.md).

# AI 記憶

查看與管理 Agent 從對話中學到的偏好與事實

AI 記憶頁讓你查看與管理帳號目前保存的偏好與事實。你可以在這裡新增、編輯、刪除或重新啟用自己的記憶。

{% hint style="info" %}
雲端版的 AI 記憶預設開啟，不需額外申請；地端版是否開放依組織設定。你可以隨時在本頁關閉自己的 AI 記憶，詳見[開啟或關閉 AI 記憶](#toggle-memory)。
{% endhint %}

## 什麼時候會用到 <a href="#use-case" id="use-case"></a>

例如，專案經理想整理帳號中已儲存的溝通偏好。她可以到 <mark style="color:blue;">AI 記憶</mark>查看現有內容，再手動新增「以繁體中文回答」的偏好；需求改變時，她也能隨時編輯或刪除。

## 開啟記憶清單 <a href="#open-memory-list" id="open-memory-list"></a>

點選右上角的帳號選單，再選擇 <mark style="color:blue;">帳號</mark>。在個人資料頁的組織區塊點選 <mark style="color:blue;">AI 記憶</mark>。頁面會列出你的記憶；還沒有資料時會顯示「還沒有記憶」。

<figure><img src="https://1593648278-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmzb5NG9GDzFP2YDKeYVl%2Fuploads%2Fgit-blob-abad881f3ab1ac20097bc14dacc629a5ff640bf4%2Fai-memory-list.png?alt=media" alt="AI 記憶頁的空狀態，右上角可點選新增"><figcaption><p>AI 記憶清單的空狀態</p></figcaption></figure>

## 開啟或關閉 AI 記憶 <a href="#toggle-memory" id="toggle-memory"></a>

<mark style="color:blue;">AI 記憶</mark>頁最上方有 <mark style="color:blue;">讓助理記住我</mark> 開關，預設為開啟。你可以依自己的需要決定是否讓 Agent 記住你。這個開關只影響你自己在目前組織的記憶，不影響同組織的其他成員，也不影響你在其他組織的設定。

{% stepper %}
{% step %}
點選右上角的帳號選單，再選擇 <mark style="color:blue;">帳號</mark>。在個人資料頁點選 <mark style="color:blue;">AI 記憶</mark>。
{% endstep %}

{% step %}
在頁面最上方切換 <mark style="color:blue;">讓助理記住我</mark> 開關。切換成功後會顯示「已開啟 AI 記憶」或「已關閉 AI 記憶」。
{% endstep %}
{% endstepper %}

關閉後：

* Agent 不會從你的對話中記住新內容，也不提供「記住這件事」的功能。
* Agent 在對話中不會參考你已儲存的記憶。
* 清單上方會顯示「AI 記憶已關閉，助理目前不會讀取或新增你的記憶」。

{% hint style="info" %}
關閉開關不會刪除記憶。已儲存的記憶仍會保留，你仍可在本頁查看、編輯、刪除或手動新增；重新開啟後，這些記憶會再被 Agent 使用。關閉期間的對話不會在重新開啟後補記。
{% endhint %}

{% hint style="warning" %}
若開關呈關閉且無法點選，並顯示「你的組織目前未啟用 AI 記憶」，代表你的組織目前未啟用此功能，此時 Agent 不會記住任何成員。如有疑問，請聯繫組織管理員或 MaiAgent 客服。
{% endhint %}

## 手動新增記憶 <a href="#add-memory" id="add-memory"></a>

{% stepper %}
{% step %}
在 <mark style="color:blue;">AI 記憶</mark>頁點選右上角 <mark style="color:blue;">新增</mark>。
{% endstep %}

{% step %}
選擇類型，並填寫主題、摘要與細節。主題使用英文 `snake_case`，例如 `communication_style`；細節可以每行填一項。

<figure><img src="https://1593648278-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmzb5NG9GDzFP2YDKeYVl%2Fuploads%2Fgit-blob-89edbfeec742e3fab67138f346e8bb7c09d254dd%2Fai-memory-add.png?alt=media" alt="AI 記憶新增表單，包含類型、主題、摘要與細節"><figcaption><p>手動新增記憶時需填寫的欄位</p></figcaption></figure>
{% endstep %}

{% step %}
點選 <mark style="color:blue;">儲存</mark>。新記憶會回到清單中。
{% endstep %}
{% endstepper %}

## 在對話中請 Agent 記住 <a href="#save-in-chat" id="save-in-chat"></a>

除了在 <mark style="color:blue;">AI 記憶</mark>頁手動新增，你也可以直接在對話中對 Agent 說「請記住……」。Agent 會把內容整理成一條記憶，存進你的記憶清單，之後的對話都能參考。

Agent 也可能在對話中主動記下它判斷會長期適用的事實，例如你的職務、偏好的回覆語言或常用的技能。

### 使用前提 <a href="#save-in-chat-requirements" id="save-in-chat-requirements"></a>

以下條件都符合時，Agent 才能在對話中寫入記憶：

* 組織已開啟 AI 記憶。
* 你的 <mark style="color:blue;">讓助理記住我</mark> 開關為開啟（預設開啟）。
* 該 Agent 的設定中已開啟 <mark style="color:blue;">向量記憶</mark>。
* 對話者是該 Agent 所屬組織的成員。匿名訪客的對話不會寫入記憶。

使用 Agent 市集中的 Agent 時也適用相同條件：只要你是該 Agent 所屬組織的成員，Agent 就能使用你的 AI 記憶。

{% hint style="warning" %}
Agent 不會保存敏感個人資料，例如信用卡號、身分證字號、護照號碼、銀行帳號、手機號碼、Email、密碼或 API 金鑰。內容含有這類資料時不會存入記憶，Agent 會告知無法保存。
{% endhint %}

### 使用情境 <a href="#save-in-chat-scenario" id="save-in-chat-scenario"></a>

例如，行銷企劃在 MaiGPT 準備新品簡報，希望之後每次對話都不用再交代產品代號。她在對話中輸入「請記住：我們的示範產品代號是 Aurora，之後撰寫產品介紹時都用這個代號」。Agent 執行 <mark style="color:blue;">Save Memory</mark> 後回覆已記住；她到 <mark style="color:blue;">AI 記憶</mark>頁就能看到這條記憶，並標示為 <mark style="color:blue;">使用者要求</mark>。之後她開新對話請 Agent 撰寫產品介紹時，Agent 就會沿用 Aurora 這個代號。

<figure><img src="https://1593648278-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmzb5NG9GDzFP2YDKeYVl%2Fuploads%2Fgit-blob-a97fd05d5498ebff8adf57d180d7d53c0e8603dd%2Fmaigpt-memory-save-in-chat.png?alt=media" alt="MaiGPT 對話中，使用者請 Agent 記住示範產品代號 Aurora，步驟區顯示已使用 Save Memory，Agent 回覆已記住"><figcaption><p>在對話中請 Agent 記住，步驟區會顯示已使用 Save Memory</p></figcaption></figure>

{% hint style="info" %}
Agent 寫入的記憶若與既有記憶屬於同一主題，會更新該條記憶，而不是重複新增。
{% endhint %}

## 記憶的來源標籤 <a href="#source-tags" id="source-tags"></a>

記憶清單中的每條記憶都會標示來源。Agent 在對話中寫入的記憶會顯示以下兩種標籤之一：

| 標籤                                          | 代表意義                  |
| ------------------------------------------- | --------------------- |
| <mark style="color:blue;">使用者要求</mark>（綠色）  | 你在對話中明確要求 Agent 記住的內容 |
| <mark style="color:blue;">助理主動記錄</mark>（紫色） | Agent 在對話中主動判斷並保存的內容  |

清單中也可能出現其他來源標籤，例如你在本頁自己新增的 <mark style="color:blue;">手動新增</mark>，或系統從對話內容自動整理出的 <mark style="color:blue;">AI 抽取</mark>。若某條記憶不是你想保留的，可依下方說明編輯或刪除。

<figure><img src="https://1593648278-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fmzb5NG9GDzFP2YDKeYVl%2Fuploads%2Fgit-blob-1d67cfaf5ece4c4e3090598fce4d82f9d1d12ba6%2Fmaigpt-memory-source-tags.png?alt=media" alt="AI 記憶清單中的兩條記憶：一條標示事實與 AI 抽取，另一條主題為 demo_product_code，標示指令與使用者要求"><figcaption><p>記憶清單上的來源標籤：AI 抽取與使用者要求</p></figcaption></figure>

## 管理已有記憶 <a href="#manage" id="manage"></a>

在記憶清單中，你可以：

* 編輯主題、摘要與細節。
* 刪除不再正確或不希望 AI 使用的記憶；刪除後無法復原。
* 在「已過期的記憶」區塊重新啟用過期項目。
* 點選重新整理按鈕，讓清單顯示最新狀態。

{% hint style="warning" %}
記憶可能影響後續對話的回答。若內容已過時、不精確或不該長期保留，請及時修正或刪除。
{% endhint %}

## 用量與計費 <a href="#usage-and-billing" id="usage-and-billing"></a>

AI 記憶會使用組織的 Credits，分成兩個部分：

| 用量      | 怎麼計費                                                                                                                                                        | 在消耗紀錄怎麼看                                                                                                                               |
| ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| 整理記憶    | AI 記憶從對話中整理、儲存記憶時，由平台的系統模型執行，依該模型的費率扣 Credits，每次整理各計一筆。費用歸屬被記住的成員；有設定成員額度或[角色額度](/others/credits/member-credit-quota.md#role-quota)時，也會從他的個人額度、所屬角色的角色額度扣除。 | 服務類別 <mark style="color:blue;">AI 記憶</mark>，明細顯示 <mark style="color:blue;">AI 記憶（輸入）</mark>、<mark style="color:blue;">AI 記憶（輸出）</mark> |
| 回答時參考記憶 | Agent 回答時帶入的記憶，算在該則回覆的輸入用量裡，依 Agent 使用的模型計費。                                                                                                                | 在該則回覆的輸入行旁，標示「本則輸入含 AI 記憶約 N tokens，已計入輸入用量」                                                                                           |

以下情況不會整理記憶，也不會產生 AI 記憶的消耗：

* 你關閉了 <mark style="color:blue;">讓助理記住我</mark>、組織未啟用 AI 記憶、匿名訪客的對話，或 Agent 未開啟 <mark style="color:blue;">向量記憶</mark>。
* 訊息含有敏感個人資料（這類訊息不會送去整理）。
* 組織 Credits 不足，或被記住成員的個人額度、所屬角色的[角色額度](/others/credits/member-credit-quota.md#role-quota)已用完。
* 整理過程失敗。

整理成功但沒有找到值得記住的內容時，這次整理仍會計費。

組織管理員查看這些消耗的方式，請見 [Credits 計費制度：查看 AI 記憶的消耗](/others/credits.md#ai-memory-consumption)。若不希望自己的對話產生 AI 記憶相關的用量，可以[關閉 AI 記憶](#toggle-memory)；關閉後 Agent 不會整理你的新對話，回答時也不會帶入你的記憶。


---

# 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/work/maigpt/ai-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.
