Update Chunking der KBs
release-tag / release-image (push) Successful in 1m44s

This commit is contained in:
2026-07-28 15:16:15 +02:00
parent 4cfdac042d
commit 45b3d1b2df
13 changed files with 650 additions and 111 deletions
+13 -1
View File
@@ -186,7 +186,7 @@ func (s *Service) Process(ctx context.Context, id int64) error {
}
run.CategoryBeforeName = categoryName(categories, t.CategoryID)
promptCats := shortlistCategories(t, categories, s.cfg.CategoryPromptLimit)
hits, err := s.knowledge.Search(ctx, t.Name+"\n"+stripHTML(t.Content), s.cfg.KnowledgeTopK)
hits, err := s.knowledge.Search(ctx, t.Name+"\n"+stripHTML(t.Content), s.cfg.KnowledgeTopK, categories)
if err != nil {
run.Reason = "knowledge_search_failed"
finish(err)
@@ -196,6 +196,15 @@ func (s *Service) Process(ctx context.Context, id int64) error {
run.KnowledgeTopID = hits[0].Doc.ID
run.KnowledgeTopTitle = hits[0].Doc.Title
run.KnowledgeScore = hits[0].Score
run.KnowledgeSemanticScore = hits[0].SemanticScore
run.KnowledgeTitleScore = hits[0].TitleScore
run.KnowledgeKeywordScore = hits[0].KeywordScore
run.KnowledgeCategoryScore = hits[0].CategoryScore
run.KnowledgeBestChunk = hits[0].BestChunkExcerpt
run.KnowledgeThreshold = s.cfg.KnowledgeMinScore
if hits[0].Doc.MinScore > run.KnowledgeThreshold {
run.KnowledgeThreshold = hits[0].Doc.MinScore
}
}
contextData := model.ContextSnapshot{}
if s.context != nil && s.cfg.ContextEnabled {
@@ -238,6 +247,9 @@ func (s *Service) Process(ctx context.Context, id int64) error {
run.ReplyDecision = result.ReplyDecision
run.ReplyProposed = result.Reply
run.KnowledgeID = result.KnowledgeID
if result.KnowledgeThreshold > 0 {
run.KnowledgeThreshold = result.KnowledgeThreshold
}
run.PolicyReason = result.CategoryDecision + "; " + result.ReplyDecision
if !canReply && result.Reply {
run.ReplyProposed = false
+1
View File
@@ -133,6 +133,7 @@ func (p Policy) Evaluate(t model.Ticket, d model.Decision, categories []model.Ca
if hit.Doc.MinScore > threshold {
threshold = hit.Doc.MinScore
}
res.KnowledgeThreshold = threshold
if !hit.Doc.AutoReply {
res.ReplyDecision = "reply_knowledge_auto_reply_disabled"
return res, nil