Skip to content

PromptPack CRD

The PromptPack custom resource defines a versioned collection of prompts for AI agents. The ConfigMap it references must contain a valid PromptPack - a structured JSON/YAML format for packaging multi-prompt conversational systems.

The controller validates the pack.json content against the published PromptPack JSON Schema to ensure conformance before activating the prompts.

apiVersion: omnia.altairalabs.ai/v1alpha1
kind: PromptPack

Source of the compiled PromptPack content.

FieldTypeRequiredDescription
source.typestringYesSource type: configmap
source.configMapRef.namestringYesName of the ConfigMap

The ConfigMap must contain a pack.json key with valid PromptPack JSON content.

spec:
source:
type: configmap
configMapRef:
name: my-prompts # ConfigMap must have pack.json key

Current phase of the PromptPack.

ValueDescription
PendingValidating source
ActivePrompts are valid and in use
SupersededA newer version has replaced this pack
FailedSource validation failed

The currently active prompt version (content hash).

TypeDescription
SourceValidConfigMap exists and contains pack.json key
SchemaValidpack.json content conforms to the PromptPack schema
AgentsNotifiedReferencing agents have been notified

The controller performs two-phase validation:

  1. Source Validation - Verifies the ConfigMap exists and contains the pack.json key
  2. Schema Validation - Validates the JSON content against the published PromptPack schema

If either validation fails, Kubernetes events are emitted with detailed error messages:

Terminal window
# View validation events
kubectl describe promptpack my-prompts
# Events:
# Warning SchemaValidationFailed pack.json validation failed: (root): id is required

The referenced ConfigMap must contain a pack.json key with a compiled PromptPack following the PromptPack specification:

apiVersion: v1
kind: ConfigMap
metadata:
name: my-prompts
data:
pack.json: |
{
"id": "customer-service",
"name": "Customer Service Assistant",
"version": "1.0.0",
"template_engine": {
"version": "v1",
"syntax": "{{variable}}"
},
"prompts": {
"support": {
"id": "support",
"name": "General Support",
"version": "1.0.0",
"system_template": "You are a helpful customer service agent for {{company_name}}. Be professional, empathetic, and solution-oriented.",
"variables": [
{
"name": "company_name",
"type": "string",
"required": true,
"description": "Name of the company"
}
],
"parameters": {
"temperature": 0.7,
"max_tokens": 1024
},
"validators": {
"banned_words": ["competitor", "lawsuit"]
}
}
},
"metadata": {
"domain": "customer-service",
"language": "en",
"tags": ["support", "helpdesk"]
}
}
FieldTypeRequiredDescription
idstringYesUnique identifier (lowercase, hyphens allowed)
namestringYesHuman-readable name
versionstringYesSemantic version (MAJOR.MINOR.PATCH)
template_engineobjectYesTemplate configuration
promptsobjectYesMap of prompt definitions
metadataobjectNoDomain, language, tags
toolsobjectNoTool definitions for function calling
fragmentsobjectNoReusable template fragments

For the complete specification, see promptpack.org.

Complete PromptPack example:

apiVersion: omnia.altairalabs.ai/v1alpha1
kind: PromptPack
metadata:
name: customer-service
namespace: agents
spec:
version: "2.0.0"
source:
type: configmap
configMapRef:
name: cs-prompts-v2

Status after deployment:

status:
phase: Active
activeVersion: "2.0.0"
conditions:
- type: SourceValid
status: "True"
reason: SourceValid
message: "Source configuration is valid"
- type: SchemaValid
status: "True"
reason: SchemaValid
message: "pack.json content is valid"
- type: AgentsNotified
status: "True"
reason: AgentsNotified
message: "Notified 3 AgentRuntime(s)"

PromptPacks can be authored in YAML for readability and compiled to JSON:

id: customer-service
name: Customer Service Assistant
version: 1.0.0
template_engine:
version: v1
syntax: "{{variable}}"
prompts:
support:
id: support
name: General Support
version: 1.0.0
system_template: |
You are a helpful customer service agent for {{company_name}}.
Be professional, empathetic, and solution-oriented.
Guidelines:
- Always greet the customer warmly
- Listen actively and acknowledge concerns
- Provide clear, actionable solutions
variables:
- name: company_name
type: string
required: true
parameters:
temperature: 0.7
max_tokens: 1024
metadata:
domain: customer-service
language: en

Compile with packc:

Terminal window
packc compile --config arena.yaml --output pack.json --id customer-service

Then create a ConfigMap:

Terminal window
kubectl create configmap my-prompts --from-file=pack.json