Skip to main content
When we call Team.run(), it creates a stateless, singular Team run. But what if we want to continue this conversation i.e. have a multi-turn conversation? That’s where “Sessions” come in. A session is collection of consecutive runs. In practice, a session in the context of a Team is a multi-turn conversation between a user and the Team. Using a session_id, we can connect the conversation history and state across multiple runs. See more details in the Agent Sessions documentation.

Multi-user, multi-session Teams

Each user that is interacting with a Team gets a unique set of sessions and you can have multiple users interacting with the same Team at the same time. Set a user_id to connect a user to their sessions with the Team. In the example below, we set a session_id to demo how to have multi-turn conversations with multiple users at the same time.

Conversation history

Teams with storage enabled automatically have access to the run history of the session (also called the “conversation history” or “chat history”). To learn more, see the Conversation History documentation.

Session Summaries

The Team can store a condensed representations of the session, useful when chat histories gets too long. This is called a “Session Summary” in Agno. To enable session summaries, set enable_session_summaries=True on the Team.

Customize Session Summaries

You can adjust the session summaries by providing a custom session_summary_prompt to the Team. The SessionSummaryManager class is responsible for handling the model used to create and update session summaries. You can adjust it to personalize how summaries are created and updated:
See the Session Summary Manager reference for more details.

Control what gets stored in the session

As your sessions grow, you may want to decide what data exactly is persisted. Agno provides three flags to optimize storage while maintaining full functionality during execution:
  • store_media - Controls storage of images, videos, audio, and files
  • store_tool_messages - Controls storage of tool calls and their results
  • store_history_messages - Controls storage of history messages

How it works

These flags only affect what gets persisted to the database. During execution, all data remains available to your team - media, tool results, and history are still accessible in the RunOutput object. The data is scrubbed right before saving to the database.This means:
  • Your team functionality remains unchanged
  • Tools can access all data they need during execution
  • Only the database storage is optimized

Developer Resources