Cadenya
Context-Aware Intelligence

Dynamic Prompt Selection for Personalized Agent Behavior

Static system prompts aren't enough for production agents. Automatically select the right prompt based on customer attributes, context, and natural language conditions—giving VIPs white-glove service while maintaining standard procedures for others.

Join the Waitlist

How Dynamic Prompt Selection Works

1

Agent Initialization

When an agent starts, pass custom attributes like organization ID, customer tier, or use case context

2

Intelligent Matching

Cadenya evaluates your filtering conditions—from simple attribute matching to natural language queries

3

Prompt Selection

The best matching prompt is automatically selected, or falls back to your default if no conditions match

Real-World Applications

VIP Customer Service

Automatically detect high-value customers and switch to a more accommodating prompt with increased refund authority and priority support routing.

customer_tier == "VIP"

→ Uses prompt with higher refund limits and expedited resolution paths

Product vs Technical Support

Use natural language conditions to detect whether users need product information or technical troubleshooting.

"Is the user asking about product features?"

→ Switches to an inquisitive prompt that asks clarifying questions

Regional Compliance

Automatically adjust agent behavior based on customer location to ensure compliance with local regulations.

region == "EU"

→ Uses GDPR-compliant prompt with strict data handling instructions

Time-Based Behavior

Adjust agent responses based on business hours, holidays, or special events for contextual interactions.

is_business_hours == false

→ Uses after-hours prompt with callback scheduling options

Flexible Configuration Options

Define prompts with simple attribute filters or sophisticated natural language conditions.

Attribute-Based Selection

{
  "name": "vip_customer_prompt",
  "agent_type": "customer_service",
  "priority": 100,
  "conditions": {
    "customer_tier": "VIP",
    "lifetime_value": ">10000"
  },
  "system_prompt": "You are a premium support specialist..."
}

Natural Language Conditions

{
  "name": "technical_inquiry_prompt",
  "agent_type": "support",
  "priority": 50,
  "nl_condition": "Is the user asking about API integration or technical implementation?",
  "system_prompt": "You are a technical specialist..."
}

Agent Initialization with Custom Attributes

// Initialize agent with custom attributes
const agent = await cadenya.createAgent({
  agent_type: "customer_service",
  attributes: {
    organization_id: "org_123",
    customer_tier: "VIP",
    lifetime_value: 25000,
    region: "US",
    preferred_language: "en"
  },
  // Optional: Override with specific prompt ID
  prompt_id: "prompt_vip_escalation"
});

Advanced Prompt Management Features

Priority Ranking

Set priority levels for prompts. When multiple conditions match, the highest priority prompt wins.

Agent Type Segmentation

Organize prompts by agent type. Customer service agents only see customer service prompts.

Fallback Guarantees

Always have a default prompt ready. If no conditions match, your agent still initializes properly.

Version Control

Track prompt changes over time. Test new prompts safely before deploying to production.

Direct Override

Know exactly which prompt you need? Override selection with a specific prompt ID at runtime.

Performance Analytics

Track which prompts are selected most often and measure their impact on agent performance.

Move Beyond Static Prompts

Give every customer the right experience with context-aware prompt selection. VIPs get white-glove service, technical users get detailed responses, and everyone gets exactly what they need—automatically.

Join the Waitlist