Skip to content

🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming

feat: truncated history

莘权 马92402bedd4e2
diff --git a/metagpt/memory/brain_memory.py b/metagpt/memory/brain_memory.py
index d83611af1..04ae6593a 100644
--- a/metagpt/memory/brain_memory.py
+++ b/metagpt/memory/brain_memory.py
@@ -110,6 +110,7 @@ class BrainMemory(pydantic.BaseModel):
if self.to_int(msg.id, 0) <= self.to_int(self.last_history_id, -1):
return
self.history.append(msg.dict())
+ self.last_history_id = str(msg.id)
self.is_dirty = True
def exists(self, text) -> bool: