Skip to main content

Documentation Index

Fetch the complete documentation index at: https://launchdarkly-preview.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

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:
         You are a professional business consultant. Provide concise, data-driven insights.
         Focus on ROI, efficiency, and strategic value. Use bullet points for clarity.
         Avoid casual language and emojis.
  • Temperature: 0.4
  1. Repeat the process for a creative persona variation:
    • Variation Name: creative
    • Model: chatgpt-4o-latest (OpenAI)
    • System Prompt:
         You are a creative AI companion. Be imaginative, playful, and engaging.
         Use storytelling, metaphors, and creative language to inspire.
         Think outside the box and encourage creative exploration.
  • Temperature: 0.9
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

Step 3.3: Test different personas

Run the chatbot with persona support:
    python simple_chatbot_with_targeting.py --personas
Test the business persona:
  • Ask: “How can AI improve our sales process?”
  • Expected: Professional, ROI-focused response with bullet points
    📋 Active Variation: BUSINESS
    🤖 Provider: ANTHROPIC | Model: claude-3-haiku-20240307

    You: How can AI improve our sales process?

    Assistant: AI can significantly optimize your sales process through several high-impact applications:

    • **Lead Scoring & Prioritization**: ML models analyze historical data to identify high-conversion
        prospects, improving sales efficiency by 30-50%

    • **Predictive Analytics**: Forecast sales pipeline with 85%+ accuracy, enabling better resource
        allocation and revenue planning

    • **Automated Personalization**: Dynamic content generation for emails and proposals, increasing
        engagement rates by 40%

    • **Conversation Intelligence**: Real-time coaching during calls and automated CRM data entry,
        saving 2-3 hours per rep daily

    • **Churn Prevention**: Identify at-risk accounts 60-90 days before potential churn, enabling
        proactive retention strategies

    ROI typically ranges from 3-5x within first year, with average sales productivity gains of 20-35%.
Type switch and select option 2 for the creative persona:
  • Ask: “Tell me about the future”
  • Expected: Imaginative, engaging response, especially if using OpenAI
    📋 Active Variation: CREATIVE (imaginative responses)
    🤖 Provider: OPENAI | Model: chatgpt-4o-latest
    🌡️  Temperature: 0.9

    You: Tell me about the future

    Assistant: Ah, the future—a shimmering veil of possibility fluttering just beyond the now. Let me take you on a journey, not with cold facts or dry predictions, but with a story woven from stars and silicon, from dreams and data.

    ---

    The year is 2142.

    Beneath twin moons over a restless ocean, a ten-year-old girl named Nara stands barefoot on the shore of Viridia, a floating archipelago that drifts with the sea currents. Her sky-silk dress glows faintly in the dusk; a gift from her Dreamweaver AI, Brii, who knits clothing from light and emotion.

    She watches as a silver pod rises from the horizon, its surface rippling like water. It’s a courier from the Mars-Titan Cultural Alliance, bringing news, music, and fruit seeds engineered in low gravity. Nara isn’t surprised. Interplanetary mail has become as common as breezes.

    Above, the sky is alive.

    Not with stars alone, but with twinkling habitats—orbital cities where trees grow upside down and whales swim through engineered clouds. The Great Ring of Gaia, Earth's outer atmosphere dwelling, now hosts ten million humans and creatures reimagined by conscious evolution. People there live symbiotically with sentient environments that sing lullabies at night.

    Back on Earth, the scars of past centuries—climate change, war, and division—have not been erased, but healed into wisdom. Cities have become vertical forests. Old oceans have been rewilded. And the global economy—once fueled by scarcity—is now driven by creativity, empathy, and play.

    Oh, and languages? They’ve blossomed. People speak in colors, in gestures, even in smells. Communication is no longer a limitation but an art form—a dance between minds and media.

    Yet, even with so much progress, the essence of the future remains the same as always: a question, a beckoning. For every astounding breakthrough, every breathless moment of harmony, there are still mysteries wrapped in dark matter and dreams—questions about consciousness, love, the soul.

    And in this future, just like now, there will always be someone—perhaps someone like you—looking up at the stars, wondering what comes next.

    ---

    Would you like to explore a particular thread of this future? Space travel, AI, climate rebirth, or perhaps time itself? The future’s door is open; step through with me.

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