System Prompt Management
Cipher provides a sophisticated system prompt management feature that allows you to dynamically compose system prompts from multiple sources using configurable providers. This modular approach enables flexible, maintainable, and context-aware prompt generation.How It Works
The system prompt management feature uses a plugin-based architecture with three types of providers:- Static Providers: Deliver fixed content that doesn’t change
- Dynamic Providers: Generate content at runtime based on context
- File-based Providers: Load content from external files with optional summarization
Benefits
- Modularity: Break complex prompts into manageable, reusable components
- Flexibility: Mix static instructions with dynamic, context-aware content
- Scalability: Add or remove providers without affecting existing functionality
Provider Architecture
The architecture ensures high performance through caching, lazy loading, and efficient content generation while maintaining flexibility for complex prompt composition scenarios.Provider Types
Static Provider
Static providers deliver fixed content that remains constant across all interactions. Perfect for core instructions, disclaimers, or fundamental behavioral guidelines. Configuration:built-in-memory-search
: Instructions for using memory retrieval toolsbuilt-in-reasoning-patterns
: Guidelines for applying problem-solving strategiesbuilt-in-knowledge-graph
: Instructions for managing entities and conceptsbuilt-in-efficiency-guidelines
: Performance and efficiency best practicesbuilt-in-automatic-tools
: Information about background automated processes
Dynamic Provider
Dynamic providers generate content at runtime using registered generator functions. They can access conversation context, user data, and system state to produce relevant, personalized content. Configuration:summary
: Generates conversation summaries from message historyrules
: Extracts and applies relevant rules from past interactionserror-detection
: Identifies patterns and common errors from conversation history
File-based Provider
File-based providers load content from external files, with support for template variables, file watching, and optional LLM-powered summarization for large documents. Configuration:filePath
: Path to the source file (relative or absolute)summarize
: Whether to use LLM to summarize large files (true/false)watchForChanges
: Monitor file for updates and reload automaticallyvariables
: Template variables for dynamic content replacement
- Project-specific guidelines and standards
- External documentation integration
- Large instruction sets with summarization
- Version-controlled prompt content
Configuration File Format
Cipher uses YAML configuration files to define system prompt providers. Here’s the complete structure fromcipher-advanced-prompt.yml
:
Settings Explained
maxGenerationTime
: Maximum time in milliseconds for prompt generationfailOnProviderError
: Whether to fail completely if any provider errorscontentSeparator
: String used to separate content from different providers
Command Reference
List Active Providers
Example Output
Example Output
Show All Providers
Example Output
Example Output
Add Dynamic Provider
Example Output
Example Output
Add File-based Provider
Example Output
Example Output
Remove Provider
Example Output
Example Output
Update Provider Configuration
Example Output
Example Output
Enable/Disable Providers
Example Output (Enable)
Example Output (Enable)
Example Output (Disable)
Example Output (Disable)
View Current System Prompt
Example Output
Example Output
View Prompt Statistics
Example Output
Example Output