Skip to content

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

refactor: brain memory

莘权 马948d1577e4a5
diff --git a/metagpt/memory/memory.py b/metagpt/memory/memory.py
index bf9f0541c..f9dd5c1a3 100644
--- a/metagpt/memory/memory.py
+++ b/metagpt/memory/memory.py
@@ -8,7 +8,6 @@
from collections import defaultdict
from typing import Iterable, Type
-from metagpt.actions import Action
from metagpt.schema import Message
@@ -17,6 +16,8 @@ class Memory:
def __init__(self):
"""Initialize an empty storage list and an empty index dictionary"""
+ from metagpt.actions import Action
+
self.storage: list[Message] = []
self.index: dict[Type[Action], list[Message]] = defaultdict(list)