Overview
A session is a continuous conversation between a user and the agent. Sessions maintain the full message history within a context window and persist across channel reconnections and gateway restarts.Session Lifecycle
- Created: When a new user first messages the agent (or manually via the dashboard)
- Active: Receiving and processing messages
- Idle: No recent activity but context preserved
- Compacted: Context window was full, older messages summarized
Context Windows
Each session has a context window — the amount of conversation history the model can see. This is limited by the model’s maximum context length (typically 200K tokens for Claude). As conversations grow, ArgentOS monitors the context usage and triggers compaction when approaching the limit.Compaction
When a session’s context approaches the model’s limit, ArgentOS compacts the conversation:
This allows conversations to continue indefinitely without losing important context.
Session Storage
Sessions are stored in the gateway’s state directory:Cross-Channel Sessions
Session Configuration
Channel Scope
ThechannelScope option controls how Discord guild channels map to sessions:
| Mode | Behavior |
|---|---|
"collapsed" | All channels in a guild share one session |
"per-channel" | Each channel gets its own separate session |
Managing Sessions
- Via CLI
- Via Dashboard
