Overview
Context management enables agents and teams to access relevant knowledge, configuration, and state information. Contexts provide a hierarchical way to share information across organizational boundaries.Context Types
Environment Context
Environment-level context provides configuration and knowledge that applies to all agents in a specific environment. Use cases:- Environment-specific API endpoints
- Shared knowledge bases
- Environment documentation
- Common procedures and runbooks
Team Context
Team-level context provides information specific to a team’s domain and responsibilities. Use cases:- Team-specific knowledge
- Shared procedures
- Team documentation
- Historical decisions and context
Context Manager
The context manager orchestrates context resolution across multiple levels:- Organization-level context
- Project-level context
- Environment-level context
- Team-level context
- Agent-level context
Context Resolution
When an agent executes, the context manager:- Collects context from all relevant levels
- Merges contexts with appropriate precedence
- Resolves variables and references
- Provides the final context to the agent
- Agent-specific context
- Team context
- Environment context
- Project context
- Organization context
Common Patterns
Adding Environment Context
Getting Environment Context
Adding Team Context
Getting Team Context
Generic Context Operations
Resolve Context with Inheritance
Context Use Cases
Knowledge Sharing
Share organizational knowledge across teams:- Architecture documentation
- Best practices
- Common patterns
- Historical decisions
Configuration Management
Manage configuration hierarchically:- API endpoints per environment
- Feature flags
- Resource limits
- Integration settings
Dynamic Behavior
Agents adapt behavior based on context:- Different approval rules per environment
- Environment-specific tools
- Team-specific knowledge
- Project-specific configurations
Best Practices
- Hierarchy: Use the appropriate level for each piece of context
- DRY Principle: Define shared context once at the appropriate level
- Documentation: Document what context is available and its purpose
- Versioning: Version context changes for auditability
- Secrets: Never store secrets in context - use the secrets API
- Size: Keep context focused - don’t dump entire documentation
- Updates: Update context when systems or processes change
Context vs. Configuration
Use context for:- Knowledge and documentation
- Shared information
- Non-sensitive configuration
- Dynamic, frequently-changing information
- Sensitive credentials
- API keys and tokens
- Static configuration
- Security-sensitive settings