Skip to content

Commit c54f517

Browse files
authored
Merge branch 'main' into pull-filters-data-from-s3-instead-of-keeping-locally-ag-3072
2 parents 37e677e + 3a100f2 commit c54f517

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

libs/agno/agno/agent/agent.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2460,12 +2460,17 @@ def load_agent_session(self, session: AgentSession):
24602460
# If we haven't instantiated the memory yet, set it to the memory from the database
24612461
if self.memory is None:
24622462
self.memory = session.memory # type: ignore
2463-
2463+
24642464
if not (isinstance(self.memory, AgentMemory) or isinstance(self.memory, Memory)):
24652465
# Is it a dict of `AgentMemory`?
24662466
if isinstance(self.memory, dict) and "create_user_memories" in self.memory:
24672467
# Convert dict to AgentMemory
24682468
self.memory = AgentMemory(**self.memory)
2469+
# Convert dict to Memory
2470+
elif isinstance(self.memory, dict):
2471+
memory_dict = self.memory
2472+
memory_dict.pop("runs")
2473+
self.memory = Memory(**memory_dict)
24692474
else:
24702475
raise TypeError(f"Expected memory to be a dict or AgentMemory, but got {type(self.memory)}")
24712476

0 commit comments

Comments
 (0)