Context is the information the agent uses to understand and respond to your messages. OpenClaw automatically loads relevant context, manages token usage, and compacts context when needed to stay within model limits.
Moltbot automatically loads context:
Automatic Loading
- Session Context - Loads conversation history
- Memory Search - Finds relevant memories
- Tool Loading - Includes available tools
- Skill Context - Loads active skill information
Relevance
The agent loads only relevant context:
- Searches memories for related information
- Includes recent conversation history
- Loads tools that might be needed
- Keeps context focused and efficient
LLM models have context limits measured in tokens:
- Token Limits - Each model has a maximum context size
- Token Counting - Moltbot tracks token usage
- Automatic Management - Stays within limits automatically
Token Usage
Tokens are used for:
- System prompts
- Conversation history
- Memories
- Tool definitions
- Your messages
- Agent responses
When context approaches token limits, Moltbot compacts it:
How Compaction Works
- Summarization - Old context summarized
- Pruning - Less relevant information removed
- Preservation - Important information kept
- Automatic - Happens seamlessly
What Gets Compacted
- Old conversation history
- Less relevant memories
- Redundant information
What's Preserved
- Recent conversation
- Important memories
- System prompts
- Active tool definitions
Each session maintains its own context:
- Main Session - Shared context across DMs
- Group Sessions - Isolated context per group
- Isolated Sessions - Separate context for specific needs
Context Isolation
Different sessions don't share context:
- Groups have separate context
- Isolated sessions are independent
- Main session shares across DMs