> For the complete documentation index, see [llms.txt](https://docs.convai.com/api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/long-term-memory.md).

# 长期记忆

查找所有长期记忆指南——为角色启用记忆、管理用户身份、使用记忆 API，以及查阅脚本参考。

长期记忆（LTM）可让 Convai 角色在不同的对话会话之间保留关于特定用户的信息。本节将介绍系统的工作原理、启用方法、用户身份与记录的管理方式，以及完整的脚本 API。

<table data-view="cards"><thead><tr><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>长期记忆的工作原理</strong><br>了解会话生命周期、记忆作用范围、去重机制，以及信息的提取和注入方式。</td><td><a href="https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/long-term-memory/how-long-term-memory-works.md">长期记忆的工作原理</a></td></tr><tr><td><strong>长期记忆快速入门</strong><br>只需三步，即可为角色启用 LTM，并在 Unity Editor 中验证跨会话记忆功能。</td><td><a href="https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/long-term-memory/quick-start.md">长期记忆快速开始</a></td></tr><tr><td><strong>为角色配置记忆</strong><br>通过 Convai 控制面板或 CharacterService 脚本 API，按角色启用或关闭 LTM。</td><td><a href="https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/long-term-memory/configure-memory-for-a-character.md">为角色配置记忆</a></td></tr><tr><td><strong>终端用户身份</strong><br>了解 SDK 如何识别用户，以及如何提供由你自己的身份验证机制支持的 ID。</td><td><a href="https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/long-term-memory/end-user-identity.md">终端用户身份</a></td></tr><tr><td><strong>管理终端用户记录</strong><br>通过编辑器或 EndUsersService 脚本 API 查看并删除终端用户记录。</td><td><a href="https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/long-term-memory/end-user-management.md">管理终端用户记录</a></td></tr><tr><td><strong>记忆管理 API</strong><br>以编程方式列出、添加、检索和删除用户与角色配对对应的记忆记录。</td><td><a href="https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/long-term-memory/memory-management-api.md">记忆管理 API</a></td></tr><tr><td><strong>长期记忆脚本参考</strong><br>所有 LTM API 的完整方法签名、参数、返回类型和数据模型。</td><td><a href="https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/long-term-memory/long-term-memory-scripting-reference.md">长期记忆脚本参考</a></td></tr><tr><td><strong>长期记忆用法示例</strong><br>四种完整模式：零配置持久化、经过身份验证的用户身份、记忆预置和重置。</td><td><a href="https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/long-term-memory/usage-examples.md">长期记忆使用示例</a></td></tr><tr><td><strong>排查长期记忆问题</strong><br>诊断记忆无法持久保存的原因，并解决记忆管理 API 的 HTTP 错误。</td><td><a href="https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/long-term-memory/troubleshooting-and-diagnostics.md">排查长期记忆问题</a></td></tr></tbody></table>

### 后续步骤

从以下内容开始： [长期记忆的工作原理](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/long-term-memory/how-long-term-memory-works.md) 了解概念概览，然后按照 [长期记忆快速入门](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/long-term-memory/quick-start.md) 在场景中启用记忆功能。


---

# 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.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/long-term-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.
