feat(memory): Dreaming and versioned long-term memory - #3509
Merged
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
Member
Author
|
自动 Dreaming 定时能力已补齐(commit cb71431):\n\n- Dreaming 页新增自动开关,支持每日、每周、固定小时周期和浏览器 IANA 时区;默认关闭。\n- 新增按 tenant/user/agent scope 持久化的 schedule API 与数据库迁移,保存后返回下一次执行时间。\n- 复用现有 ScheduleSpec/LeaseScheduler;到期计划原子生成 trigger_source=schedule 的 queued audit,多实例通过 FOR UPDATE SKIP LOCKED 避免重复,同 scope 有活动任务时跳过本周期并推进。\n- 权限沿用 DREAMING VIEW_TENANT / EDIT_TENANT。\n\n验证:Dreaming 回归 138 passed;Ruff/ESLint/Next build PASS;真实 PostgreSQL 到期计划已自动生成并完成 run_id=13;Playwright 验证开启→2h→保存→刷新持久化→关闭,截图 /tmp/ac036-dreaming-schedule.png。AC-033~AC-036 PASS。 |
…_dreaming # Conflicts: # .gitignore # frontend/const/modelConfig.ts # frontend/package.json # frontend/public/locales/en/common.json # frontend/public/locales/zh/common.json # frontend/services/api.ts # sdk/nexent/core/agents/context/manager.py
…rfall, i18n
Backend:
- Add per-user configurable dreaming thresholds (min_score, min_recall_count,
min_unique_queries) stored in memory_dreaming_schedule_t
- Add clear/undo-clear endpoints for long-term memory with deactivated_version_id
- Implement 3-tier compression waterfall: not_needed -> semantic -> mechanical_fallback
- Add threshold columns to DB model and migrations (v2.5.0)
- Add timeout handling for stuck dreaming progress
Frontend:
- Add threshold configuration UI in Dreaming tab (per-user editable)
- Implement clear/undo flow with Option A: show cleared version card
(V{n} (已清空) | 0 chars | no compression) instead of empty state
- Add version history dropdown in current LTM section
- Add comprehensive i18n support (en + zh) for all Dreaming UI elements
- Fix expand/collapse with collapsible mode
- Adjust layout to 2:1 ratio (thresholds vs automatic dreaming)
SDK:
- Update version_builder with compression status tracking
Tests:
- Add/update unit tests for compressor and version builder
- Replace hardcoded '基础设置' tab label with t('memoryManageModal.baseSettings')
- Replace hardcoded page title/description with i18n keys
- Replace hardcoded memory ability description with i18n key
- Add memoryManageModal.baseSettingsDescription (zh/en)
- Add memoryManageModal.memoryAbilityDescription (zh/en)
- Rename '启用 Dreaming' to '长期记忆Dreaming算法' (i18n zh/en) - Fill threshold default values directly instead of placeholder hints - Remove parameter tags from Dreaming tab header - Add version dropdown in cleared state card (after clearing LTM) - Add version dropdown in empty state (when no active version exists) - Make expected_active_version_id optional for version activation (allows switching versions when no active version exists) - Remove unused fetchDreamingParameters call from DreamingPanel - Add DreamingConfigCards component for base settings thresholds
…_dreaming # Conflicts: # frontend/public/locales/en/common.json # frontend/public/locales/zh/common.json
WMC001
approved these changes
Aug 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
memory_long_term_version_t中保存不可变的 Markdown 版本,并以is_active作为当前生效版本的唯一事实来源。memory_dreaming_decision_t,每项决策对应一行记录。架构变更
长期记忆版本
memory_long_term_version_t,版本创建后保持不可变。is_active表示激活状态,不再维护 activation audit 或 config pointer。410 Gone。Dreaming 执行与审计
memory_dreaming_audit_t保存执行状态、阶段、计数、耗时、降级、遗漏及 evidence 元数据。memory_dreaming_decision_t将每项候选决策展开为类型明确的字段,包括:summarization,移除旧的compression阶段及 compressor 兼容别名。Chat 上下文
UI 与 API 行为
/memory/dreaming/*和/memory/long-term/{tenant|user}/*HTTP 路径不变。数据库迁移
ALTER。result_json或decisions JSONB结构升级,并按照原有顺序将历史决策展开为独立记录。验证结果
Dreaming进行中

Dreaming完成

租户记忆(仅人为编辑/预览)

用户记忆(可人为编辑/预览,也可由Dreaming写入)

长期记忆召回
