Skip to content

Commit 1d4e508

Browse files
dirkbrndysolanky
authored andcommitted
Fix memory for teams (agno-agi#3085)
## Summary We incorrectly instantiate memory for teams, ## Type of change - [x] Bug fix - [ ] New feature - [ ] Breaking change - [ ] Improvement - [ ] Model update - [ ] Other: --- ## Checklist - [ ] Code complies with style guidelines - [ ] Ran format/validation scripts (`./scripts/format.sh` and `./scripts/validate.sh`) - [ ] Self-review completed - [ ] Documentation updated (comments, docstrings) - [ ] Examples and guides: Relevant cookbook examples have been included or updated (if applicable) - [ ] Tested in clean environment - [ ] Tests added/updated (if applicable) --- ## Additional Notes Add any important context (deployment instructions, screenshots, security considerations, etc.) --------- Co-authored-by: Yash Pratap Solanky <[email protected]>
1 parent 8b9f7e1 commit 1d4e508

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

cookbook/storage/mongodb_storage/mongodb_storage_for_team.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ class Article(BaseModel):
5757
markdown=True,
5858
debug_mode=True,
5959
show_members_responses=True,
60+
add_member_tools_to_system_message=False
6061
)
6162

6263
hn_team.print_response("Write an article about the top 2 stories on hackernews")

libs/agno/agno/team/team.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6178,11 +6178,9 @@ def load_team_session(self, session: TeamSession):
61786178
if isinstance(self.memory, dict) and "create_user_memories" in self.memory:
61796179
# Convert dict to TeamMemory
61806180
self.memory = TeamMemory(**self.memory)
6181-
elif isinstance(self.memory, dict):
6182-
# Convert dict to Memory
6183-
self.memory = Memory(**self.memory)
61846181
else:
6185-
raise TypeError(f"Expected memory to be a dict or TeamMemory, but got {type(self.memory)}")
6182+
# Default to base memory
6183+
self.memory = Memory()
61866184

61876185
if session.memory is not None:
61886186
if isinstance(self.memory, TeamMemory):

0 commit comments

Comments
 (0)