> 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/tech/api-integration/endpoint-behaviors/member-memory-api.md).

# 成員記憶管理 API

說明已登入成員如何透過 API 管理自己的持久記憶。

成員可透過 `/api/v1/me/memories/`（`/api/me/memories/` 行為相同）查看與管理自己的記憶。請在請求中帶入 `X-Organization-Id`，指定目前操作的組織，以 API 金鑰呼叫時也要帶；服務會依呼叫者在該組織的有效成員資格取得資料。登入及共通請求方式請參考[快速上手](/tech/api-integration/quickstart.md)。

## 可用操作 <a href="#operations" id="operations"></a>

| 操作      | 端點                                                                                                                              | 行為                                                                |
| ------- | ------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
| 列出      | [`GET /api/v1/me/memories/`](https://docs.maiagent.ai/api/api-reference/zu-zhi-he-cheng-yuan#me-memories-list)                  | 列出目前成員的 `active` 與 `expired` 記憶；可用 `status`、`kind` 查詢參數篩選。        |
| 建立      | [`POST /api/v1/me/memories/`](https://docs.maiagent.ai/api/api-reference/zu-zhi-he-cheng-yuan#me-memories-create)               | 建立自己的記憶；同一成員若已有相同 `topic` 的啟用中記憶，則更新該筆。新建回 HTTP 201，更新回 HTTP 200。 |
| 修改或重新啟用 | [`PATCH /api/v1/me/memories/{id}/`](https://docs.maiagent.ai/api/api-reference/zu-zhi-he-cheng-yuan#me-memories-partial-update) | 修改可見記憶，或把 `status` 設為 `active`／`expired`。                         |
| 刪除      | [`DELETE /api/v1/me/memories/{id}/`](https://docs.maiagent.ai/api/api-reference/zu-zhi-he-cheng-yuan#me-memories-destroy)       | 刪除自己的指定記憶。                                                        |

請求欄位（`topic`、`summary`、`details`、`kind`、`status`）與長度限制見上表各端點的 API 文件。

{% hint style="info" %}
列表與單筆操作只會呈現 `active`、`expired` 記憶；尚待確認或被拒絕的記憶不會出現在這個成員介面。
{% endhint %}

## 整合時的狀態處理 <a href="#status-handling" id="status-handling"></a>

若成員將記憶標為 `expired`，整合端仍可在列表中看到它，並以 `PATCH` 將狀態改回 `active`。沒有有效成員資格時，建立記憶會回 HTTP 404。整合端應以請求指定的組織顯示記憶，避免把不同組織的資料混在同一畫面。


---

# 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/tech/api-integration/endpoint-behaviors/member-memory-api.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.
