02: Multi-Prompt Packs
Build a pack containing multiple prompts for a complete application.
Learning Objectives
Section titled “Learning Objectives”In this tutorial, you’ll learn to:
- Create multiple prompt configurations
- Organize prompts by feature
- Compile all prompts into a single pack
- Reference prompts within the pack
Time Required
Section titled “Time Required”20 minutes
Prerequisites
Section titled “Prerequisites”- Completed Tutorial 1: Your First Pack
- packc installed
- Basic understanding of prompt structure
Scenario
Section titled “Scenario”You’re building a customer service application that needs three types of prompts:
- Greeting - Welcome customers
- Support - Answer support questions
- Escalation - Handle complex issues
Step 1: Project Setup
Section titled “Step 1: Project Setup”Create a new project:
mkdir customer-service-packcd customer-service-packmkdir -p prompts config packsStep 2: Create Multiple Prompts
Section titled “Step 2: Create Multiple Prompts”Greeting Prompt
Section titled “Greeting Prompt”cat > prompts/greeting.yaml <<'EOF'apiVersion: promptkit.altairalabs.ai/v1alpha1kind: PromptConfigmetadata: name: Customer Greetingspec: task_type: greeting description: Welcome customers and identify their needs version: v1.0.0
system_template: | You are a friendly customer service representative. Greet the customer warmly and ask how you can help them today. Customer: {{customer_name}} Previous interactions: {{previous_interactions}}
template_engine: version: v1 syntax: "{{variable}}"
variables: - name: customer_name type: string required: true - name: previous_interactions type: string required: false default: "none"EOFSupport Prompt
Section titled “Support Prompt”cat > prompts/support.yaml <<'EOF'apiVersion: promptkit.altairalabs.ai/v1alpha1kind: PromptConfigmetadata: name: Technical Supportspec: task_type: support description: Provide technical support and solutions version: v1.0.0
system_template: | You are a knowledgeable technical support specialist. Help customers solve their technical issues with clear, step-by-step guidance. Always be patient and understanding. Customer: {{customer_name}} Issue: {{issue}} Product: {{product}}
template_engine: version: v1 syntax: "{{variable}}"
variables: - name: customer_name type: string required: true - name: issue type: string required: true - name: product type: string required: true
allowed_tools: - search_knowledge_base - create_ticketEOFEscalation Prompt
Section titled “Escalation Prompt”cat > prompts/escalation.yaml <<'EOF'apiVersion: promptkit.altairalabs.ai/v1alpha1kind: PromptConfigmetadata: name: Escalation Handlerspec: task_type: escalation description: Handle complex issues requiring escalation version: v1.0.0
system_template: | You are a senior support specialist handling escalated issues. Document the issue thoroughly and prepare it for senior management review. Be empathetic and assure the customer their issue has high priority. Customer: {{customer_name}} Account Type: {{account_type}} Issue: {{issue}} Previous attempts: {{previous_attempts}} Urgency: {{urgency}}
template_engine: version: v1 syntax: "{{variable}}"
variables: - name: customer_name type: string required: true - name: account_type type: string required: true - name: issue type: string required: true - name: previous_attempts type: string required: false default: "none" - name: urgency type: string required: true
allowed_tools: - create_escalation_ticket - notify_managerEOFStep 3: Create Arena Configuration
Section titled “Step 3: Create Arena Configuration”Create a configuration that includes all three prompts:
cat > config/arena.yaml <<'EOF'prompts: - ../prompts/greeting.yaml - ../prompts/support.yaml - ../prompts/escalation.yaml
tools_directory: ./toolsEOFStep 4: Compile Multi-Prompt Pack
Section titled “Step 4: Compile Multi-Prompt Pack”Compile all prompts into a single pack:
packc compile \ --config config/arena.yaml \ --output packs/customer-service.pack.json \ --id customer-serviceExpected output:
Loaded 3 prompt configs from memory repositoryCompiling 3 prompts into pack 'customer-service'...✓ Pack compiled successfully: packs/customer-service.pack.json Contains 3 prompts: [greeting, support, escalation]Step 5: Inspect the Pack
Section titled “Step 5: Inspect the Pack”See all prompts in the pack:
packc inspect packs/customer-service.pack.jsonKey sections to notice:
Prompts=======- ID: greeting Name: Customer Greeting ...
- ID: support Name: Technical Support Tools: [search_knowledge_base, create_ticket] ...
- ID: escalation Name: Escalation Handler Tools: [create_escalation_ticket, notify_manager] ...Step 6: Validate the Pack
Section titled “Step 6: Validate the Pack”Ensure all prompts are valid:
packc validate packs/customer-service.pack.jsonUnderstanding Multi-Prompt Packs
Section titled “Understanding Multi-Prompt Packs”Pack Structure
Section titled “Pack Structure”Your pack now contains:
{ "id": "customer-service", "version": "1.0.0", "prompts": { "greeting": { ... }, "support": { ... }, "escalation": { ... } }}Using Multiple Prompts
Section titled “Using Multiple Prompts”In your application, you can select prompts by task type:
// Load packpack, _ := prompt.LoadPack("./packs/customer-service.pack.json")
// Access greeting promptgreetingPrompt := pack.GetPrompt("greeting")
// Access support promptsupportPrompt := pack.GetPrompt("support")
// List all available promptspromptTypes := pack.ListPrompts()Organizing Large Packs
Section titled “Organizing Large Packs”By Feature
Section titled “By Feature”prompts/├── greeting/│ ├── standard.yaml│ └── vip.yaml├── support/│ ├── technical.yaml│ └── billing.yaml└── escalation/ └── priority.yamlBy Environment
Section titled “By Environment”config/├── arena.dev.yaml # Dev prompts├── arena.staging.yaml # Staging prompts└── arena.prod.yaml # Production promptsTry It Yourself
Section titled “Try It Yourself”1. Add a Fourth Prompt
Section titled “1. Add a Fourth Prompt”Create a follow-up prompt:
cat > prompts/followup.yaml <<'EOF'apiVersion: promptkit.altairalabs.ai/v1alpha1kind: PromptConfigmetadata: name: Follow-up Checkspec: task_type: followup description: Check on customer satisfaction after support version: v1.0.0
system_template: | You are conducting a satisfaction check after customer support. Ask if the issue was resolved and if they need any additional help. Customer: {{customer_name}} Resolution: {{resolution}}
template_engine: version: v1 syntax: "{{variable}}"
variables: - name: customer_name type: string required: true - name: resolution type: string required: trueEOFUpdate arena.yaml:
prompts: - ../prompts/greeting.yaml - ../prompts/support.yaml - ../prompts/escalation.yaml - ../prompts/followup.yaml # Add new promptRecompile:
packc compile --config config/arena.yaml --output packs/customer-service.pack.json --id customer-service2. Create Environment-Specific Packs
Section titled “2. Create Environment-Specific Packs”# Development version (shorter responses)cp config/arena.yaml config/arena.dev.yaml
# Production version (add more validation)cp config/arena.yaml config/arena.prod.yaml
# Compile bothpackc compile --config config/arena.dev.yaml --output packs/customer-service-dev.pack.json --id customer-service-devpackc compile --config config/arena.prod.yaml --output packs/customer-service-prod.pack.json --id customer-service-prodBenefits of Multi-Prompt Packs
Section titled “Benefits of Multi-Prompt Packs”1. Single Distribution
Section titled “1. Single Distribution”One pack file contains all related prompts:
# Instead of:app.load("greeting.pack.json")app.load("support.pack.json")app.load("escalation.pack.json")
# You have:app.load("customer-service.pack.json")2. Consistent Versioning
Section titled “2. Consistent Versioning”All prompts share the same version:
packc compile --config arena.yaml --output packs/customer-service-v1.2.0.pack.json --id customer-service3. Simplified Deployment
Section titled “3. Simplified Deployment”Deploy one file instead of many:
# Single deploymentcp packs/customer-service.pack.json /deployment/packs/Best Practices
Section titled “Best Practices”1. Related Prompts Together
Section titled “1. Related Prompts Together”Group prompts by application or feature:
✅ Good: customer-service.pack.json contains all customer service prompts❌ Avoid: all-prompts.pack.json containing unrelated prompts2. Consistent Naming
Section titled “2. Consistent Naming”Use consistent task_type naming:
# Goodtask_type: customer-greetingtask_type: customer-supporttask_type: customer-escalation
# Avoidtask_type: greetingtask_type: support_thingtask_type: esc3. Document Prompt Relationships
Section titled “3. Document Prompt Relationships”# arena.yaml with commentsprompts: - ../prompts/greeting.yaml # Step 1: Initial contact - ../prompts/support.yaml # Step 2: Problem solving - ../prompts/escalation.yaml # Step 3: Complex issues - ../prompts/followup.yaml # Step 4: Satisfaction checkNext Steps
Section titled “Next Steps”Continue learning about pack management:
- Tutorial 3: Validation Workflows - Ensure pack quality
- How-To: Organize Packs - Structure your packs
- Reference: Pack Format - Understanding pack structure
Summary
Section titled “Summary”You’ve learned to:
- ✅ Create multiple related prompts
- ✅ Compile them into a single pack
- ✅ Organize prompts by feature
- ✅ Understand multi-prompt pack structure
- ✅ Use prompts selectively in applications
Multi-prompt packs are ideal for:
- Complete applications
- Feature sets
- Workflow stages
- Related use cases
Great job! 🎉