diff --git a/agent/agent.go b/agent/agent.go index 41f62be..5057d9f 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -181,7 +181,7 @@ func (a *Agent) ResetConversation() { if a.options.enableLongTermMemory { xlog.Info("Saving conversation", "agent", a.Character.Name, "conversation size", len(a.currentConversation)) - if a.options.enableSummaryMemory { + if a.options.enableSummaryMemory && len(a.currentConversation) > 0 { msg, err := a.askLLM(a.context.Context, []openai.ChatCompletionMessage{{ Role: "user",