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: PromptConfigspec: task_type: greeting name: Customer Greeting description: Welcome customers and identify their needs
system_prompt: | You are a friendly customer service representative. Greet the customer warmly and ask how you can help them today.
user_template: | Customer: Previous interactions:
template_engine: go
parameters: temperature: 0.8 max_tokens: 150EOFSupport Prompt
Section titled “Support Prompt”cat > prompts/support.yaml <<'EOF'apiVersion: promptkit.altairalabs.ai/v1alpha1kind: PromptConfigspec: task_type: support name: Technical Support description: Provide technical support and solutions
system_prompt: | You are a knowledgeable technical support specialist. Help customers solve their technical issues with clear, step-by-step guidance. Always be patient and understanding.
user_template: | Customer: Issue: Product:
template_engine: go
parameters: temperature: 0.7 max_tokens: 500
tools: - name: search_knowledge_base description: Search the knowledge base for solutions - name: create_ticket description: Create a support ticketEOFEscalation Prompt
Section titled “Escalation Prompt”cat > prompts/escalation.yaml <<'EOF'apiVersion: promptkit.altairalabs.ai/v1alpha1kind: PromptConfigspec: task_type: escalation name: Escalation Handler description: Handle complex issues requiring escalation
system_prompt: | 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.
user_template: | Customer: Account Type: Issue: Previous attempts: Urgency:
template_engine: go
parameters: temperature: 0.6 max_tokens: 600
tools: - name: create_escalation_ticket description: Create high-priority escalation ticket - name: notify_manager description: Notify support manager of escalationEOFStep 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, _ := manager.LoadPack("./packs/customer-service.pack.json")
// Use greeting promptconv, _ := manager.NewConversation(ctx, pack, config.ConversationConfig{ TaskType: "greeting",})
// Later, switch to supportsupportConv, _ := manager.NewConversation(ctx, pack, config.ConversationConfig{ TaskType: "support",})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: PromptConfigspec: task_type: followup name: Follow-up Check description: Check on customer satisfaction after support
system_prompt: | You are conducting a satisfaction check after customer support. Ask if the issue was resolved and if they need any additional help.
user_template: | Customer: Resolution:
template_engine: go
parameters: temperature: 0.8 max_tokens: 200EOFUpdate 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! 🎉