Skip to content

armgit / letta

Public Imported from GitHub
0

Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.

fix: fix docker image (#1920)

Sarah Wooders440df34f16d8
diff --git a/letta/services/summarizer/summarizer.py b/letta/services/summarizer/summarizer.py
index d8a52efa1..dbcd76dba 100644
--- a/letta/services/summarizer/summarizer.py
+++ b/letta/services/summarizer/summarizer.py
@@ -104,18 +104,20 @@ class Summarizer:
formatted_evicted_messages[i] = f"{line_number}. " + formatted_evicted_messages[i]
line_number += 1
for i in range(len(formatted_in_context_messages)):
- formatted_evicted_messages[i] = f"{line_number}. " + formatted_evicted_messages[i]
+ formatted_in_context_messages[i] = f"{line_number}. " + formatted_in_context_messages[i]
line_number += 1
+ evicted_messages_str = "\n".join(formatted_evicted_messages)
+ in_context_messages_str = "\n".join(formatted_in_context_messages)
summary_request_text = f"""You are a specialized memory recall agent assisting another AI agent by asynchronously reorganizing its memory storage. The LLM agent you are helping maintains a limited context window that retains only the most recent {self.message_buffer_min} messages from its conversations. The provided conversation history includes messages that are about to be evicted from its context window, as well as some additional recent messages for extra clarity and context.
Your task is to carefully review the provided conversation history and proactively generate detailed, relevant memories about the human participant, specifically targeting information contained in messages that are about to be evicted from the context window. Your notes will help preserve critical insights, events, or facts that would otherwise be forgotten.
(Older) Evicted Messages:
-{"\n".join(formatted_evicted_messages)}
+{evicted_messages_str}
(Newer) In-Context Messages:
-{"\n".join(formatted_in_context_messages)}
+{in_context_messages_str}
"""
# Fire-and-forget the summarization task