aiconfig-segments

Create, update, and query LaunchDarkly segments for AI Config targeting.

Updated Feb 4, 2026
One-click install
npx skills add https://github.com/launchdarkly-labs/aiconfigs-skills --skill aiconfig-segments
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: aiconfig-segments
Source: https://github.com/launchdarkly-labs/aiconfigs-skills/tree/main/aiconfig-segments
Command: npx skills add https://github.com/launchdarkly-labs/aiconfigs-skills --skill aiconfig-segments

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Segmenting contexts for AI Config targeting simplifies reusability and reduces configuration duplication by grouping users, organizations, devices, and other contexts into logical units.

Core Features & Use Cases

  • Segment creation: Define a reusable segment with a unique key, name, and description.
  • Rule-based targeting: Attach one or more rules to a segment to control inclusion criteria using LaunchDarkly operators.
  • Segment management: List, view, update, and delete segments across environments.
  • Apply in AI Configs: Reference segments in aiconfig-targeting to apply consistent targeting across multiple AI Configs.

Quick Start

Create a segment named 'ai-beta-testers' with a description and then add a rule that selects users with beta_opted_in set to true. Then reference the segment in a targeting rule to assign variations.

Frequently Asked Questions about aiconfig-segments

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create segments in LaunchDarkly to target specific user groups?

Segments group contexts like users and organizations by shared attributes. Create a segment with a unique key, name, and description, then attach rules using LaunchDarkly operators to define inclusion criteria—for example, users with beta_opted_in set to true—so you can reuse consistent targeting across AI Configs.

Can I use LaunchDarkly segments to manage targeting rules across multiple environments?

Yes. Segments enable rule-based targeting that works across environments. Define multi-criteria rules once in a segment, then reference that segment in AI Config targeting rules to apply consistent logic without duplicating configuration across environments.

What's required to create and update segments via the LaunchDarkly API?

You need a LaunchDarkly API token with segments:write permission and Python-based operations to construct segment payloads and patch segment rules. This allows you to programmatically create, update, list, view, and delete segments.

How do segments reduce configuration duplication in AI Config targeting?

Segments let you define inclusion criteria once as a reusable logical unit, then reference that segment across multiple AI Configs. This eliminates repeating the same targeting rules and keeps definitions consistent when requirements change.

What operators and criteria can I use when defining segment rules?

Segment rules support LaunchDarkly operators to match context attributes. You can build multi-criteria definitions—such as matching users where beta_opted_in equals true or organization tier matches a specific value—to control which contexts the segment includes.

Can I list and retrieve existing segment details across LaunchDarkly environments?

Yes. The segment management features let you list all segments, view details of specific segments, and query segment information across different environments, making it easy to audit and reference segments in your AI Config rules.