Supervisor Configuration Guide
The Lobster supervisor agent now features a dynamic, configuration-driven prompt system that automatically discovers agents and their capabilities, eliminati...
Overview
The Lobster supervisor agent now features a dynamic, configuration-driven prompt system that automatically discovers agents and their capabilities, eliminating the need for manual updates when adding new agents.
Key Features
- Automatic Agent Discovery: Supervisor automatically knows about all registered agents
- Configurable Behavior: Customize interaction style via environment variables
- Dynamic Prompt Generation: Prompt adapts based on active agents and configuration
- Backward Compatible: Default settings maintain existing behavior
- Multiple Operation Modes: Research, Production, and Development modes
Configuration Options
Environment Variables
| Variable | Type | Default | Description |
|---|---|---|---|
SUPERVISOR_ASK_QUESTIONS | bool | true | Whether to ask clarification questions |
SUPERVISOR_MAX_QUESTIONS | int | 3 | Maximum number of clarification questions |
SUPERVISOR_REQUIRE_CONFIRMATION | bool | true | Require confirmation before downloads |
SUPERVISOR_REQUIRE_PREVIEW | bool | true | Require metadata preview before downloads |
SUPERVISOR_AUTO_SUGGEST | bool | true | Automatically suggest next steps |
SUPERVISOR_VERBOSE | bool | false | Verbose delegation explanations |
SUPERVISOR_WORKFLOW_GUIDANCE | str | standard | Guidance level: minimal, standard, detailed |
SUPERVISOR_DELEGATION_STRATEGY | str | auto | Strategy: auto, conservative, aggressive |
SUPERVISOR_ERROR_HANDLING | str | informative | Error mode: silent, informative, verbose |
SUPERVISOR_INCLUDE_DATA | bool | true | Include data context in prompt |
SUPERVISOR_INCLUDE_WORKSPACE | bool | true | Include workspace status |
SUPERVISOR_AUTO_DISCOVER | bool | true | Auto-discover agents from registry |
Configuration Modes
Research Mode (Interactive)
Best for exploratory analysis and development.
export SUPERVISOR_ASK_QUESTIONS=true
export SUPERVISOR_WORKFLOW_GUIDANCE=detailed
export SUPERVISOR_REQUIRE_CONFIRMATION=trueCharacteristics:
- Asks clarification questions (up to 3)
- Provides detailed workflow guidance
- Requires explicit confirmation for downloads
- Includes examples and detailed instructions
Production Mode (Automated)
Optimized for automated workflows and pipelines.
export SUPERVISOR_ASK_QUESTIONS=false
export SUPERVISOR_WORKFLOW_GUIDANCE=minimal
export SUPERVISOR_REQUIRE_CONFIRMATION=falseCharacteristics:
- No clarification questions
- Minimal workflow guidance
- Proceeds with downloads automatically
- Streamlined prompt for efficiency
Development Mode (Verbose)
Useful for debugging and understanding system behavior.
export SUPERVISOR_VERBOSE=true
export SUPERVISOR_WORKFLOW_GUIDANCE=detailed
export SUPERVISOR_INCLUDE_SYSTEM=trueCharacteristics:
- Detailed delegation explanations
- Full workflow documentation
- System information included
- Maximum transparency
How It Works
1. Agent Discovery (v1.0.0+)
The system automatically discovers all registered agents via Python entry points:
# Each agent module defines AGENT_CONFIG at module top
from lobster.core.registry import AgentRegistryConfig
AGENT_CONFIG = AgentRegistryConfig(
name='new_agent',
display_name='New Agent',
description='Agent purpose',
factory_function='your_package.agents.new_agent:new_agent',
tier_requirement='free'
)2. Dynamic Prompt Building
The supervisor prompt is built dynamically based on:
- Active agents discovered via ComponentRegistry
- Configuration settings
- Current data context
- Workspace status
3. Capability Extraction
The system can optionally extract and display agent capabilities:
- Discovers @tool decorated functions
- Parses docstrings for descriptions
- Lists available tools per agent
Adding New Agents
To add a new agent to the system (v1.0.0+):
- Create the agent module with
AGENT_CONFIGat module top - Register via entry points in
pyproject.toml:[project.entry-points."lobster.agents"] new_agent = "your_package.agents.new_agent:AGENT_CONFIG" - That's it! The supervisor automatically discovers and includes the new agent
Programmatic Usage
Python API
from lobster.config.supervisor_config import SupervisorConfig
from lobster.agents.supervisor import create_supervisor_prompt
from lobster.core.data_manager_v2 import DataManagerV2
# Create custom configuration
config = SupervisorConfig(
ask_clarification_questions=False,
workflow_guidance_level='minimal',
verbose_delegation=True
)
# Generate prompt
data_manager = DataManagerV2()
prompt = create_supervisor_prompt(
data_manager=data_manager,
config=config,
active_agents=['data_expert_agent', 'transcriptomics_expert']
)Integration with Graph
from lobster.agents.graph import create_bioinformatics_graph
from lobster.config.supervisor_config import SupervisorConfig
# Create custom supervisor configuration
supervisor_config = SupervisorConfig(
ask_clarification_questions=True,
max_clarification_questions=5
)
# Create graph with custom config
graph = create_bioinformatics_graph(
data_manager=data_manager,
supervisor_config=supervisor_config
)Configuration Validation
The system validates configuration values:
workflow_guidance_level: Must be 'minimal', 'standard', or 'detailed'delegation_strategy: Must be 'auto', 'conservative', or 'aggressive'error_handling: Must be 'silent', 'informative', or 'verbose'max_clarification_questions: Clamped between 0 and 10max_tools_per_agent: Clamped between 0 and 20
Invalid values automatically fall back to defaults with a warning.
Monitoring Configuration
Check Current Configuration
from lobster.config.settings import get_settings
settings = get_settings()
config = settings.get_supervisor_config()
print(f"Mode: {config.get_prompt_mode()}")
print(f"Ask questions: {config.ask_clarification_questions}")
print(f"Guidance level: {config.workflow_guidance_level}")View Configuration as Dictionary
config_dict = config.to_dict()
print(config_dict)Performance Considerations
-
Prompt Size: Dynamic generation keeps prompt size manageable
- Production mode: ~8,000 characters
- Standard mode: ~9,500 characters
- Detailed mode: ~11,000 characters
-
Caching: Agent capabilities are cached using LRU cache
- Clear cache:
AgentCapabilityExtractor.clear_cache()
- Clear cache:
-
Startup Time: Minimal impact (<100ms) for prompt generation
Troubleshooting
Agents Not Appearing in Prompt
- Verify entry points are registered in
pyproject.toml - Run
lobster agents listto verify discovery - Check factory function path is correct
- Ensure agent module can be imported
Configuration Not Taking Effect
- Check environment variable names (must start with
SUPERVISOR_) - Verify boolean values are 'true' or 'false' (lowercase)
- Check for typos in variable names
Performance Issues
- Use minimal workflow guidance for production
- Disable agent tool discovery if not needed
- Consider caching prompt for repeated use
Migration from Static Prompt
The system maintains backward compatibility:
- Default configuration matches previous behavior exactly
create_supervisor_prompt(data_manager)works without changes- Existing workflows continue functioning
To leverage new features, simply:
- Set environment variables for desired behavior
- Or pass a
SupervisorConfigobject tocreate_supervisor_prompt()
Future Enhancements
Planned improvements include:
- Per-agent configuration overrides
- Dynamic capability extraction from running agents
- Prompt templates for specific domains
- Configuration profiles (save/load configurations)
- Web UI for configuration management
Agent Coordination Quick Reference
- /Users/tyo/GITHUB/omics-os/lobster/lobster/agents/graph.py - Delegation tool creation - /Users/tyo/GITHUB/omics-os/lobster/lobster/agents/supervisor.py...
Custom Feature Agent - AI-Powered Feature Generation
The Custom Feature Agent is a META-AGENT that leverages the Claude Code SDK to automatically generate production-ready Lobster components through natural...