Overview
This guide outlines extensible patterns for customizing Shannon while maintaining upgrade compatibility and clean separation of concerns.Templates
System 1 - Pre-built workflows with low overhead
Tools
Add capabilities via MCP, OpenAPI, or Python
Vendor Adapters
Domain-specific integrations without core changes
Synthesis Templates
Customize research output formatting
Extension Methods Comparison
Extend Decomposition (System 2)
For custom planning and reasoning logic The orchestrator calls the LLM service endpoint/agent/decompose for planning.
When to Use
- Custom task decomposition strategies
- Domain-specific planning heuristics
- Pre/post-processing of LLM requests
- Integration with external planning systems
Implementation Options
- Lightweight (Go)
- Full Custom (Python)
Best for: Pre/post-processing LLM requestsAdd heuristics to
go/orchestrator/internal/activities/decompose.go:Add/Customize Templates (System 1)
For repeatable workflows with low overheadWhen to Use
- Predefined workflows (data analysis, code review, etc.)
- Quick task execution without AI planning
- Common patterns used frequently
- Performance-critical paths
Creating Templates
1
Create Template File
Place templates in your own directory:
2
Register Template
Initialize registry with your template directory:
3
Use Template
Via gRPC API:Via HTTP Gateway:
4
List Available Templates
Template Best Practices
Use `extends` for Common Defaults
Use `extends` for Common Defaults
Validate with `registry.Finalize()`
Validate with `registry.Finalize()`
Keep Tools Allowlisted
Keep Tools Allowlisted
Add Tools Safely
For extending Shannon’s capabilities Shannon supports three tool integration methods:MCP Tools
External HTTP APIs with zero code changes
OpenAPI Tools
Auto-generated from OpenAPI specs
Built-in Tools
Python tools for complex logic
Security Considerations
Good:Keep Experimental Tools Behind Flags
Complete Tools Guide
See the complete guide for adding MCP, OpenAPI, and built-in Python tools
Vendor Extensions
For domain-specific agents and API integrations The vendor adapter pattern allows you to integrate proprietary APIs and specialized agents without modifying Shannon’s core code.Architecture
When to Use Vendor Extensions
Use when you need:- Domain-specific API integrations (analytics, CRM, e-commerce)
- Custom field name transformations
- Specialized agent roles with domain knowledge
- Session context injection (account IDs, tenant IDs)
- Private/proprietary tool configurations
Quick Start
1
Create Vendor Adapter
2
Register Adapter
3
Create Config Overlay
4
(Optional) Create Specialized Agent
5
Use via Environment
Benefits
- ✅ Zero Shannon core changes - All vendor logic isolated
- ✅ Clean separation - Generic infrastructure vs. vendor-specific
- ✅ Conditional loading - Graceful fallback if vendor module unavailable
- ✅ Easy to maintain - Vendor code in separate directories
- ✅ Testable in isolation - Unit test adapters independently
Complete Vendor Adapters Guide
Comprehensive guide with examples, testing strategies, and best practices
Human Approval
For gating sensitive operations Wirerequire_approval through the SubmitTask request for human-in-the-loop control.
Configuration
API Usage
Approval Flow
- Task submitted with
require_approval: true - Orchestrator pauses before execution
- Approval request sent via webhook/UI
- User approves/rejects via API
- Workflow continues or terminates
Legacy admin endpoint at
http://localhost:8081/approvals/decision is deprecated. Use the gateway endpoint instead.Feature Flags & Config
Runtime configuration without code changes Many behaviors are controlled viaconfig/features.yaml and environment variables, loaded through GetWorkflowConfig.
Common Feature Flags
Environment Variable Override
Dynamic Config Loading
Synthesis Templates (Output Customization)
For customizing how Shannon formats final research answers Synthesis templates control how multi-agent research results are formatted and presented. They’re particularly useful for Deep Research workflows.When to Use
- Customize output format for specific domains (market research, academic, executive summaries)
- Enforce citation styles
- Control answer structure and length
- Inject domain-specific formatting rules
Template Methods
Using Named Templates
Create templates inconfig/templates/synthesis/:
Verbatim Override
For one-time custom formatting without creating a template file:Minimum Length Control
Enforce a minimum output length:Template Selection Logic
Selection is based on context and workflow signals:- If
context.synthesis_templateis set → use that named template. - Else if any of:
context.workflow_type == "research"context.force_research == truecontext.synthesis_style == "comprehensive"context.research_areasis non-empty → useresearch_comprehensive.tmpl.
- Else if
context.synthesis_style == "concise"→ useresearch_concise.tmpl. - Otherwise → use
normal_default.tmpl.
Available Templates
Best Practices
- Always extend
_base.tmpl- Ensures citation contract is maintained - Use named templates for recurring formats
- Use override for one-off customizations
- Test templates with sample queries before production use
Template Directory
Templates are located in
config/templates/synthesis/. See README.md in that directory for template authoring guidelines.Best Practices Summary
Separation of Concerns
Separation of Concerns
- Generic infrastructure: Committed to open source
- Vendor-specific code: Kept private in separate directories
- Configuration overlays: Domain-specific settings isolated
- Conditional imports: Graceful fallback for optional modules
Upgrade Compatibility
Upgrade Compatibility
- Use stable interfaces (ToolRegistry, TemplateRegistry, etc.)
- Avoid forking core subsystems
- Keep customizations in separate directories
- Use feature flags for experimental changes
Security First
Security First
- Allowlist tools in templates
- Enable approvals for dangerous operations
- Use domain allowlisting for external APIs
- Keep secrets in environment variables
Testing
Testing
- Unit test vendor adapters in isolation
- Integration test with Shannon services
- Use replay testing for workflow determinism
- Validate templates with
registry.Finalize()
Extension Decision Tree
Next Steps
Custom Tools
Add MCP, OpenAPI, and built-in tools
Vendor Adapters
Build domain-specific integrations
Configuration
Complete configuration reference
Architecture
Understanding Shannon’s architecture