Skip to content

Commit 1450c78

Browse files
committed
Fix team memory
1 parent 27f7e79 commit 1450c78

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

libs/agno/agno/memory/v2/memory.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -673,6 +673,7 @@ def add_run(self, session_id: str, run: Union[RunResponse, TeamRunResponse]) ->
673673
"""Adds a RunResponse to the runs list."""
674674
if not self.runs:
675675
self.runs = {}
676+
676677
self.runs.setdefault(session_id, []).append(run)
677678
log_debug("Added RunResponse to Memory")
678679

libs/agno/agno/team/team.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6084,13 +6084,13 @@ def load_team_session(self, session: TeamSession):
60846084
try:
60856085
if self.memory.runs is None:
60866086
self.memory.runs = {}
6087+
self.memory.runs[session.session_id] = []
60876088
for run in session.memory["runs"]:
6088-
session_id = run["session_id"]
6089-
self.memory.runs[session_id] = []
6089+
run_session_id = run["session_id"]
60906090
if "team_id" in run:
6091-
self.memory.runs[session_id].append(TeamRunResponse.from_dict(run))
6091+
self.memory.runs[run_session_id].append(TeamRunResponse.from_dict(run))
60926092
else:
6093-
self.memory.runs[session_id].append(RunResponse.from_dict(run))
6093+
self.memory.runs[run_session_id].append(RunResponse.from_dict(run))
60946094
except Exception as e:
60956095
log_warning(f"Failed to load runs from memory: {e}")
60966096
if "team_context" in session.memory:

0 commit comments

Comments
 (0)