SessionConfig
autogen.beta.mcp.sessions.SessionConfig dataclass #
Tunables for session-keyed multi-turn history on :class:MCPServer.
Each MCP session (keyed by the transport's mcp-session-id) gets its own conversation history that accumulates across tools/call invocations. The registry is bounded so a long-lived server cannot leak memory:
max_sessions— LRU cap; the least-recently-used session's history is dropped once the cap is exceeded.ttl— optional idle expiry in seconds; a session untouched for longer than this has its history dropped on the next access (None= no expiry).storage— pluggable history backend shared across sessions (each keyed by its own stream id). Defaults to an in-memory :class:MemoryStorage; pass e.g. a Redis-backed :class:Storagefor cross-replica continuity.