How Prompt Composability Works
Create base prompt components
Create prompts that serve as reusable components. These are regular ABV prompts containing shared content like system instructions, examples, or guidelines.These components can be versioned, labeled, and managed like any other prompt.
Reference components in parent prompts
In parent prompts, reference base components using the special Reference by specific version (for testing):The syntax works in both text and chat prompts (in chat, insert references within message content).
@@@abvdevPrompt syntax. You can reference by specific version or by label for dynamic resolution.Reference by label (recommended for production):ABV resolves references at fetch time
When you fetch a prompt via SDK or API, ABV automatically resolves all prompt references, replacing them with the actual content from the referenced prompts.Resolution happens transparently—you work with the composed prompt as if it were a single, flat prompt.
Update base prompts to propagate changes
When you update a base prompt component and assign the This enables centralized updates across your entire prompt library.
production label to the new version, all parent prompts that reference it via label=production automatically use the updated content on their next fetch.Use Cases and Patterns
Shared System Instructions
Shared System Instructions
Common Few-Shot Examples
Common Few-Shot Examples
Share few-shot examples across related prompts to maintain consistent performance patterns.Base Component (examples):Parent Prompts (different domains, same task):Both prompts use the same examples. Refine examples once, improve both prompts.
Company-Wide Guidelines and Policies
Company-Wide Guidelines and Policies
Enforce organizational policies (safety, compliance, brand voice) consistently across all LLM applications.Base Components:Every Prompt in Your Organization:When your legal team updates the data privacy policy, one change in ABV updates every LLM application company-wide.
Multi-Language Prompt Components
Multi-Language Prompt Components
Build language-specific components and compose them dynamically based on user locale.Base Components (per language):Runtime Language Selection:Alternatively, maintain separate parent prompts per language, each referencing the appropriate language component.
Version-Specific Testing
Version-Specific Testing
Test new component versions in parent prompts without affecting production.Workflow:This enables safe A/B testing of component changes before rolling them out.
Nested Composition (Components Referencing Components)
Nested Composition (Components Referencing Components)
Create hierarchies of reusable components where components themselves reference other components.Multi-Level Component Structure:ABV recursively resolves all nested references, giving you the fully composed prompt.
Implementation Examples
Create Composed Prompt via UI
Create Composed Prompt via UI
- Navigate to Prompt Management in ABV dashboard
- Create or edit a prompt
- Position your cursor where you want to insert a component reference
- Click Add prompt reference button
- Select the component prompt from the dropdown
- Choose reference type:
- Label (recommended): Select a label like
productionorstaging - Version: Select a specific version number
- Label (recommended): Select a label like
- Save the prompt
@@@abvdevPrompt:name=ComponentName|label=production@@@When you fetch this prompt via SDK or API, ABV automatically resolves the reference.Create Composed Prompt via Python SDK
Create Composed Prompt via Python SDK
Install ABV SDK:Create base components:Create parent prompt that references components:Fetch and use composed prompt:
Create Composed Prompt via JavaScript/TypeScript SDK
Create Composed Prompt via JavaScript/TypeScript SDK
Install ABV SDK:Set up environment:Create base components:Create parent prompt with references:Fetch and use composed prompt:
Reference by Version (Testing)
Reference by Version (Testing)
When testing a new version of a component, reference it by specific version number instead of label.Python Example:Once testing is successful, update the parent prompt to use
label=production and reassign the production label from v1 to v2.Next Steps
Get Started with Prompt Management
Complete quickstart guide for creating, versioning, and deploying prompts
Version Control
Deploy and rollback prompts safely using labels and versions
Message Placeholders
Dynamically inject message arrays into chat prompts at runtime
Folders
Organize prompts into hierarchical folders for better management