Commit Graph

163 Commits

Author SHA1 Message Date
00fd75a0a6 fix: memory_recall/task_query 结果中的实体名也写入 recorder,供 WebUI 拉镜头 2026-04-28 21:19:10 +08:00
eab18889ff fix: 除 delete 外所有操作都拉镜头(query/create/update 等) 2026-04-28 21:12:27 +08:00
d971afb934 fix: recall/commit/anchor 节点也在 WebUI 高亮并拉镜头 2026-04-28 21:08:35 +08:00
1a394ddd2b fix: _init_graph 更新 _db_path 修复用户隔离
问题:
- _init_graph 正确解析了用户 DB 路径,但未更新 self._db_path
- web_api.py 的 create_server() 用 backend_server._db_path 创建 graph_db
- 导致所有用户共用一个 CWD/graph_memory.db(回忆图谱页面数据混在一起)
- 同时 jianf 的 config.json 首次创建时空 apikey,未正确写回

修复:
- _init_graph 解析用户路径后,同步更新 self._db_path
- 现在各用户 graph_db 和 config.json 完全隔离
2026-04-28 20:56:01 +08:00
12ab1df7f5 feat(webui): settings 页面可编辑工具调用限制与超时时间
- settings.html: 新增「工具调用限制」表单(5个字段)
- settings.html: 新增「消息超时」输入框
- server.py: _handle_set_settings 修复空 api_config 时不清空 API key
- 前后端 format:api_config 和 tool_limits 分开提交,互不影响
2026-04-28 20:39:26 +08:00
c1dc3f647b feat: message_timeout 可配,所有用户 config.json 统一
- 新增 _DEFAULT_CONFIG 字典管理通用配置(含 message_timeout)
- _load_config/_save_config 重构:先配置后限制,各自用独立默认值
- send() 超时从硬编码 300s 改为从 config.json 读取 message_timeout
- _handle_set_settings 支持接收 message_timeout 并持久化
- 所有用户 config.json 新增 message_timeout: 1200(20分钟)
2026-04-28 20:36:57 +08:00
4901d3882f fix: _handle_set_settings 补齐 task_query_max;更新所有用户 config.json 同步限制值 2026-04-28 20:33:48 +08:00
3de418b7e8 refactor: 工具调用限制全部移入 config.json,代码零硬编码
- 删除 server.py BackendServer.__init__ 中 _tool_limits 的硬编码字典
- _load_config 从 ~/.trulymem/config.json 读取全部限制值
- 首次启动无配置文件时自动生成带默认值的 config.json
- _create_tool_limiter 直接索引 _tool_limits 字典,无硬编码兜底
- 如需修改限制值,编辑 ~/.trulymem/config.json 即可生效(下次重启)
2026-04-28 20:30:24 +08:00
039dc41c0b fix: server.py 硬编码默认值覆盖 dataclass 的问题,同步为 20/30/30/15 2026-04-28 20:27:51 +08:00
39eee19a3e docs: 同步 task_archive 到架构文档 2026-04-28 20:23:33 +08:00
1fa548da3c feat: 新增 task_archive 工具 + 步骤6强制归档,解决工作记忆无限膨胀 2026-04-28 20:23:29 +08:00
7543fcae72 fix(webui): 侧边栏收起按钮统一为 btn 风格,消除割裂感 2026-04-28 20:17:30 +08:00
b9e4bb164d fix: 步骤2改为 task_query 替代 memory_recall,让AI意识到有专用任务查询工具 2026-04-28 20:13:55 +08:00
49d6906f15 docs: 同步 persona_remove 到架构文档 2026-04-28 20:09:44 +08:00
d228d119f5 feat: 新增 persona_remove 工具(删除单条人设属性),改进 persona_clear 支持动态查询所有属性类型 2026-04-28 20:09:41 +08:00
c72fc5f38f docs: 同步 task_query 工具到架构文档 2026-04-28 20:03:55 +08:00
0ccd02b0af feat: 新增 task_query 工具(查询最近任务列表),为工作记忆链提供可视化入口 2026-04-28 20:03:51 +08:00
bddb5498e9 fix: 调整工具调用限制 - 工作记忆链修改20次/查询30次,一般记忆查询30次/修改15次 2026-04-28 19:59:13 +08:00
598e03e2eb fix: 补充工具详解和任务生命周期规范,阻止AI无限链到当前轮对话
- 每个工具增加使用时机和详细说明
- 新增任务生命周期管理章节
- 明确要求 topic 转变后归档旧任务、创建新任务
- 禁止将所有节点都链到同一个 当前轮对话
2026-04-28 19:52:42 +08:00
8b34725872 test: 添加 PromptManager 和 Web API 基础测试
- test_prompt_manager.py: 验证系统提示词包含5步流程、所有工具列表、无Python函数注记
- test_web_api.py: 验证关键API端点存在、静态文件路径正确、提示词可加载
2026-04-28 19:46:34 +08:00
4d64da743a docs: 同步 system_prompt.md 的5步流程到文档,补充systemd部署说明 2026-04-28 19:46:00 +08:00
cc2241cac8 fix: 活动改为开关样式(与自动视角一致) 2026-04-28 19:33:57 +08:00
e7ddaee872 fix: 自动视角开关加上视觉反馈(滑钮滑动+颜色变化),活动改为可点击按钮 2026-04-28 19:28:28 +08:00
84f217ef55 fix: 在强制执行顺序中增加 memory_commit 步骤,恢复原提示词风格
- 新增步骤4: memory_commit (写入关键信息) → 强制AI每轮将用户提到的重要信息写入图数据库
- 恢复原提示词表述(图数据库是唯一记忆源、无Python函数注记、无冗余工具)
- 原提示词AI只查不写的问题根源:缺少写入指令
2026-04-28 18:40:30 +08:00
58dc93f061 fix: 修复自动视角开关点按无响应,将活动链接移至星图面板
- 给 auto-view 标签增加独立点击事件,确保开关点击能正确切换
- 将活动从底部导航栏移到星图面板的自动视角旁边
- 底部导航只保留星图和设置
2026-04-28 18:39:13 +08:00
f0e4c89ac0 fix: 强化系统提示词 - 明确图数据库是唯一记忆载体,补充缺失工具
- 将唯一记忆源替换为唯一记忆载体,明确说明不存在message数组
- 添加 memory_archive / memory_cleanup 到工具列表
- 补充人设/任务工具的Python函数说明
2026-04-28 18:33:05 +08:00
d676d34cd8 feat: fly-to-node on click and highlight read, autoView toggle respects fitCameraToGraph 2026-04-28 18:07:12 +08:00
ac113d6fb0 feat: add markdown rendering, API settings, star graph auto-view toggle
- index.html: markdown rendering with marked.js + DOMPurify XSS protection
- settings.html: API Key/Base URL/Model config form with save
- graph.html: auto camera transition toggle for add/read/delete nodes
2026-04-28 18:05:41 +08:00
fd2c688321 fix: clear edgeParticles on graph reload to prevent orphan balls floating off edges 2026-04-28 16:45:51 +08:00
ae04e4ddbe chore: remove harmonyos project files from main branch 2026-04-28 16:31:56 +08:00
ad382602f2 fix: auto-clean orphan entities on purge; fix graph camera zoom; optimize system prompt 2026-04-28 16:30:18 +08:00
aefaea7b90 docs: 更新 README 适配多用户+Admin 角色系统
- 移除旧的 web_config.example.json 指引(已替换为首次访问自动设置)
- 新增 TUI 登录引导描述
- 新增多用户隔离目录结构说明
- 新增 Admin/User 角色权限说明
- 新增打包构建双入口说明
2026-04-28 10:42:53 +08:00
05fc252db0 fix: 已有用户自动迁移 admin 角色
当 role 列通过 ALTER TABLE 新增后,已有用户全部为 'user'。
新增迁移逻辑:若无 admin 用户,自动将首个注册用户升为 admin。
2026-04-28 10:38:42 +08:00
b4456a9c5b 多用户系统 + Admin 角色权限 + Web/TUI 同步 + 构建集成
本轮实现功能:
1. 多用户隔离:每个用户独立 config.json + graph.db
2. TUI 登录页 + 旧版自动迁移(core/migrate.py)
3. Admin/User 角色体系(core/embedded_db.py)
4. Web 后台管理 API(userinfo + admin CRUD)
5. Web 设置页用户管理区(仅 admin 可见)
6. TUI 侧栏配置区权限同步(非 admin 隐藏 Web 服务设置)
7. Web 服务打包为独立二进制(trulymem-web)
8. 双入口 PyInstaller 构建脚本(TUI + Web)
9. 活动记录器(core/activity_recorder.py)
10. 静态页面模板(登录/设置/首次引导)
2026-04-28 10:37:57 +08:00
46008c14c5 feat: web login system, auto-load history, config extraction
- Add Flask session-based authentication (username/password login)
- Auto-load chat history from backend on page load
- Extract SECRET_KEY and user credentials to web_config.json
- Create web_config.example.json as template
- Add web_config.json to .gitignore (sensitive info)
- Update docs: architecture, API reference, quick start guides
2026-04-28 09:25:47 +08:00
0ebd1d7ac6 docs: sync documentation with source code
- Fix branch badge: test -> main in README files
- Update tool_limits config: remove non-existent persona_query_max and task_query_max fields
- Complete memory tools list: add memory_archive, memory_cleanup, context_rewrite
- Remove 'experimental' labels from context_rewrite feature
v1.0.0
2026-04-17 10:08:50 +08:00
de09eacabc fix: 修复 AppImage 构建脚本的多个问题
- 创建缺失的 usr/share/trulymem 目录
- 修复 desktop 文件分类,使用 X-AI 替代非标准的 AI
- 改进图标文件查找逻辑,支持多个可能的位置
- 添加完整的构建临时文件清理逻辑
- 成功时自动删除 AppDir,失败时保留以便调试

