docs(wiki): 记录跨会话记忆链路 + 管家Tab记忆展示架构
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled

- memory.md: 添加"跨会话记忆完整链路"章节,覆盖初始化/写入/读取/展示/数据库架构/关键文件地图
- butler.md: 添加"管家Tab记忆展示"章节,记录MemorySection数据源和组件结构
This commit is contained in:
iven
2026-04-22 19:13:08 +08:00
parent 4328e74157
commit 14f2f497b6
2 changed files with 116 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
---
title: 管家模式
updated: 2026-04-21
updated: 2026-04-22
status: active
tags: [module, butler, interaction]
---
@@ -72,6 +72,38 @@ idle → (检测新用户) → greeting_sent → waiting_response → completed
简洁侧边栏: `desktop/src/components/SimpleSidebar.tsx`
管家面板: `desktop/src/components/ButlerPanel.tsx` (3 区: 洞察/方案/记忆 + 行业专长卡片)
### 管家Tab记忆展示2026-04-22 增强)
> ButlerPanel 的 MemorySection 组件负责向用户展示管家了解的信息。
```
ButlerPanel (index.tsx)
├── InsightsSection — 痛点洞察
├── ProposalsSection — 方案建议
├── MemorySection — 记忆 + 用户画像 (增强后)
│ ├── 用户画像卡片 — agent_get → UserProfileStore (data.db)
│ │ ├── 行业/角色/沟通风格 (profile_store.update_field)
│ │ ├── 近期话题标签 (profile_store.add_recent_topic, 上限10)
│ │ └── 常用工具标签 (profile_store.add_preferred_tool, 上限10)
│ └── 记忆分组列表 — viking_ls + viking_read(L1) (memories.db)
│ ├── 偏好 (preferences) — 默认展开
│ ├── 知识 (knowledge) — 默认展开
│ ├── 经验 (experience) — 折叠
│ └── 会话 (sessions) — 折叠
└── 行业专长卡片 — industryStore
数据源:
记忆列表: listVikingResources("agent://{agent_id}/") → viking_ls
记忆摘要: readVikingResource(uri, "L1") → viking_read → L1 摘要 (并行加载)
用户画像: agent_get(agentId) → kernel.memory() → UserProfileStore.get() → data.db
关键文件:
desktop/src/components/ButlerPanel/MemorySection.tsx 记忆+画像展示组件
desktop/src/components/ButlerPanel/index.tsx 管家面板主组件
desktop/src/lib/viking-client.ts viking_ls/viking_read 客户端
desktop/src/lib/kernel-types.ts AgentInfo.userProfile 类型
```
### 行业配置 (V13 已接通)
- `desktop/src/store/industryStore.ts` — 行业配置 Zustand Store (persist, 离线缓存)
@@ -168,7 +200,10 @@ desktop/src-tauri/src/intelligence/
| `desktop/src/hooks/use-cold-start.ts` | 冷启动 4 阶段 |
| `desktop/src/store/uiModeStore.ts` | 双模式切换 |
| `desktop/src/components/SimpleSidebar.tsx` | 简洁模式侧边栏 |
| `desktop/src/components/ButlerPanel.tsx` | 管家面板 (洞察/方案/记忆) |
| `desktop/src/components/ButlerPanel/index.tsx` | 管家面板主组件 (洞察/方案/记忆/行业) |
| `desktop/src/components/ButlerPanel/MemorySection.tsx` | 记忆展示+用户画像卡片 (viking_read L1 + agent_get) |
| `desktop/src/components/ButlerPanel/InsightsSection.tsx` | 痛点洞察列表 |
| `desktop/src/components/ButlerPanel/ProposalsSection.tsx` | 方案建议列表 |
## 已知问题