Skip to main content
There are multiple ways to share state between team members.

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 the team_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:
Members can access the shared state using the 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
Notice how shared tools use agent.team_session_state, which allows state to propagate and persist across the entire team — even for subteams within the team. This ensures consistent shared state for all members.In contrast, tools specific to a team use team.session_state, allowing for private, team-specific state. For example, a team leader’s tools would maintain their own session state using team.session_state.
See a full example here.

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, set enable_agentic_context=True. This will allow the team leader to maintain and update the team context during the run.

Team Member Interactions

Agent Teams can share interactions between members, allowing agents to learn from each other’s outputs: