Prompt Management

Complete guide to creating, versioning, and deploying AI prompts in PromptCompose

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:

  1. Metadata: Name, description, tags, and project association
  2. Content: The actual prompt text with variable placeholders
  3. Variables: Defined inputs that get interpolated into the content
  4. Versions: Historical snapshots with deployment information
  5. Settings: Permissions, sharing, and integration options

Creating Prompts

Basic Prompt Creation

  1. Navigate to Prompts

    • Click “Prompts” in the sidebar
    • Click “Create Prompt” button
  2. Basic Information

    • Name: Descriptive name (e.g., “Customer Support - Order Issues”)
    • Description: Brief explanation of the prompt’s purpose
    • Tags: Categorization labels for organization
  3. 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:

  1. From Template Library

    • Browse available templates
    • Click “Create Prompt” on desired template
    • Content and variables are pre-populated
  2. 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:

  1. Variable Name: Use descriptive, lowercase names with underscores
  2. Type: Select appropriate variable type
  3. Label: User-friendly display name
  4. Description: Explain the variable’s purpose
  5. Required: Mark if the variable must be provided
  6. Default Value: Optional fallback value
  7. Validation: Add rules for acceptable values

Variable Groups Integration

Link to existing variable groups:

  1. Select Variable Group: Choose from project groups
  2. Import Variables: Add group variables to prompt
  3. Override Settings: Customize imported variables
  4. 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:

  1. Review Changes: Compare with previous version
  2. Deployment Message: Document what changed
  3. Tags: Add version-specific labels
  4. 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:

  1. Select Version: Choose from version history
  2. Review Changes: See what will be restored
  3. Confirm Rollback: Create new version with old content
  4. 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:

  1. Pre-deployment Check

    • Variable validation
    • Syntax verification
    • Integration testing
  2. Deployment Configuration

    • Environment selection (development, staging, production)
    • Deployment message
    • Notification settings
  3. 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:

  1. Test Setup: Create test from prompt page
  2. Variants: Define different versions to test
  3. Strategy: Choose rollout approach
  4. 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

  1. Use Specific Versions: Pin to version IDs for stability
  2. Handle Variables: Validate required variables before calling
  3. Error Handling: Gracefully handle API failures
  4. Caching: Cache responses for better performance
  5. Monitoring: Track API usage and errors

Best Practices

Content Creation

  1. Clear Purpose: Each prompt should have a specific goal
  2. Variable Naming: Use descriptive, consistent names
  3. Documentation: Include helpful descriptions and examples
  4. Testing: Validate prompts before deployment

Version Management

  1. Meaningful Messages: Write clear deployment messages
  2. Regular Backups: Keep important versions safe
  3. Testing: Test versions thoroughly before deployment
  4. Rollback Plan: Know how to revert problematic changes

Team Collaboration

  1. Communication: Discuss changes with team members
  2. Review Process: Have others review important prompts
  3. Conventions: Establish team standards for naming and structure
  4. Documentation: Maintain prompt documentation

Performance Optimization

  1. Variable Efficiency: Minimize variable processing overhead
  2. Content Length: Balance detail with performance
  3. Caching: Use appropriate caching strategies
  4. 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:

  1. Check variable definitions and requirements
  2. Review deployment logs for error details
  3. Test with simplified content to isolate problems
  4. Consult Troubleshooting Guide
  5. Contact support for persistent issues

Next Steps

Now that you understand prompt 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.