Overview
Shannon uses feature flags to control optional features, experimental functionality, and enterprise extensions without modifying code. This allows clean separation between:- Open-source core features (available to all)
- Enterprise/private features (gated behind flags)
- Experimental features (toggleable for testing)
Zero Recompilation
Enable/disable features without rebuilding services
Environment-Based
Different flags for dev/staging/production
Clean Separation
Enterprise features isolated from OSS core
Gradual Rollout
Test new features before full deployment
Configuration
Configuration File
Feature flags are defined inconfig/shannon.yaml under the features section:
Environment Variables
Feature flags can be overridden via environment variables:SHANNON_FEATURE_<FLAG_NAME_UPPERCASE>
Priority Order
- Environment variables (highest priority)
- Config overlays (
config/overlays/shannon.{env}.yaml) - Base config (
config/shannon.yaml) - Code defaults (lowest priority)
Usage Patterns
In Go Code (Orchestrator)
In Python Code (LLM Service)
Conditional Imports Pattern
Use feature flags with conditional imports for clean separation:Common Feature Flags
| Flag Name | Type | Description | Default |
|---|---|---|---|
ads_research | Enterprise | Ads research workflow with market analysis | false |
parallel_streaming | Experimental | Multi-agent parallel SSE streaming | true |
advanced_synthesis | Enterprise | Custom synthesis templates | false |
vendor_tools_enabled | Integration | Enable vendor-specific tool adapters | false |
enhanced_memory | Experimental | Advanced vector memory with hybrid search | false |
Best Practices
1. Default to Disabled
New features should default tofalse in base config:
2. Use Environment Overlays
Create environment-specific overlays for different deployments:3. Guard with Try/Except
Always use graceful fallback for enterprise/optional features:4. Document Feature Requirements
Enterprise Feature Pattern
Shannon separates OSS core from enterprise extensions using feature flags:File Structure
Conditional Workflow Routing
Testing with Feature Flags
Unit Tests
Integration Tests
Deployment Strategies
Canary Deployment
Enable features for subset of users:A/B Testing
Route traffic based on feature flags:Monitoring & Observability
Log feature flag usage for debugging:Migration Guide
Adding a New Feature Flag
1
Define Flag in Config
Add to
config/shannon.yaml:2
Update Go Struct
Add field to
go/orchestrator/internal/config/shannon.go:3
Use in Code
Gate functionality:
4
Add Tests
Test both enabled/disabled states:
5
Document
Update this page and environment variables documentation.