zhuyongxin
99d4f6f216
docs(rag): add comments on knowledge retrieval pipeline
...
Document the lookup_knowledge flow from L0 hints through L1 retrieval,
post-processing, packing, and Agent projection so the boundaries and
current limitations are easier to follow.
2026-07-27 16:26:06 +08:00
zhuyongxin
a74ccea5be
feat(knowledge): breadcrumb分块上下文 & LookupKnowledgeTool日志优化
...
- DocumentChunk新增breadcrumb字段,分块时构建完整标题层级路径
- DocumentChunkService splitByHeadings维护标题层级栈算法
- VectorIndexService 将breadcrumb写入Milvus metadata
- LookupKnowledgeTool日志替换为结构化摘要,替代原始MD预览
- L0返回策略:唯一匹配用正文摘要,多匹配+L1有结果仅元数据(不读文件)
- 新增buildCompactSummary / buildMetadataOnlySummary方法
- 安装frontend-design skill
- 创建mvp/文档目录(架构设计+会话存储方案)
- 更新测试适配新逻辑
2026-06-26 13:56:10 +08:00
zhuyongxin
ea77518880
feat(phase1): 完成文本提取和文档分块服务
...
Task 5.1: TextExtractor 服务
- 创建 TextExtractorService(仅支持 .md 和 .txt)
- 其他格式(.docx、.pdf)需通过外部转换服务先转为 Markdown
- 支持 UTF-8 编码的纯文本提取
- 提供文件格式验证方法
Task 5.2: 文档分块服务适配
- 修改 DocumentChunk DTO:添加 @Builder 支持
- 字段重命名:startIndex/endIndex → startOffset/endOffset
- 修复 DocumentChunkService 中的三处构造调用
- 使用 builder 模式替代构造函数
技术决策:
- 简化文本提取,只支持 Markdown 和纯文本
- 复杂格式转换由外部服务处理(分离关注点)
- 统一使用 Lombok @Builder 简化对象构建
编译验证:BUILD SUCCESS
Progress: 25/33 tasks completed (76%)
2026-06-23 15:15:10 +08:00
zhuyongxin
c3a232540a
refactor(phase1): 完成包名重构 (org.example → com.superbiz.agent)
...
Task 4.1: 包名统一重构
- 重命名 41 个 Java 文件的包名
- 更新所有 import 语句
- 恢复枚举类(FaultCategory、DiagnosisStatus、SourceType)
- 更新测试类的 import
重构范围:
- domain/entity: 3 个实体类
- domain/model: 2 个数据类
- domain/enums: 3 个枚举类
- repository: 3 个接口
- service/session: 2 个类(接口 + 实现)
- config: 9 个配置类
- controller: 2 个控制器
- agent/tool: 4 个工具类
- client: 1 个客户端
- Main.java: 主类
验证结果:
- 编译成功,无错误
- 所有测试通过 (27/27)
- ApiDocumentRepositoryTest: 7/7 ✅
- CaseLibraryRepositoryTest: 6/6 ✅
- DiagnosisRecordRepositoryTest: 6/6 ✅
- RedisSessionManagerTest: 8/8 ✅
Progress: 21/33 tasks completed (64%)
2026-06-23 14:56:04 +08:00