mirror of
https://gitcode.com/JianFeeeee/HomeAgent.git
synced 2026-10-03 15:53:56 +00:00
fix: 三层记忆/知识库数据泄漏修复 + 系统提示词动态化
问题修复: - distiller: Append 添加 memDB==nil 守卫,避免数据泄漏 - indexer: 启动时立即 Sync(),消除前30分钟空窗期 - 系统提示词: 移除硬编码的13项工具列表,改为动态分类说明 - doc_query: 消去 Query+Consume 重复搜索,改为 Consume 一次完成 - extractKeyTriples: 从原文 dump 改为规则提取(姓名/居住地/喜好/年龄/职业)
This commit is contained in:
@ -986,12 +986,10 @@ func (a *Agent) executeDocTool(tc agentAPI.ToolCall) string {
|
||||
if query == "" {
|
||||
return "请输入查询内容"
|
||||
}
|
||||
docs := a.docStore.Query(query, topK)
|
||||
docs := a.docStore.Consume(query, topK)
|
||||
if len(docs) == 0 {
|
||||
return "未找到相关文档记忆"
|
||||
}
|
||||
// 返回内容后从冷层移除,避免后续自动注入重复
|
||||
a.docStore.Consume(query, topK)
|
||||
var parts []string
|
||||
for i, d := range docs {
|
||||
parts = append(parts, fmt.Sprintf("[%d] %s (来源: %s)", i+1, d.Summary, d.Source))
|
||||
|
||||
Reference in New Issue
Block a user