Lower score threshold to 0.20 and add KB result logging
All checks were successful
BotServer CI/CD / build (push) Successful in 3m32s

This commit is contained in:
Rodrigo Rodriguez (Pragmatismo) 2026-04-15 16:28:41 -03:00
parent 2c6ed89319
commit 352ff8b45c

View file

@ -407,6 +407,9 @@ impl KbContextManager {
for result in results { for result in results {
let tokens = estimate_tokens(&result.content); let tokens = estimate_tokens(&result.content);
info!("KB result - score: {:.3}, tokens: {}, content_len: {}, path: {}",
result.score, tokens, result.content.len(), result.document_path);
if total_tokens + tokens > max_tokens { if total_tokens + tokens > max_tokens {
debug!( debug!(
@ -416,7 +419,7 @@ impl KbContextManager {
break; break;
} }
if result.score < 0.25 { if result.score < 0.20 {
debug!("Skipping low-relevance result (score: {})", result.score); debug!("Skipping low-relevance result (score: {})", result.score);
continue; continue;
} }