Prompt Management
PromptCompose provides sophisticated prompt management capabilities with version control, deployment tracking, variable interpolation, and seamless integration with A/B testing. This guide covers everything you need to know about working with prompts.
Understanding Prompts
What is a Prompt?
A prompt in PromptCompose is:
- Versioned: Multiple versions with deployment tracking
- Variable-enabled: Dynamic content with variable interpolation
- Template-based: Can be created from reusable templates
- Test-ready: Integrated with A/B testing capabilities
- API-accessible: Available through SDK and REST API
Prompt Components
Each prompt consists of:
- Metadata: Name, description, tags, and project association
- Content: The actual prompt text with variable placeholders
- Variables: Defined inputs that get interpolated into the content
- Versions: Historical snapshots with deployment information
- Settings: Permissions, sharing, and integration options
Creating Prompts
Basic Prompt Creation
-
Navigate to Prompts
- Click “Prompts” in the sidebar
- Click “Create Prompt” button
-
Basic Information
- Name: Descriptive name (e.g., “Customer Support - Order Issues”)
- Description: Brief explanation of the prompt’s purpose
- Tags: Categorization labels for organization
-
Content Creation
- Use the Monaco Editor for syntax highlighting
- Write your prompt with variable placeholders
- Preview rendered output in real-time
Advanced Prompt Creation
Using Templates
Create prompts from existing templates:
-
From Template Library
- Browse available templates
- Click “Create Prompt” on desired template
- Content and variables are pre-populated
-
Customize Template Content
- Modify the template content as needed
- Add or remove variables
- Update metadata and tags
Variable Integration
Add dynamic content with variables:
Hello {user_name},
Thank you for contacting {company_name} support regarding your {issue_type}.
Our team will help you resolve this {priority_level} issue within {response_time}.
Best regards,
{agent_name}
Working with Variables
Variable Types
PromptCompose supports several variable types:
Text Variables
{user_name} - Simple text replacement
{description} - Multi-line text content
Select Variables
{priority_level} - Options: ["High", "Medium", "Low"]
{language} - Options: ["English", "Spanish", "French"]
Number Variables
{quantity} - Numeric values
{price} - Currency amounts
Boolean Variables
{is_premium_user} - True/false values
{email_notifications} - On/off settings
Variable Definition
Define variables for your prompt:
- Variable Name: Use descriptive, lowercase names with underscores
- Type: Select appropriate variable type
- Label: User-friendly display name
- Description: Explain the variable’s purpose
- Required: Mark if the variable must be provided
- Default Value: Optional fallback value
- Validation: Add rules for acceptable values
Variable Groups Integration
Link to existing variable groups:
- Select Variable Group: Choose from project groups
- Import Variables: Add group variables to prompt
- Override Settings: Customize imported variables
- Maintain Sync: Keep in sync with group updates
Monaco Editor Features
Syntax Highlighting
The Monaco Editor provides:
- Variable Highlighting:
{variable_name}
syntax coloring - Error Detection: Invalid variable names underlined
- Auto-completion: Suggests available variables
- Bracket Matching: Paired curly brace highlighting
Editor Commands
Useful keyboard shortcuts:
- Ctrl+Space: Trigger variable auto-completion
- Ctrl+F: Find and replace
- Ctrl+/: Toggle line comments
- Alt+Up/Down: Move lines
- Ctrl+Z: Undo changes
- Ctrl+Y: Redo changes
Real-time Preview
The preview pane shows:
- Rendered Content: How the prompt appears with variables
- Variable Substitution: Test different variable values
- Validation Errors: Missing or invalid variables
- Character Count: Track prompt length
Version Management
Creating Versions
Every prompt deployment creates a new version:
- Review Changes: Compare with previous version
- Deployment Message: Document what changed
- Tags: Add version-specific labels
- Deploy: Create and activate new version
Version History
Track all prompt versions:
- Version List: Chronological list of all versions
- Diff Viewer: Side-by-side comparison between versions
- Metadata: Deployment messages, timestamps, and authors
- Rollback: Revert to previous versions when needed
Version Operations
Rolling Back
Restore a previous version:
- Select Version: Choose from version history
- Review Changes: See what will be restored
- Confirm Rollback: Create new version with old content
- Update Message: Document the rollback reason
Version Comparison
Compare any two versions:
- Side-by-side View: Content differences highlighted
- Variable Changes: Added, removed, or modified variables
- Metadata Diff: Changes in settings and configuration
- Export Diff: Save comparison as documentation
Deployment and Publishing
Deployment Process
Deploy prompt versions to make them available:
-
Pre-deployment Check
- Variable validation
- Syntax verification
- Integration testing
-
Deployment Configuration
- Environment selection (development, staging, production)
- Deployment message
- Notification settings
-
Post-deployment
- Version activation
- API availability
- Integration updates
Deployment Strategies
Immediate Deployment
- Changes go live immediately
- Best for urgent fixes
- Use with caution in production
Scheduled Deployment
- Deploy at specific times
- Coordinate with team schedules
- Reduce user impact
Staged Rollout
- Deploy to subsets of users
- Monitor performance before full rollout
- Integrate with A/B testing
Integration with A/B Testing
Creating Tests from Prompts
Turn prompts into A/B tests:
- Test Setup: Create test from prompt page
- Variants: Define different versions to test
- Strategy: Choose rollout approach
- Metrics: Define success criteria
Test-Enabled Prompts
Prompts with active A/B tests:
- Show test status in prompt list
- Display variant performance data
- Provide quick test management
- Integrate conversion tracking
Performance Monitoring
Track how prompts perform in tests:
- Conversion Rates: Success metrics by variant
- Statistical Significance: Confidence in results
- User Engagement: Interaction patterns
- Business Impact: Revenue or goal achievement
Collaboration Features
Multi-user Editing
Collaborative prompt development:
- Edit Locks: Prevent conflicting changes
- Change History: Track who modified what
- Comments: Discuss changes with team
- Merge Conflicts: Resolve overlapping edits
Sharing and Permissions
Control prompt access:
Permission Levels
- Owner: Full control including deletion
- Editor: Modify content and deploy versions
- Viewer: Read-only access to prompts
- Tester: Can create A/B tests but not edit content
Sharing Options
- Project-wide: Available to all project members
- Team-only: Restricted to specific team members
- Private: Only accessible by owner
- Public Template: Available as template for others
Organization and Discovery
Prompt Organization
Keep prompts organized:
Naming Conventions
- Use descriptive, consistent names
- Include purpose and context
- Example: “Email - Welcome - New Users”
Tagging System
- Purpose: “customer-support”, “onboarding”, “sales”
- Priority: “critical”, “standard”, “experimental”
- Status: “production”, “testing”, “deprecated”
Folder Structure
- Group related prompts
- Mirror your application structure
- Use consistent hierarchy
Search and Filtering
Find prompts quickly:
Search Features
- Full-text Search: Search content and metadata
- Variable Search: Find prompts using specific variables
- Tag Filtering: Filter by assigned tags
- Status Filtering: Active, testing, deprecated
Advanced Filters
- Creation Date: Recently created or modified
- Owner: Prompts by specific team members
- Template: Prompts created from templates
- Test Status: Prompts with active A/B tests
API and SDK Integration
API Access
Prompts are accessible via:
- REST API: Direct HTTP access
- SDK Methods:
resolvePrompt()
and related functions - Webhook Integration: Real-time updates
- GraphQL: Flexible querying (if available)
SDK Integration
Connect prompts to your applications:
// Basic prompt resolution
const result = await promptCompose.resolvePrompt('prompt-id', {
config: { versionId: 'v1.2' }
}, {
user_name: 'John',
company_name: 'Acme Corp'
});
console.log(result.content); // Rendered prompt
Integration Best Practices
- Use Specific Versions: Pin to version IDs for stability
- Handle Variables: Validate required variables before calling
- Error Handling: Gracefully handle API failures
- Caching: Cache responses for better performance
- Monitoring: Track API usage and errors
Best Practices
Content Creation
- Clear Purpose: Each prompt should have a specific goal
- Variable Naming: Use descriptive, consistent names
- Documentation: Include helpful descriptions and examples
- Testing: Validate prompts before deployment
Version Management
- Meaningful Messages: Write clear deployment messages
- Regular Backups: Keep important versions safe
- Testing: Test versions thoroughly before deployment
- Rollback Plan: Know how to revert problematic changes
Team Collaboration
- Communication: Discuss changes with team members
- Review Process: Have others review important prompts
- Conventions: Establish team standards for naming and structure
- Documentation: Maintain prompt documentation
Performance Optimization
- Variable Efficiency: Minimize variable processing overhead
- Content Length: Balance detail with performance
- Caching: Use appropriate caching strategies
- Monitoring: Track prompt performance metrics
Troubleshooting
Common Issues
Variable Resolution Problems
- Missing Variables: Ensure all required variables are provided
- Type Mismatches: Check variable types match expectations
- Invalid Names: Use valid variable name formats
Deployment Issues
- Version Conflicts: Resolve editing conflicts before deployment
- API Errors: Check API connectivity and permissions
- Rollback Problems: Verify target version exists and is valid
Getting Help
For prompt-related issues:
- Check variable definitions and requirements
- Review deployment logs for error details
- Test with simplified content to isolate problems
- Consult Troubleshooting Guide
- Contact support for persistent issues
Next Steps
Now that you understand prompt management:
- Create Templates: Template System Guide
- Organize Variables: Variable Groups Guide
- Set Up A/B Tests: A/B Testing Guide
- Integrate with Code: SDK Documentation
- Team Setup: User Management
Effective prompt management is the foundation of successful AI integration - use these tools to build, version, and deploy prompts that deliver real business value.