2026-09-08 02:54:41 +00:00
|
|
|
|
# 跨会话长期记忆
|
|
|
|
|
|
|
|
|
|
|
|
长期记忆保存调用者的资料、表达偏好、稳定事实和长期关注,供后续会话使用。数据按工作空间和调用者身份隔离,不同空间、IM 用户或嵌入访客分别维护个人记忆。
|
|
|
|
|
|
|
|
|
|
|
|
## 开启长期记忆 {#开启和使用}
|
|
|
|
|
|
|
|
|
|
|
|
1. 空间 Admin/Owner 在「设置 → 长期记忆」开启空间开关,默认关闭。
|
|
|
|
|
|
2. 选择「仅明确记住」或「自动提取」;自动模式可指定抽取模型,留空沿用对话使用的模型。
|
|
|
|
|
|
3. 个人记忆管理中可关闭自己的记忆,即使空间已开启也不会强制使用。
|
|
|
|
|
|
4. 在对话里明确说明要记住的偏好,或使用记忆管理手工添加;之后可在另一会话检查是否应用。
|
|
|
|
|
|
5. 定期查看待确认条目,确认、修改或拒绝推断;已失效的事项可删除。
|
|
|
|
|
|
|
|
|
|
|
|
| 模式 | 行为 |
|
|
|
|
|
|
| --- | --- |
|
|
|
|
|
|
| `explicit_only` | 只记录明确要求记住的内容,不运行后台 LLM 蒸馏 |
|
|
|
|
|
|
| `auto` | 额外在后台从对话提取,按延迟和最短间隔合并处理 |
|
|
|
|
|
|
|
|
|
|
|
|
智能体的 `memory_enabled=false` 可单独禁用记忆读写,省略则继承空间设置。IM/Embed 使用所绑定智能体的记忆偏好;API Key 必须 full-access 才能使用个人记忆管理接口。功能受空间、个人和当前请求的开关共同约束。
|
|
|
|
|
|
|
|
|
|
|
|
## 管理记忆
|
|
|
|
|
|
|
|
|
|
|
|
| 操作 | 用途 |
|
|
|
|
|
|
| --- | --- |
|
|
|
|
|
|
| 新增 / 编辑 | 直接维护个人资料、偏好、事实、事项或兴趣;手工编辑不再由后台抽取覆盖 |
|
docs: sync website-docs, homepage and changelog for v0.8.2 (#3632)
* docs: sync website-docs with changes since v0.8.0
Audit every change between v0.8.0 and the v0.8.2 release against the
documentation site, adding what users and operators need and correcting
statements that no longer match the code.
- Add local browser (BrowserSkill), built-in MCP Server endpoints, the
toolbox, conversation steer/fork/rewind and reasoning effort, the
artifacts library, sandbox terminal and desktop, the Lite host sandbox,
the rebuilt model catalog (including a protocol-compat field reference),
Confluence and DingTalk Docs sources, Bocha/Serply search, per-channel IM
locale, whitelist-only outbound, admin user creation, new configuration
variables and migrations 000091-000110.
- Fix wrong API examples and parameters (model type values, knowledge
search params, FAQ match_count cap, Notion credentials), tenant deletion
semantics, default timeouts, parser engine claims, removed tables and
commands, stale navigation paths, and route locations after the router
split into routes_*.go.
- Add screenshots for the new pages and refresh outdated ones.
* fix(frontend): link the protocol-compat field to its documentation
The model editor told users to read catalog/compat.go on the backend, a
path that no longer exists after the model catalog refactor. The hint now
says when the override is needed and links to the field reference in
website-docs/03-features/06-models.md; the config examples and the API
type comment point to the same place.
* feat(website): showcase v0.8.2 on the homepage
- Add a v0.8.2 section for the local browser (BrowserSkill), the built-in
MCP Server and conversation control, and turn the v0.8.0 release block
into a standing skills & sandbox topic with the sandbox desktop and
terminal.
- Replace the three-up galleries with a feature list beside one large
screenshot: every item's text stays visible, clicking an item or one of
its views switches the image with a cross-fade, and the list plays itself
while on screen until the visitor picks something.
- Add Confluence, DingTalk, BrowserSkill and more model vendors to the
integrations, bump the header badge to v0.8.2 and link the changelog.
- check-site reports missing docs screenshots as pending instead of
failing, since the Screenshot component renders a placeholder for them.
* docs(changelog): add v0.8.2 release notes
* docs(website): add per-version release notes pages
Add a "版本发布" docs section with one page per release, starting with
v0.8.2 and a backfilled v0.8.0. Each page walks through the highlights
with the existing product screenshots, the other improvements and fixes,
and an upgrade checklist with the actions each breaking change needs.
The sidebar orders these pages by version, newest first; the docs header
gains a 版本 entry, and the homepage's v0.8.2 section now links to the
release notes page instead of the raw CHANGELOG.
* feat(website): let the site image listen on a configurable port
The Docker image hard-coded `listen 80`, so running it with host
networking or on a platform that assigns the container port required
editing the Nginx config and rebuilding. The image now renders its
config from the official nginx template directory at startup and reads
the listen port from `PORT` (default 80); deploy/nginx.conf stays a plain
config for static deployments.
test-docker starts a second container with PORT=8080 and checks the
rendered config and that the site answers on that port; the README
documents the variable.
* fix(website): namespace the nginx listen port variable
* fix(website): support bash-wrapped container startup
* fix(website): align nginx startup with frontend entrypoint
* fix(website): pin nginx runtime for older host compatibility
* fix(website): bake the configured nginx port into the image
2026-09-24 03:26:34 +00:00
|
|
|
|
| 确认待确认项 | 推断条目从 pending 变为可用;未确认不会注入提示词。若推断用于修改已有记忆,确认前旧条目继续生效,确认时一并替换;推断已失效时确认会失败,需刷新列表 |
|
2026-09-08 02:54:41 +00:00
|
|
|
|
| 拒绝 / 删除 | 撤销错误或不再需要的记忆,拒绝留下抑制记录,减少重复提取 |
|
|
|
|
|
|
| 主题提升 | 把反复讨论的主题立即变为长期关注,也可停止跟踪主题 |
|
|
|
|
|
|
| 文档偏好 | 查看反复引用的文档,移除不再需要的个性化检索偏好 |
|
|
|
|
|
|
| 立即整理 | 合并近义条目、归档到期事项,不必等待后台整理 |
|
|
|
|
|
|
| 导出 / 清空 | 下载自己的 JSON 记忆,或清空自己的记忆数据 |
|
|
|
|
|
|
|
|
|
|
|
|
记忆条目分为资料、偏好、事实、事项和兴趣。同一主题的新事实可替代旧事实。关闭个人开关会暂停使用,删除或清空会移除数据。接口中的类别与状态值见[记忆 API](../04-api/02-api-memory.md)。
|
|
|
|
|
|
|
|
|
|
|
|
## 对回答和检索的影响
|
|
|
|
|
|
|
docs: sync website-docs, homepage and changelog for v0.8.2 (#3632)
* docs: sync website-docs with changes since v0.8.0
Audit every change between v0.8.0 and the v0.8.2 release against the
documentation site, adding what users and operators need and correcting
statements that no longer match the code.
- Add local browser (BrowserSkill), built-in MCP Server endpoints, the
toolbox, conversation steer/fork/rewind and reasoning effort, the
artifacts library, sandbox terminal and desktop, the Lite host sandbox,
the rebuilt model catalog (including a protocol-compat field reference),
Confluence and DingTalk Docs sources, Bocha/Serply search, per-channel IM
locale, whitelist-only outbound, admin user creation, new configuration
variables and migrations 000091-000110.
- Fix wrong API examples and parameters (model type values, knowledge
search params, FAQ match_count cap, Notion credentials), tenant deletion
semantics, default timeouts, parser engine claims, removed tables and
commands, stale navigation paths, and route locations after the router
split into routes_*.go.
- Add screenshots for the new pages and refresh outdated ones.
* fix(frontend): link the protocol-compat field to its documentation
The model editor told users to read catalog/compat.go on the backend, a
path that no longer exists after the model catalog refactor. The hint now
says when the override is needed and links to the field reference in
website-docs/03-features/06-models.md; the config examples and the API
type comment point to the same place.
* feat(website): showcase v0.8.2 on the homepage
- Add a v0.8.2 section for the local browser (BrowserSkill), the built-in
MCP Server and conversation control, and turn the v0.8.0 release block
into a standing skills & sandbox topic with the sandbox desktop and
terminal.
- Replace the three-up galleries with a feature list beside one large
screenshot: every item's text stays visible, clicking an item or one of
its views switches the image with a cross-fade, and the list plays itself
while on screen until the visitor picks something.
- Add Confluence, DingTalk, BrowserSkill and more model vendors to the
integrations, bump the header badge to v0.8.2 and link the changelog.
- check-site reports missing docs screenshots as pending instead of
failing, since the Screenshot component renders a placeholder for them.
* docs(changelog): add v0.8.2 release notes
* docs(website): add per-version release notes pages
Add a "版本发布" docs section with one page per release, starting with
v0.8.2 and a backfilled v0.8.0. Each page walks through the highlights
with the existing product screenshots, the other improvements and fixes,
and an upgrade checklist with the actions each breaking change needs.
The sidebar orders these pages by version, newest first; the docs header
gains a 版本 entry, and the homepage's v0.8.2 section now links to the
release notes page instead of the raw CHANGELOG.
* feat(website): let the site image listen on a configurable port
The Docker image hard-coded `listen 80`, so running it with host
networking or on a platform that assigns the container port required
editing the Nginx config and rebuilding. The image now renders its
config from the official nginx template directory at startup and reads
the listen port from `PORT` (default 80); deploy/nginx.conf stays a plain
config for static deployments.
test-docker starts a second container with PORT=8080 and checks the
rendered config and that the site answers on that port; the README
documents the variable.
* fix(website): namespace the nginx listen port variable
* fix(website): support bash-wrapped container startup
* fix(website): align nginx startup with frontend entrypoint
* fix(website): pin nginx runtime for older host compatibility
* fix(website): bake the configured nginx port into the image
2026-09-24 03:26:34 +00:00
|
|
|
|
系统将资料、偏好和兴趣作为受长度限制的常驻上下文,按当前问题召回相关事实和事项。配置向量模型后,语义召回在该身份的全部记忆中按与问题的相关度排序,不受条目重要度影响;PostgreSQL 启用 pgvector 时在数据库内排序,其余环境在服务内计算。智能推理还可主动搜索记忆与历史对话。记忆仅影响问题理解和资料选择,不扩展知识库访问权限。
|
2026-09-08 02:54:41 +00:00
|
|
|
|
|
docs: sync website-docs, homepage and changelog for v0.8.2 (#3632)
* docs: sync website-docs with changes since v0.8.0
Audit every change between v0.8.0 and the v0.8.2 release against the
documentation site, adding what users and operators need and correcting
statements that no longer match the code.
- Add local browser (BrowserSkill), built-in MCP Server endpoints, the
toolbox, conversation steer/fork/rewind and reasoning effort, the
artifacts library, sandbox terminal and desktop, the Lite host sandbox,
the rebuilt model catalog (including a protocol-compat field reference),
Confluence and DingTalk Docs sources, Bocha/Serply search, per-channel IM
locale, whitelist-only outbound, admin user creation, new configuration
variables and migrations 000091-000110.
- Fix wrong API examples and parameters (model type values, knowledge
search params, FAQ match_count cap, Notion credentials), tenant deletion
semantics, default timeouts, parser engine claims, removed tables and
commands, stale navigation paths, and route locations after the router
split into routes_*.go.
- Add screenshots for the new pages and refresh outdated ones.
* fix(frontend): link the protocol-compat field to its documentation
The model editor told users to read catalog/compat.go on the backend, a
path that no longer exists after the model catalog refactor. The hint now
says when the override is needed and links to the field reference in
website-docs/03-features/06-models.md; the config examples and the API
type comment point to the same place.
* feat(website): showcase v0.8.2 on the homepage
- Add a v0.8.2 section for the local browser (BrowserSkill), the built-in
MCP Server and conversation control, and turn the v0.8.0 release block
into a standing skills & sandbox topic with the sandbox desktop and
terminal.
- Replace the three-up galleries with a feature list beside one large
screenshot: every item's text stays visible, clicking an item or one of
its views switches the image with a cross-fade, and the list plays itself
while on screen until the visitor picks something.
- Add Confluence, DingTalk, BrowserSkill and more model vendors to the
integrations, bump the header badge to v0.8.2 and link the changelog.
- check-site reports missing docs screenshots as pending instead of
failing, since the Screenshot component renders a placeholder for them.
* docs(changelog): add v0.8.2 release notes
* docs(website): add per-version release notes pages
Add a "版本发布" docs section with one page per release, starting with
v0.8.2 and a backfilled v0.8.0. Each page walks through the highlights
with the existing product screenshots, the other improvements and fixes,
and an upgrade checklist with the actions each breaking change needs.
The sidebar orders these pages by version, newest first; the docs header
gains a 版本 entry, and the homepage's v0.8.2 section now links to the
release notes page instead of the raw CHANGELOG.
* feat(website): let the site image listen on a configurable port
The Docker image hard-coded `listen 80`, so running it with host
networking or on a platform that assigns the container port required
editing the Nginx config and rebuilding. The image now renders its
config from the official nginx template directory at startup and reads
the listen port from `PORT` (default 80); deploy/nginx.conf stays a plain
config for static deployments.
test-docker starts a second container with PORT=8080 and checks the
rendered config and that the site answers on that port; the README
documents the variable.
* fix(website): namespace the nginx listen port variable
* fix(website): support bash-wrapped container startup
* fix(website): align nginx startup with frontend entrypoint
* fix(website): pin nginx runtime for older host compatibility
* fix(website): bake the configured nginx port into the image
2026-09-24 03:26:34 +00:00
|
|
|
|
开启检索个性化后,系统用主题帮助理解问题,并用反复引用的文档辅助排序。对话时间线会显示记忆相关步骤。后台任务按会话记录提取游标和待处理状态,短时间连续发问、批次截断或服务重启都不会遗漏消息。某段消息的模型输出持续无法解析时,最多重试三轮后跳过该段并继续处理后续消息,跳过的消息不会自动补提取。
|
2026-09-08 02:54:41 +00:00
|
|
|
|
|
|
|
|
|
|
## 排查记忆未生效的问题 {#排查}
|
|
|
|
|
|
|
|
|
|
|
|
| 现象 | 检查 |
|
|
|
|
|
|
| --- | --- |
|
|
|
|
|
|
| 没有使用记忆 | 空间开关、个人开关、智能体开关,确认是否换了空间或身份 |
|
|
|
|
|
|
| 自动提取未出现 | write_mode、抽取延迟/最短间隔、模型连接与后台任务 |
|
|
|
|
|
|
| 推断未影响回答 | 是否仍为 pending;确认后才会使用 |
|
|
|
|
|
|
| 不再希望引用某文档 | 在文档偏好中移除;知识库权限仍独立控制 |
|
|
|
|
|
|
| 立即整理未合并任何条目 | 查看返回的 skipped 原因,可能条目过少或无候选 |
|
|
|
|
|
|
|
|
|
|
|
|
## 空间配置
|
|
|
|
|
|
|
|
|
|
|
|
空间管理员可通过设置页维护记忆开关、提取模式和模型。配置保存在 `memory_config`,通过 `GET/PUT /tenants/kv/memory-config` 读取和更新,完整字段见[记忆 API](../04-api/02-api-memory.md)。
|
|
|
|
|
|
|
docs: sync website-docs, homepage and changelog for v0.8.2 (#3632)
* docs: sync website-docs with changes since v0.8.0
Audit every change between v0.8.0 and the v0.8.2 release against the
documentation site, adding what users and operators need and correcting
statements that no longer match the code.
- Add local browser (BrowserSkill), built-in MCP Server endpoints, the
toolbox, conversation steer/fork/rewind and reasoning effort, the
artifacts library, sandbox terminal and desktop, the Lite host sandbox,
the rebuilt model catalog (including a protocol-compat field reference),
Confluence and DingTalk Docs sources, Bocha/Serply search, per-channel IM
locale, whitelist-only outbound, admin user creation, new configuration
variables and migrations 000091-000110.
- Fix wrong API examples and parameters (model type values, knowledge
search params, FAQ match_count cap, Notion credentials), tenant deletion
semantics, default timeouts, parser engine claims, removed tables and
commands, stale navigation paths, and route locations after the router
split into routes_*.go.
- Add screenshots for the new pages and refresh outdated ones.
* fix(frontend): link the protocol-compat field to its documentation
The model editor told users to read catalog/compat.go on the backend, a
path that no longer exists after the model catalog refactor. The hint now
says when the override is needed and links to the field reference in
website-docs/03-features/06-models.md; the config examples and the API
type comment point to the same place.
* feat(website): showcase v0.8.2 on the homepage
- Add a v0.8.2 section for the local browser (BrowserSkill), the built-in
MCP Server and conversation control, and turn the v0.8.0 release block
into a standing skills & sandbox topic with the sandbox desktop and
terminal.
- Replace the three-up galleries with a feature list beside one large
screenshot: every item's text stays visible, clicking an item or one of
its views switches the image with a cross-fade, and the list plays itself
while on screen until the visitor picks something.
- Add Confluence, DingTalk, BrowserSkill and more model vendors to the
integrations, bump the header badge to v0.8.2 and link the changelog.
- check-site reports missing docs screenshots as pending instead of
failing, since the Screenshot component renders a placeholder for them.
* docs(changelog): add v0.8.2 release notes
* docs(website): add per-version release notes pages
Add a "版本发布" docs section with one page per release, starting with
v0.8.2 and a backfilled v0.8.0. Each page walks through the highlights
with the existing product screenshots, the other improvements and fixes,
and an upgrade checklist with the actions each breaking change needs.
The sidebar orders these pages by version, newest first; the docs header
gains a 版本 entry, and the homepage's v0.8.2 section now links to the
release notes page instead of the raw CHANGELOG.
* feat(website): let the site image listen on a configurable port
The Docker image hard-coded `listen 80`, so running it with host
networking or on a platform that assigns the container port required
editing the Nginx config and rebuilding. The image now renders its
config from the official nginx template directory at startup and reads
the listen port from `PORT` (default 80); deploy/nginx.conf stays a plain
config for static deployments.
test-docker starts a second container with PORT=8080 and checks the
rendered config and that the site answers on that port; the README
documents the variable.
* fix(website): namespace the nginx listen port variable
* fix(website): support bash-wrapped container startup
* fix(website): align nginx startup with frontend entrypoint
* fix(website): pin nginx runtime for older host compatibility
* fix(website): bake the configured nginx port into the image
2026-09-24 03:26:34 +00:00
|
|
|
|
| 名称 | 类型 | 默认值 | 说明 |
|
|
|
|
|
|
| --- | --- | --- | --- |
|
|
|
|
|
|
| `enabled` | bool | `false` | 空间开关 |
|
|
|
|
|
|
| `write_mode` | string | `explicit_only` | `explicit_only` / `auto`,其他值按 `explicit_only` 处理 |
|
|
|
|
|
|
| `extract_model_id` | string | 空 | 抽取模型,空值沿用对话模型 |
|
|
|
|
|
|
| `extract_delay_seconds` | int | `90` | 回答完成后延迟提取,合并短时间内的多轮消息;范围 5–3600 |
|
|
|
|
|
|
| `extract_min_interval_seconds` | int | `300` | 同一人两次提取的最短间隔,控制调用频率,间隔内的消息顺延处理;最大 86400 |
|
|
|
|
|
|
| `extract_instructions` | string | 空 | 空间自己的提取规则,最多 1000 字 |
|
|
|
|
|
|
| `max_items` | int | `200` | 每个身份的活跃记忆上限,最大 2000;0 使用默认值 |
|
|
|
|
|
|
| `interest_threshold` | int | `3` | 主题在多少个会话中出现后形成关注,最大 20 |
|
|
|
|
|
|
| `embedding_model_id` | string | 空 | 记忆召回使用的向量模型;为空时只做词法匹配 |
|
|
|
|
|
|
| `vector_recall` | bool | 省略即开启 | 配置了向量模型时是否启用语义召回 |
|
|
|
|
|
|
| `retrieval_conditioning` | bool | 省略即开启 | 允许记忆影响问题理解和文档排序 |
|
2026-09-08 02:54:41 +00:00
|
|
|
|
|
|
|
|
|
|
提取模型用于后台归纳,向量模型用于匹配当前问题。记忆功能会增加对应的模型调用;模型被记忆配置引用时,删除模型会显示依赖详情。
|
|
|
|
|
|
|
|
|
|
|
|
## 实现参考
|
|
|
|
|
|
|
|
|
|
|
|
- `internal/application/service/memory/`:作用域、抽取、召回、主题、文档偏好、整理
|
|
|
|
|
|
- `internal/handler/memory.go`、`internal/router/routes_memory.go`:个人 API
|
|
|
|
|
|
- `internal/types/memory.go`:模型、预算、状态和配置
|
|
|
|
|
|
- `frontend/src/views/settings/MemorySettings.vue`、`MemoryWorkspaceSettings.vue`
|