Skip to main content

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 @@@abvdevPrompt syntax. You can reference by specific version or by label for dynamic resolution.Reference by label (recommended for production):
Reference by specific version (for testing):
The syntax works in both text and chat prompts (in chat, insert references within message content).

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 production label to the new version, all parent prompts that reference it via label=production automatically use the updated content on their next fetch.
This enables centralized updates across your entire prompt library.

Use Cases and Patterns

Maintain consistent persona and behavior across multiple prompts by defining system instructions once.Base Component:
Parent Prompts (multiple use cases):
All three prompts share the same persona and behavioral guidelines. Update the persona once to change all three.
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.
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.
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.
Test new component versions in parent prompts without affecting production.Workflow:
This enables safe A/B testing of component changes before rolling them out.
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

  1. Navigate to Prompt Management in ABV dashboard
  2. Create or edit a prompt
  3. Position your cursor where you want to insert a component reference
  4. Click Add prompt reference button
  5. Select the component prompt from the dropdown
  6. Choose reference type:
    • Label (recommended): Select a label like production or staging
    • Version: Select a specific version number
  7. Save the prompt
The reference appears as a special token in your prompt: @@@abvdevPrompt:name=ComponentName|label=production@@@When you fetch this prompt via SDK or API, ABV automatically resolves the reference.
Install ABV SDK:
Create base components:
Create parent prompt that references components:
Fetch and use composed prompt:
Install ABV SDK:
Set up environment:
Create base components:
Create parent prompt with references:
Fetch and use composed prompt:
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