🤖 Generated with CodeArts Agent
2026-04-17 08:27:52 +08:00
14af13c050 update: 更新文件 README_EN.md
Signed-off-by: JianFeeeee <2198972886@qq.com>
2026-04-16 23:31:38 +08:00
47c5b99617 update: 更新文件 README.md
Signed-off-by: JianFeeeee <2198972886@qq.com>
2026-04-16 23:30:53 +08:00
e975fe409b !1 merge test into main
新增 context_rewrite 工具优化系统提示词

Created-by: JianFeeeee
Commit-by: JianFeeeee;root
Merged-by: JianFeeeee
Description: feat: 添加 context_rewrite 工具并清理工具限制器死配置
test: 修复测试套件结构问题
fix: 修复 context_rewrite 工具调用问题并优化系统提示词

See merge request: JianFeeeee/TrulyMEM-TrueHumanMEM!1
2026-04-16 23:28:54 +08:00
0270e17a76 fix: 修复 context_rewrite 工具调用问题并优化系统提示词
1. 修复 context_rewrite 导致的 API 错误

   - 删除错误的 tool 结果消息添加逻辑

   - 添加 context_compressed 标记让 AI 识别压缩结果

   - 将 context_rewrite 记录到 tool_calls 以便 TUI 显示

2. 优化系统提示词

   - 添加强制触发条件:每5次记忆工具调用必须调用 context_rewrite

   - 强化指代词处理规则:必须通过工作记忆链解析

   - 扩展时间指代词:添加刚刚

   - 更新执行检查清单

