[Hands-on workshop] Managing AI Agents in Production - Sep 17Save my seat

Skip to:
BlogRight arrowAI
Right arrowIntroducing the LaunchDarkly AI SDK

Sep 3, 2026

Introducing the LaunchDarkly AI SDK

The LaunchDarkly AI SDK is available for Python and JavaScript and is the path we recommend for every new AgentControl integration.

Kelvin Yap
Senior Product Marketing Manager

The LaunchDarkly AI SDK is available for Python and JavaScript and is the path we recommend for every new AgentControl integration. It works with supported providers and frameworks teams already run, scores quality without slowing down responses, and executes multi-step agents from a single call. Setup drops from as many as five packages and hand-built telemetry to one install command, with metrics recorded automatically and traces one package away. The existing AI SDKs remain fully supported.

The LaunchDarkly AI SDK is available for Python and JavaScript, and it's now the recommended way to connect an application to AgentControl, the LaunchDarkly control plane for agents in production. You run one install command, point it at a config, and call invoke(). The SDK handles the client lifecycle, routes to the provider your config specifies, can record supported metrics on calls, and sends traces to LaunchDarkly Observability without any instrumentation code.

It also adds capabilities that didn't exist in prior AI SDKs, including native agent graph execution, judges on individual graph nodes, and evaluation that runs off the request path.

What this makes possible:

  • Call any supported provider without writing provider glue, retry logic, or a tool loop.
  • Move a workload between OpenAI, Anthropic, or any provider whose handler you have installed, at runtime, with no deploy.
  • Run real agents, up to multi-step graphs with each step routed independently, from a single call, with Claude's built-in tools mapped to your LaunchDarkly tool definitions.
  • Score quality with judges, including deferring the scoring off the request path.
  • Metrics and traces, with nothing extra to write.

Existing AgentControl configs, targeting rules, and metrics continue to work as they do today.

Works with the stack you already run

The SDK ships first-party handlers for OpenAI, Anthropic, and LangChain, covering both single completions and agent workloads. That includes native support for the Claude Agent SDK, with Claude's built-in tools like web search and bash mapped to your LaunchDarkly tool definitions. Providers LaunchDarkly doesn't ship a handler for can be registered as custom handlers and routed the same way.

Routing happens at call time, so a config can move a workload between OpenAI, Anthropic, or any custom provider without a deploy, as long as the handler for each is installed.

The same principle extends to orchestration. Teams already running LangGraph, OpenAI Agents, or the Claude Agent SDK can take an agent workflow defined in LaunchDarkly and run it on the framework they already use, so adopting AgentControl doesn't mean adopting a new execution stack. The handler tables in the Python and JavaScript references list every provider and mode we ship, and the native runners for OpenAI Agents, LangGraph, and the Claude Agent SDK.

Evaluation that can run off the request path

Judges now run through the SDK wherever your agent runs. They attach to a config, and for multi-step agents they attach to individual steps, so a quality score points at the step responsible rather than at the workflow as a whole.

Evaluation also no longer has to happen inside the request. For single calls, scoring can be deferred and run later by your own worker, so users get faster responses and the quality signal still lands in AgentControl, attributed to the original request. Graph steps always score inline, and streamed responses score after the last content chunk. The references cover how deferral works under Run judges asynchronously for Python and JavaScript.

Multi-step agents from a single call

An agent graph (a multi-step workflow in which each step is its own agent configuration) now runs with one call. Each step routes independently, so one workflow can run an OpenAI Agents step and a Claude step side by side, and the whole run is tracked and traced like any other call.

Metrics and traces without the wiring

Connecting to AgentControl previously took up to five packages, separate initialization of the base SDK and the AI SDK, a tracker wrapped around every model call to capture metrics, and a hand-built OpenTelemetry (OTel) pipeline for traces.

Now it is one install command: the core package, the base LaunchDarkly SDK where your language needs it, and a handler for each provider you call. The SDK initializes itself on your first AI call, reading your SDK key and provider keys from the environment, and the tracker API is gone, so metrics coverage no longer depends on remembering to wrap each call, and traces take one more package.

What a first call looks like

This is the first call in the legacy Python AI SDK:

# Legacy Python AI SDK: init both clients, evaluate, call the provider, wrap the call

import ldclient
from ldclient.config import Config
from ldai import LDAIClient, AICompletionConfigDefault
from ldai_openai import get_ai_metrics_from_response

ldclient.set_config(Config("YOUR_SDK_KEY"))
ai_client = LDAIClient(ldclient.get())

config = ai_client.completion_config(
    "my-ai-config-flag",
    context,
    AICompletionConfigDefault(enabled=False),
)

tracker = config.create_tracker()

if config.enabled:
    completion = tracker.track_metrics_of(
        get_ai_metrics_from_response,
        lambda: openai_client.chat.completions.create(
            model=config.model.name,
            messages=[m.to_dict() for m in config.messages or []],
        ),
    )

# Traces required a hand-built OpenTelemetry pipeline on top of all of this.

And here it is using the LaunchDarkly AI SDK:

from launchdarkly_ai_openai_messages import openai_messages

result = await openai_messages(
    "my-ai-config-flag",
    "What is feature flagging?",
    {"kind": "user", "key": "user-123"},
)
print(result.response)

The metrics and traces are the same ones the legacy setup produced, with the provider client, message merging, tracker, and OTel pipeline moved into the SDK.

Getting started

To make your first call:

  1. Install the SDK and a handler for each provider you call.
    a) Python 3.12 or later: pip install launchdarkly-server-sdk launchdarkly-ai-server launchdarkly-ai-openai-messages
    b) JavaScript: npm install @launchdarkly/ai-node @launchdarkly/ai-openai-messages
  2. Set LD_SDK_KEY and your provider API key as environment variables.
  3. Create a config in AgentControl, then call it. The shortest path is your provider's convenience function, such as openai_messages() or openaiMessages(). When you want routing across providers, tools, or streaming, use config() and invoke() instead.
  4. To send traces, add the telemetry package. 
    a) Python: pip install "launchdarkly-ai-server[otel]"
    b) JavaScript: npm install @launchdarkly/ai-otel 

    There are no code changes; the SDK detects the package at runtime and logs a one-time warning if it is missing.
  5. Open the config's Monitoring tab to see the metrics and traces from your first call, or AI Insights to see the project-level view across every config.

Read the Python AI SDK reference and the Node.js (server-side) AI SDK reference for the full API. If you’re coming from an older AI SDK, migrating from the legacy AI SDKs maps every call site.

Availability and support

Python and JavaScript are available now. If you’re on .NET, Java, or Go, keep using the AI SDK for your language. Those SDKs are still supported: for example, the Go AI SDK recently gained separate completion, agent, and judge modes along with agent graphs. The handler-based pattern will be available to more languages over time.

New capabilities will land in the LaunchDarkly AI SDK going forward. The legacy Python and Node.js AI SDKs move to maintenance mode: They’ll keep working and keep getting fixes, and there’s no migration deadline. When you’re ready, the migration guide walks through the changes. If you’re starting something new in Python or JavaScript, start here.

Like what you read?
Sign up for our newsletter
Letter in envelope icon
Sign up for our newsletter

Get all the content, tips, and news you can use.

By supplying my contact information, I authorize LaunchDarkly to contact me with personalized marketing communications about our products and services. See our Privacy Policy for more details, or Opt-Out at any time.