> 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="/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 编辑器中验证跨会话回忆。</td><td><a href="/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="/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="/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="/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="/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="/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="/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>诊断记忆未能持久化的原因，并解决 Memory Management API 的 HTTP 错误。</td><td><a href="/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/long-term-memory/troubleshooting-and-diagnostics.md">排查长期记忆问题</a></td></tr></tbody></table>

### 下一步

从 [长期记忆的工作原理](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/long-term-memory/how-long-term-memory-works.md) 用于概念概览，然后继续 [长期记忆快速入门](/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.
