This example demonstrates how to use LaunchDarkly's AI Config with LangGraph to orchestrate multiple agents in a code review workflow.
- Python 3.10 or higher
- Poetry installed
- A LaunchDarkly account and SDK key
- API keys for the providers you want to use
-
Create the following configs in your LaunchDarkly project. You can use different keys by setting the environment variables in your
.env.- Create an AI Agent Config for code analysis. Default key:
code-review-analyzer. - Create an AI Agent Config for documentation generation. Default key:
code-review-documentation.
- Create an AI Agent Config for code analysis. Default key:
-
Create a
.envfile in this directory with the following variables:LAUNCHDARKLY_SDK_KEY=your-launchdarkly-sdk-key LAUNCHDARKLY_ANALYZER_CONFIG_KEY=code-review-analyzer LAUNCHDARKLY_DOCUMENTATION_CONFIG_KEY=code-review-documentationAdd the API keys for the providers you want to use:
OPENAI_API_KEY=your-openai-api-key GOOGLE_API_KEY=your-google-api-key AWS_ACCESS_KEY_ID=your-access-key-id AWS_SECRET_ACCESS_KEY=your-secret-access-key -
Install the required dependencies:
poetry install
poetry run agent-graph