Skip to main content

Part 3: Advanced configuration and persona-based targeting

Now, you can explore advanced targeting capabilities by creating persona-based variations. This demonstrates how to deliver different AI experiences to different user segments. To learn more about targeting capabilities, read Target with AI Configs.

Step 3.1: Create persona-based variations

Create three persona variations in LaunchDarkly:
  1. Navigate to your simple-config AI Config.
  2. Click the Variations tab.
  3. Click Add Variation and add a business persona:
    • Variation Name: business
    • Model: claude-3-haiku-20240307
    • System Prompt:
  • Temperature: 0.4
  1. Repeat the process for a creative persona variation:
    • Variation Name: creative
    • Model: chatgpt-4o-latest (OpenAI)
    • System Prompt:
  • Temperature: 0.9
Creating persona-based variations in LaunchDarkly

Creating persona-based variations in LaunchDarkly

Step 3.2: Configure persona-based targeting

Now, configure persona-based targeting:
  1. Navigate to the Targeting tab for your simple-config.
  2. Click Edit.
  3. Click + Add Rule.
  4. Select Build a custom rule.
  5. Add a Rule Name of Persona-based targeting.
  6. Configure the rule:
    • Context Kind: User
    • Attribute: persona
    • Operator: is one of
    • Values: business
    • Serve: business variation
  7. Repeat for the creative persona:
    • If persona is one of creative, serve creative.
  8. Set the Default rule to serve friendly.
  9. Click Review and save.
  10. Add a comment and confirm.
Setting up persona-based targeting rules

Setting up persona-based targeting rules

Step 3.3: Test different personas

Run the chatbot with persona support:
Test the business persona:
  • Ask: “How can AI improve our sales process?”
  • Expected: Professional, ROI-focused response with bullet points
Type switch and select option 2 for the creative persona:
  • Ask: “Tell me about the future”
  • Expected: Imaginative, engaging response, especially if using OpenAI
In this section, you learned:
  • How to add persona-based contexts to your existing code
  • How to target AI variations based on simple user attributes
  • How LaunchDarkly enables dynamic behavior without code changes