Generated with CodeArts Agent
2026-04-16 23:27:35 +08:00
fc5335a5c6 test: 修复测试套件结构问题
- 将 test_ui/__init__.py 中的测试代码移至 test_ui/test_ui.py
- 将 test_integration/__init__.py 中的测试代码移至 test_integration/test_integration.py
- 删除 test_packet.py 中重复的 TestToolLimiter 和 TestEmbeddedGraphDB
- 将 TestPacketTypeEnum 的 9 个重复测试合并为参数化测试
- 移除 conftest.py 中从未使用的 6 个 fixtures
- 修复 3 个预存测试 bug (update_config 不存在、limiter 断言、error 处理)
2026-04-16 14:53:38 +08:00
2aa6e9240f feat: 添加 context_rewrite 工具并清理工具限制器死配置
- 新增 context_rewrite 工具:允许 AI 在单轮内压缩工具调用上下文
- 清理 persona_query_max 和 task_query_max 死配置(commit 9be60ba 引入)
- 同步全栈:后端/前端/文档/测试 18 个文件
- 测试:70/70 通过
2026-04-16 14:33:21 +08:00
535fca933a fix: 修复工具调用限制器误判问题并优化记忆查询
1. 工具调用限制器修复 - 移除memory_recall关键词智能分类,统一归类为一般记忆查询

2. 工作记忆链限制调整 - 修改限制从2次/轮到5次/轮

3. 广度优先搜索实现 - 修复depth参数被忽略问题,添加深度标注

4. 提示词优化 - 新增强制执行顺序说明,明确task_link_info使用场景

Generated with CodeArts Agent
2026-04-16 08:35:54 +08:00
b7b2601180 feat: 将前端等待超时时间从30秒调整为5分钟
- 修改 core/server.py 中的响应超时时间

- 从 30 秒调整为 300 秒(5 分钟)

- 解决长对话超时中断问题
2026-04-15 23:01:06 +08:00
a1b60ed936 delete: 删除文件 TrulyMEM.spec
Signed-off-by: JianFeeeee <2198972886@qq.com>
2026-04-15 16:38:21 +08:00
f9b57bfa73 build: 添加 AppImage 打包脚本
- 新增 build_appimage.sh 脚本,支持先构建二进制再打包为 AppImage
- 二进制输出到 dist/ 目录
- AppDir 结构支持跨发行版兼容
2026-04-15 13:22:54 +08:00
09a45c52e7 docs: 修正 API 文档响应结构描述 + 添加缺失测试
- 修正 PROCESS_MESSAGE 响应数据访问路径 (result['content'] -> result['data']['content'])
- 添加 CLEAR_HISTORY 文档说明 (基于 SAVE_HISTORY 空消息实现)
- 添加 test_clear_history 和 test_send_message_is_alias 测试用例
- 优化 BackendClient 历史相关方法的返回值处理
2026-04-15 12:09:48 +08:00
a8dc24e7f3 fix: 修复UI层导入问题和历史加载逻辑 2026-04-15 11:15:51 +08:00
a282ec1a58 fix: 简化清空逻辑 - 空消息列表即清空 2026-04-15 11:10:29 +08:00