Skip to content

Commit 0950791

Browse files
committed
fix: skip KB if not enabled
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
1 parent f47d5d0 commit 0950791

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

core/agent/knowledgebase.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,16 @@ import (
1313
)
1414

1515
func (a *Agent) knowledgeBaseLookup(job *types.Job, conv Messages) Messages {
16-
if (!a.options.enableKB && !a.options.enableLongTermMemory && !a.options.enableSummaryMemory) ||
17-
len(conv) <= 0 {
16+
// Only run KB recall/lookup when KB is explicitly enabled; long-term/summary memory
17+
// only affect saving in saveConversation, not this lookup.
18+
if !a.options.enableKB || len(conv) <= 0 {
1819
xlog.Debug("[Knowledge Base Lookup] Disabled, skipping", "agent", a.Character.Name)
1920
return conv
2021
}
22+
if a.options.ragdb == nil {
23+
xlog.Debug("[Knowledge Base Lookup] No RAG DB configured, skipping", "agent", a.Character.Name)
24+
return conv
25+
}
2126

2227
var obs *types.Observable
2328
if job != nil && job.Obs != nil && a.observer != nil {

0 commit comments

Comments
 (0)