Agents

Overview

This topic explains how to create and use agent-based configs to support structured, multi-step AI workflows with shared configuration, judge models that evaluate response quality, and performance monitoring.

Agent-based configs define workflow behavior through a single instructions field that describes how the model should operate across multiple coordinated steps. This structure is useful for tasks that require multi-step execution. The instructions define the goal of the task and how the model should proceed.

You can combine multiple agent-based configs into workflows where each agent performs a specific role. For example, one agent may analyze a request, another may validate input, and another may retrieve information. Your application coordinates these interactions while LaunchDarkly manages configuration for each agent.

Agent-based configs use a configuration model similar to other configs, including variations, targeting, approvals, and monitoring. However, LaunchDarkly evaluates agent-based configs differently to provide instructions, model details, provider information, attached tools, and a tracker instance for recording metrics.

Agent mode is optimized for structured, multi-step workflows. Completion mode and agent mode differ in how behavior is defined, but both can integrate with external tools depending on your SDK and model provider implementation.

As a result, using agent-based configs helps you manage workflow behavior safely and update logic without redeploying code. It also lets you observe performance across environments.

You can attach judges to completion-mode config variations in the LaunchDarkly UI. For agent-based variations, invoke a judge programmatically using the AI SDK. To learn more, read Online evaluations.

Capabilities and use cases

Agent-based configs support structured workflows that involve multiple coordinated steps. Teams use them to define structured behavior and manage complex workflows through configuration rather than application code.

Tools are reusable, versioned resources defined at the project level and can be attached to config variations as needed.

You can use agent-based configs to:

  • Guide models through multi-step tasks using structured instructions.
  • Coordinate multi-step workflows that may interact with external systems.
  • Reuse shared tools across multiple agents and variations.
  • Monitor workflow performance and compare variations.
  • Update workflow behavior safely using targeting rules, approvals, and guarded rollouts.

Create and configure an agent

To create an agent-based config:

  1. In the left navigation, select AgentControl, then click Create AgentControl config.
  2. In the “Create AgentControl config” dialog, click Agent-based.
  3. Enter a name for the config.
  4. (Optional) Click Edit key to update the config key. You use the key to reference the config in your code.
  5. (Optional) Select a maintainer.
  6. Click Create. LaunchDarkly creates the config and displays the configuration panel.

The "Create AgentControl config" dialog.

The "Create AgentControl config" dialog.

Each agent variation includes a description and an instructions field. The instructions define the goal and outline the reasoning steps the model should follow across multiple coordinated steps.

You can optionally attach tools, skills, and judges to a variation.

Tools

Tools provide structured capabilities, such as retrieving data or calling an external service. Tools are reusable resources defined at the project level and can be attached to both agent-based and completion-based variations. To learn more, read Tools.

To attach tools to a variation, open the variation, click Attach tools, then choose from the tools in your library.

Skills

Skills let you attach short sets of instructions, scripts, and resources to an agent config. They extend agent capabilities with specialized knowledge and workflows.

To attach skills to a variation, open the variation, click Attach skills, then choose from the skills in your library.

Judges

Judges are specialized AgentControl configs that evaluate responses and return numeric scores that represent quality signals related to accuracy, relevance, toxicity, or custom signals you define. To learn more, read Judges.

To attach judges to a variation, open the variation, click Attach judges, then choose from the judges in your library.

Retrieve and use agent-based configs in your application

Use the LaunchDarkly Node.js (server-side) AI SDK or Python AI SDK to retrieve agent-based configs for a context.

Agent-based configs are retrieved using the agent-specific SDK methods, such as .agentConfig() or .agentConfigs(). These methods return the evaluated agent, including its instructions, model configuration, provider information, attached tools, and a tracker instance for recording metrics.

This allows you to compose multi-agent workflows where each agent has a distinct role and can be evaluated independently.

These examples assume that you have already initialized the AI client and created a context. To learn how to do this, read Quickstart for AgentControl.

1// Retrieve multiple agents
2const agents = await aiClient.agentConfigs([
3 {
4 key: "my-agent-key",
5 defaultValue: { enabled: true },
6 variables: { parameters }
7 },
8 {
9 key: "backup-agent",
10 defaultValue: { enabled: true },
11 variables: { parameters }
12 }
13], context);
14
15const supervisor = agents["supervisor-agent"];

An evaluated agent includes model details, provider information, instructions, any attached tools, and a tracker instance for recording metrics.

Evaluating an agent returns an object similar to the following. The exact fields included depend on the agent configuration and SDK version.

Example evaluated agent (Node.js)
1{
2 enabled: true,
3 instructions: "Analyze the input and determine the appropriate next step.",
4 model: {
5 name: "gpt-4o-mini",
6 parameters: {
7 temperature: 0.2
8 }
9 },
10 provider: {
11 name: "openai"
12 },
13 tools: [
14 {
15 key: "search-docs",
16 }
17 ],
18 tracker: "[Tracker instance]"
19}

Agent configuration structure

Agent-based configs share the same overall configuration model as completion-mode AgentControl, but have a different variation structure. Each config includes a mode property that is set at creation time and determines which fields are required and how targeting, evaluation, and metrics are handled.

In agent-based configs, each variation requires a description and an instructions field. These fields define how the model should behave when evaluated. Agent-based variations do not use message roles or message history. Workflow behavior is defined through the instructions field and any configuration associated with the variation.

Because agent-based configs use an instructions-based structure rather than message-based prompts, the Monitoring tab may display metrics differently for agent-based workflows.

Monitor agent performance

The Monitoring tab displays metrics for each variation of an agent-based config. Metrics include:

  • Generations
  • Time to generate
  • Time to first token
  • Token usage
  • Costs
  • Error rate
  • Satisfaction, when instrumented

Monitoring helps you assess how structured workflows behave in production and identify where a variation may need adjustment.

Online evaluations are not supported for agent-based configs. You cannot attach judges to agent-based config variations.

To learn more, read Monitor config performance.

Target and release agent-based variations

Use targeting rules to determine which users receive each variation of an agent-based config. You can release updated workflows gradually, apply segmentation rules, or test alternative workflow strategies.

Guarded rollouts let you introduce workflow changes safely while monitoring for regressions. Approvals ensure that changes receive review before becoming active.

To learn more, read Config targeting.

Compatibility

Agent-based configs are supported in the Node.js (server-side) AI SDK and Python AI SDK.

You can create AgentControl configs in either completion mode or agent mode. You cannot change the mode after creation.