Skip to content

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

refactor: brain memory

莘权 马1b267d34dc98
diff --git a/metagpt/memory/brain_memory.py b/metagpt/memory/brain_memory.py
index 7677a9144..f3a3e3563 100644
--- a/metagpt/memory/brain_memory.py
+++ b/metagpt/memory/brain_memory.py
@@ -161,7 +161,7 @@ class BrainMemory(pydantic.BaseModel):
text_length = len(text)
max_count -= 1 # safeguard
- if not summary:
+ if summary:
await self.set_history_summary(history_summary=summary, redis_key=CONFIG.REDIS_KEY, redis_conf=CONFIG.REDIS)
return summary
raise openai.error.InvalidRequestError("text too long")