From 5a2be87f658d01bc5b3b7ecdba92ac69bf09dcf7 Mon Sep 17 00:00:00 2001
From: ai_xiaopei <xiaopei@aisim.cn>
Date: Thu, 03 Sep 2026 15:15:37 +0800
Subject: [PATCH] fix(search): 搜索准确性四连修——FTS5 MATCH 引号包裹(连字符不再被解析成 MINUS);KeywordSearch 截断按命中关键词数排序(高频 bigram 不再挤出强相关文档);原词奖励档(完整短语压过泛化 bigram);tags 字段真实参与评分(此前误用 Section)
---
internal/llm/client.go | 15 +++++++++++++--
1 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/internal/llm/client.go b/internal/llm/client.go
index 883cc63..44ff58b 100644
--- a/internal/llm/client.go
+++ b/internal/llm/client.go
@@ -39,6 +39,16 @@
ReviewDir string `yaml:"review_dir"`
DefaultType string `yaml:"default_type"`
} `yaml:"draft"`
+ // Search 搜索配置(双信号加权权重)
+ Search struct {
+ TextWeight float64 `yaml:"text_weight"` // 文本分权重(0~1,缺省 0.5)
+ } `yaml:"search"`
+ // Explore 探索预算配置(Task 7 预留)
+ Explore struct {
+ DefaultBudget int `yaml:"default_budget"`
+ HardBudget int `yaml:"hard_budget"`
+ TopN int `yaml:"top_n"`
+ } `yaml:"explore"`
}
// Client LLM 客户端
@@ -124,8 +134,9 @@
config.LLM.Primary.Temperature = 0.3
config.LLM.Primary.MaxTokens = 2000
config.LLM.Primary.DisableThinking = true
- config.KnowledgeBase.VaultPath = "~/aisim/note/001/笔记001"
- config.KnowledgeBase.DBPath = "~/.cache/kb-cli/kb.db"
+ // 默认路径同样经过 expandPath 展开,与成功加载分支保持一致
+ config.KnowledgeBase.VaultPath = expandPath("~/aisim/note/001/笔记001")
+ config.KnowledgeBase.DBPath = expandPath("~/.cache/kb-cli/kb.db")
config.Draft.ReviewDir = "待审阅"
config.Draft.DefaultType = "售后"
return config
--
Gitblit v1.10.0