Files
zhuyongxin e3f20b1f06 chore: 归档 session-storage change
- 创建 devflow 项目档案(brief/evidence/decisions/acceptance)
- 更新 devflow/index.md 索引
- 移动 OpenSpec 到 archive
2026-06-26 17:33:56 +08:00

22 lines
871 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 会话存储体系
## 背景
当前 `diagnosis_record` 单表字段耦合在"告警分析"领域,无法支撑通用会话存储。缺少 Agent 决策链维度、检索质量明细、Token 消耗等可观测指标。
## 目标
将单表拆分为三表体系,覆盖 ChatService 和 AiOpsService 两个 Agent 的完整决策链记录,支撑可观测和评估。
## 范围
- 新建 3 张表(diagnosis_session / agent_step / tool_invocation)
- Flyway 迁移 + JPA Entity + Repository
- 改造 AgentLoggingHook 持久化 agent_step
- 改造 LookupKnowledgeTool 写入 tool_invocation
- ChatService / AiOpsService 支持 diagnosis_session 生命周期
- Token 用量追踪(TokenTrackingChatModel)
- 意图识别路由(单 Agent / 多 Agent)
- 删除旧 diagnosis_record 表
## 非目标
- 不涉及 UI 层面的会话展示
- 不涉及历史数据迁移