Shared Team State
Team Session State enables sophisticated state management across teams of agents, with both shared and private state capabilities. Teams often need to coordinate on shared information (like a shopping list) while maintaining their own private metrics or configuration. Agno provides an elegant three-tier state system for this. Agno’s Team state management provides three distinct levels:- Team’s team_session_state - Shared state accessible by all team members.
- Team’s session_state - Private state only accessible by the team leader
- Agent’s session_state - Private state for each agent members
Team state propagates through nested team structures as well
How to use Team Session State
You can set theteam_session_state parameter on Team to share state between team members.
This state is available to all team members and is synchronized between them.
For example:
team_session_state attribute in tools.
For example:
Example
Here’s a simple example of a team managing a shared shopping list:team_session_state.py
Agentic Context
The Team Leader maintains a shared context that is updated agentically (i.e. by the team leader) and is sent to team members if needed. Agentic Context is critical for effective information sharing and collaboration between agents and the quality of the team’s responses depends on how well the team leader manages this shared agentic context. This could require higher quality models for the team leader to ensure the quality of the team’s responses.The tasks and responses of team members are automatically added to the team context, but Agentic Context needs to be enabled by the developer.
Enable Agentic Context
To enable the Team leader to maintain Agentic Context, setenable_agentic_context=True.
This will allow the team leader to maintain and update the team context during the run.