{"id":37871267,"url":"https://github.com/launchdarkly-labs/devrel-agents-tutorial","last_synced_at":"2026-01-16T16:41:06.765Z","repository":{"id":316093085,"uuid":"1049204232","full_name":"launchdarkly-labs/devrel-agents-tutorial","owner":"launchdarkly-labs","description":"Multi-agent AI chatbot with dynamic    configuration using LangGraph   workflows, RAG search, MCP tools,   and LaunchDarkly AI Configs.   Control AI behavior, swap models   (Claude/GPT/Mistral), enable   research tools, and run A/B   experiments without code deploys.","archived":false,"fork":false,"pushed_at":"2025-11-07T22:36:56.000Z","size":23136,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-07T23:28:00.008Z","etag":null,"topics":["agents","aiconfigs","chatbot","langchain","langgraph","launchdarkly","mcp","python","rag"],"latest_commit_sha":null,"homepage":"https://launchdarkly.com/docs/tutorials/agents-langgraph","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/launchdarkly-labs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-02T16:27:09.000Z","updated_at":"2025-11-07T22:36:59.000Z","dependencies_parsed_at":"2025-10-07T18:30:01.852Z","dependency_job_id":"bfc7cb6d-7aaa-458f-9f76-3f11da4d948d","html_url":"https://github.com/launchdarkly-labs/devrel-agents-tutorial","commit_stats":null,"previous_names":["launchdarkly-labs/devrel-agents-tutorial"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/launchdarkly-labs/devrel-agents-tutorial","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/launchdarkly-labs%2Fdevrel-agents-tutorial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/launchdarkly-labs%2Fdevrel-agents-tutorial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/launchdarkly-labs%2Fdevrel-agents-tutorial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/launchdarkly-labs%2Fdevrel-agents-tutorial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/launchdarkly-labs","download_url":"https://codeload.github.com/launchdarkly-labs/devrel-agents-tutorial/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/launchdarkly-labs%2Fdevrel-agents-tutorial/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28480064,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agents","aiconfigs","chatbot","langchain","langgraph","launchdarkly","mcp","python","rag"],"created_at":"2026-01-16T16:41:06.660Z","updated_at":"2026-01-16T16:41:06.744Z","avatar_url":"https://github.com/launchdarkly-labs.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Overview\n\nBuild a working multi-agent system with dynamic configuration in 20 minutes using LangGraph multi-agent workflows, RAG search, and LaunchDarkly AI Configs.\n\n*Part 1 of 3 of the series: **Chaos to Clarity: Defensible AI Systems That Deliver on Your Goals***\n\nYou've been there: your AI chatbot works great in testing, then production hits and GPT-4 costs spiral out of control. You switch to Claude, but now European users need different privacy rules. Every change means another deploy, more testing, and crossed fingers that nothing breaks.\n\nThe teams shipping faster? They control AI behavior dynamically instead of hardcoding everything.\n\nThis series shows you how to build **LangGraph multi-agent workflows** that get their intelligence from **RAG** search through your business documents, enhanced with **MCP tools** for live external data, all controlled through **LaunchDarkly AI Configs** without needing to deploy code changes.\n\n## What This Series Covers\n\n- **Part 1** (this post): Build a working multi-agent system with dynamic configuration in 20 minutes\n- **Part 2**: Add advanced features like segment targeting, MCP tool integration, and cost optimization\n- **Part 3**: Run production A/B experiments to prove what actually works\n\nBy the end, you'll have a system that measures its own performance and adapts based on user data instead of guesswork.\n\n## What You'll Build Today\n\nIn the next 20 minutes, you'll have a LangGraph multi-agent system with:\n\n- **Supervisor Agent**: Orchestrates workflow between specialized agents\n- **Security Agent**: Detects PII and sensitive information\n- **Support Agent**: Answers questions using your business documents\n- **Dynamic Control**: Change models, tools, and behavior through LaunchDarkly without code changes\n\n## Prerequisites\n\nYou'll need:\n\n- **Python 3.9+** with `uv` package manager ([install uv](https://docs.astral.sh/uv/getting-started/installation/))\n- **LaunchDarkly account** ([sign up for free](https://app.launchdarkly.com/signup))\n\n**Choose your AI provider setup:**\n\n**Option A: AWS Bedrock (Recommended)**\n- **AWS Account** with Bedrock access and SSO configured\n- **No API keys required** - uses AWS SSO authentication\n- **Cost-effective** - enterprise-grade with cross-region failover\n\n**Option B: Direct API Keys (Traditional)**\n- **OpenAI API key** (required for RAG architecture embeddings)\n- **Anthropic API key** (for Claude models) or **OpenAI API key** (for GPT models)\n\n## Step 1: Clone and Configure (2 minutes)\n\nFirst, let's get everything running locally. We'll explain what each piece does as we build.\n\n```bash\n# Get the code\ngit clone https://github.com/launchdarkly-labs/devrel-agents-tutorial\ncd devrel-agents-tutorial\n\n# Install dependencies (LangGraph, LaunchDarkly SDK, etc.)\nuv sync\n\n# Configure your environment\ncp .env.example .env\n```\n\nFirst, you need to get your LaunchDarkly SDK key by creating a project:\n\n1. **Sign up for LaunchDarkly** at [app.launchdarkly.com](https://app.launchdarkly.com) (free account).\n\u003cNote\u003eIf you're a brand new user, after signing up for an account, you'll need to verify your email address. You can skip through the new user onboarding flow after that. \u003c/Note\u003e\n2. **Find projects on the side bar:**\n\n\u003cbr /\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n![Sidebar Projects](screenshots/sidebar_projects_top_half.png)\n*Projects sidebar in the LaunchDarkly app UI.*\n\n\u003c/div\u003e\n\n3. **Create a new project** called \"multi-agent-chatbot\"\n\n\u003e **⚠️ IMPORTANT: Naming Requirements for Part 2**\n\u003e\n\u003e For the bootstrap script in Part 2 to work correctly, you **MUST** use these exact names:\n\u003e - **Project**: `multi-agent-chatbot`\n\u003e - **AI Configs**: `supervisor-agent`, `security-agent`, `support-agent`\n\u003e - **Tools**: `search_v2`, `reranking` (created in Part 1)\n\u003e - **Variations**: `supervisor-basic`, `pii-detector`, `rag-search-enhanced`\n\u003e\n\u003e The configuration files are hardcoded to use these specific keys.\n\n\u003cdiv align=\"center\"\u003e\n\n![New Project](screenshots/new_project_small.png)\n*Creating a new project in LaunchDarkly.*\n\n\u003c/div\u003e\n\n4. **Get your SDK key**:\n    \n    ⚙️ (bottom of sidebar) → **Projects** → **multi-agent-chatbot** → ⚙️ (to the right) \n    \n    → **Environments** → **Production** → **...** → **SDK key** \n    \n    this is your `LD_SDK_KEY`\n\n\u003cbr /\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n![SDK Key](screenshots/sdk_key_small.png)\n*Location of the SDK key in LaunchDarkly project settings.*\n\n\u003c/div\u003e\n\nNow configure your authentication method in `.env`:\n\n### Option A: AWS Bedrock Setup (Recommended)\n\n```bash\n# LaunchDarkly Configuration\nLD_SDK_KEY=your-launchdarkly-sdk-key  # From step above\n\n# AWS Bedrock Configuration\nAUTH_METHOD=sso                       # Use AWS SSO authentication\nAWS_REGION=us-east-1                  # Your AWS region\nAWS_PROFILE=your-sso-profile-name     # Your AWS SSO profile name\n\n# Optional: Bedrock Embedding Configuration\nBEDROCK_EMBEDDING_DIMENSIONS=1024     # Options: 256, 512, 1024\nBEDROCK_EMBEDDING_MODEL=amazon.titan-embed-text-v2:0\n```\n\n**Then configure AWS SSO:**\n```bash\n# Configure AWS SSO (one-time setup)\naws configure sso --profile your-sso-profile-name\n\n# Login to AWS SSO (run when token expires)\naws sso login --profile your-sso-profile-name\n\n# Test your access\naws bedrock list-foundation-models --region us-east-1 --profile your-sso-profile-name\n```\n\n### Option B: Direct API Keys Setup\n\n```bash\n# LaunchDarkly Configuration\nLD_SDK_KEY=your-launchdarkly-sdk-key  # From step above\n\n# Direct API Configuration\nAUTH_METHOD=api-key                   # Use direct API keys (default)\nOPENAI_API_KEY=your-openai-key        # Required for RAG embeddings\nANTHROPIC_API_KEY=your-anthropic-key  # Required for Claude models\n```\n\nThis sets up a **LangGraph** application that uses LaunchDarkly to control AI behavior. Think of it like swapping actors, directors, even props mid-performance without stopping the show.\n\n**Security Note:** Do not check the `.env` into your source control. Keep those secrets safe!\n\n### 🚨 **Common AWS SSO Issue:**\n\nIf you get `AccessDeniedException` errors, verify your Python code is using the correct AWS profile:\n\n```bash\n# Check which AWS account your profile uses\naws sts get-caller-identity --profile your-sso-profile-name\n\n# If the account numbers don't match your error message, add AWS_PROFILE to your .env\n```\n\n**The error message will show the account number your Python code is using.** Make sure it matches your SSO profile account.\n\n### 🚨 **Bedrock Model ID Requirements:**\n\nWhen configuring AI models in LaunchDarkly for Bedrock, you should use **inference profile IDs** (with region prefix):\n\n**✅ BEST PRACTICE - Inference Profile IDs (with region prefix):**\n```\nus.anthropic.claude-3-5-sonnet-20241022-v2:0\nus.anthropic.claude-3-7-sonnet-20250219-v1:0\neu.anthropic.claude-3-5-haiku-20241022-v2:0\n```\n\n**⚠️ AUTO-CORRECTED - Direct Model IDs (will be fixed automatically):**\n```\nanthropic.claude-3-7-sonnet-20250219-v1:0  → us.anthropic.claude-3-7-sonnet-20250219-v1:0\nanthropic.claude-3-5-sonnet-20241022-v2:0  → us.anthropic.claude-3-5-sonnet-20241022-v2:0\n```\n\n**How Auto-Correction Works:**\n\nThe system automatically converts direct model IDs to inference profile IDs to prevent `ValidationException` errors from Bedrock. The region prefix is determined by:\n\n1. **`BEDROCK_INFERENCE_REGION`** env var (if set) - explicit user preference\n2. **`AWS_REGION`** env var (e.g., `us-east-1` → `us` prefix) - automatic detection\n3. **Default to `us`** if neither is set\n\n**Configuring Region Prefix:**\n\nTo use European inference profiles, add to your `.env`:\n```bash\nBEDROCK_INFERENCE_REGION=eu  # Force EU inference profiles\n```\n\n**Finding Available Inference Profiles:**\n```bash\n# List available Bedrock inference profiles\naws bedrock list-inference-profiles --region us-east-1 --profile your-sso-profile-name\n```\n\n**Why Inference Profiles?**\n\nBedrock requires inference profile IDs for on-demand throughput. The region prefix (`us.`, `eu.`, `ap.`, etc.) enables cross-region inference profiles for better availability and failover.\n\n## Step 2: Add Your Business Knowledge (2 minutes)\n\nThe system includes a sample reinforcement learning textbook. Replace it with your own documents for your specific domain.\n\n```bash\n# Option A: Use the sample (AI/ML knowledge)\n# Already included: kb/SuttonBarto-IPRL-Book2ndEd.pdf\n\n# Option B: Add your documents\nrm kb/*.pdf  # Clear sample\ncp /path/to/your-docs/*.pdf kb/\n```\n\nDocument types that work well:\n- **Legal**: Contracts, case law, compliance guidelines\n- **Healthcare**: Protocols, research papers, care guidelines\n- **SaaS**: API docs, user guides, troubleshooting manuals\n- **E-commerce**: Product catalogs, policies, FAQs\n\n## Step 3: Initialize Your Knowledge Base (2 minutes)\n\nTurn your documents into searchable **RAG** knowledge:\n\n```bash\n# Create vector embeddings for semantic search\nuv run python initialize_embeddings.py --force\n```\n\nThis builds your **RAG** (Retrieval-Augmented Generation) foundation using FAISS vector database. The system automatically detects your authentication method:\n\n- **AWS Bedrock**: Uses Amazon Titan V2 embeddings (1024 dimensions by default)\n- **Direct API Keys**: Uses OpenAI text-embedding-3-small (1536 dimensions)\n\n**RAG** converts documents into vector embeddings that capture semantic meaning rather than just keywords, making search actually understand context.\n\n## Step 4: Define Your Tools (3 minutes)\n\nDefine the search tools your agents will use.\n\nIn the LaunchDarkly app sidebar, click **Library** in the AI section. On the following screen, click the **Tools** tab, then **Create tool**.\n\n\u003cbr /\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n![Library](screenshots/library_small.png)\n*AI Library section in the LaunchDarkly dashboard sidebar.*\n\n\u003c/div\u003e\n\n### Create the RAG vector search tool:\nNote: we will be creating a simple search_v1 during part 3 when we learn about experimentation.\nCreate a tool using the following configuration:\n\u003e \n\u003e **Key:** \n\u003e ```\n\u003e search_v2\n\u003e ```\n\u003e\n\u003e **Description:** \n\u003e ```\n\u003e Semantic search using vector embeddings\n\u003e ```\n\u003e\n\u003e **Schema:**\n\u003e ```json\n\u003e {\n\u003e   \"properties\": {\n\u003e     \"query\": {\n\u003e       \"description\": \"Search query for semantic matching\",\n\u003e       \"type\": \"string\"\n\u003e     },\n\u003e     \"top_k\": {\n\u003e       \"description\": \"Number of results to return\",\n\u003e       \"type\": \"number\"\n\u003e     }\n\u003e   },\n\u003e   \"additionalProperties\": false,\n\u003e   \"required\": [\n\u003e     \"query\"\n\u003e   ]\n\u003e }\n\u003e ```\nWhen you're done, click **Save**.\n\n### Create the reranking tool:\nBack on the Tools section, click **Add tool** to create a new tool. Add the following properties: \n\u003e \n\u003e **Key:** \n\u003e ```\n\u003e reranking\n\u003e ```\n\u003e\n\u003e **Description:** \n\u003e ```\n\u003e Reorders results by relevance using BM25 algorithm\n\u003e ```\n\u003e\n\u003e **Schema:**\n\u003e ```json\n\u003e {\n\u003e   \"properties\": {\n\u003e     \"query\": {\n\u003e       \"description\": \"Original query for scoring\",\n\u003e       \"type\": \"string\"\n\u003e     },\n\u003e     \"results\": {\n\u003e       \"description\": \"Results to rerank\",\n\u003e       \"type\": \"array\"\n\u003e     }\n\u003e   },\n\u003e   \"additionalProperties\": false,\n\u003e   \"required\": [\n\u003e     \"query\",\n\u003e     \"results\"\n\u003e   ]\n\u003e }\n\u003e ```\nWhen you're done, click **Save**.\nThe `reranking` tool takes search results from `search_v2` and reorders them using the BM25 algorithm to improve relevance. This hybrid approach combines semantic search (vector embeddings) with lexical matching (keyword-based scoring), making it especially useful for technical terms, product names, and error codes where exact term matching matters more than conceptual similarity.\n\n\n\u003e **🔍 How Your RAG Architecture Works**\n\u003e\n\u003e Your **RAG** system works in two stages: `search_v2` performs semantic similarity search using FAISS by converting queries into the same vector space as your documents (via **OpenAI** or **Bedrock Titan** embeddings), while `reranking` reorders results for maximum relevance. This **RAG** approach significantly outperforms keyword search by understanding context, so asking \"My app is broken\" can find troubleshooting guides that mention \"application errors\" or \"system failures.\"\n\n## Step 5: Create Your AI Agents in LaunchDarkly (5 minutes)\n\nCreate LaunchDarkly AI Configs to control your **LangGraph** multi-agent system dynamically. **LangGraph** is LangChain's framework for building stateful, multi-**agent** applications that maintain conversation state across **agent** interactions. Your **LangGraph** architecture enables sophisticated workflows where **agents** collaborate and pass context between each other.\n\n### Create the Supervisor Agent\n\n1. In the LaunchDarkly dashboard sidebar, navigate to **AI Configs** and click **Create New**\n2. Select `🤖 Agent-based`\n\n\u003cbr /\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n![Agent Based](screenshots/agent-based_small.png)\n*Selecting the Agent-based configuration type.*\n\n\u003c/div\u003e\n\n3. Name it `supervisor-agent`\n4. Add this configuration:\n\n\u003e\n\u003e **variation:**\n\u003e ```\n\u003e supervisor-basic\n\u003e ```\n\u003e\n\u003e **Model configuration:**\n\u003e ```\n\u003e Anthropic\n\u003e ```\n\u003e ```\n\u003e claude-3-7-sonnet-latest\n\u003e ```\n\u003e\n\u003e **Note for Bedrock users:** The system auto-corrects direct model IDs to inference profiles:\n\u003e - Use either `claude-3-7-sonnet-latest` (auto-corrected) or `us.anthropic.claude-3-7-sonnet-20250219-v1:0` (explicit)\n\u003e - Control region prefix via `BEDROCK_INFERENCE_REGION` env var (defaults to `us`)\n\u003e - See \"Bedrock Model ID Requirements\" section above for details\n\u003e\n\u003e **Goal or task:**\n\u003e ```\n\u003e You are an intelligent routing supervisor for a multi-agent system. Your primary job is to assess whether user input likely contains PII (personally identifiable information) to determine the most efficient processing route.\n\u003e\n\u003e **PII Assessment:**\n\u003e Analyze the user input and provide:\n\u003e - likely_contains_pii: boolean assessment\n\u003e - confidence: confidence score (0.0 to 1.0)\n\u003e - reasoning: clear explanation of your decision\n\u003e - recommended_route: either 'security_agent' or 'support_agent'\n\u003e\n\u003e **Route to SECURITY_AGENT** if the text likely contains:\n\u003e - Email addresses, phone numbers, addresses\n\u003e - Names (first/last names, usernames)\n\u003e - Financial information (credit cards, SSNs, account numbers)\n\u003e - Sensitive personal data\n\u003e\n\u003e **Route to SUPPORT_AGENT** if the text appears to be:\n\u003e - General questions without personal details\n\u003e - Technical queries\n\u003e - Search requests\n\u003e - Educational content requests\n\u003e\n\u003e Analyze this user input and recommend the optimal route:\n\u003e ```\nClick **Review and save**. Now enable your AI Config by switching to the **Targeting** tab and editing the default rule to serve the variation you just created:\n\n\u003cbr /\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n![Targeting Configuration](screenshots/targeting.png)\n*Targeting tab showing the default rule configuration for AI agents.*\n\n\u003c/div\u003e\n\nClick **Edit** on the Default rule, change it to serve your `supervisor-basic` variation, and save with a note like \"Enabling new agent config\".\nThe supervisor **agent** demonstrates **LangGraph** orchestration by routing requests based on content analysis rather than rigid rules. **LangGraph** enables this **agent** to maintain conversation context and make intelligent routing decisions that adapt to user needs and LaunchDarkly AI Config parameters.\n\n\n### Create the Security Agent\n\nSimilarly, create another AI Config called `security-agent`\n\n\u003e \n\u003e **variation:** \n\u003e ```\n\u003e pii-detector\n\u003e ```\n\u003e\n\u003e **Model configuration:** \n\u003e ```\n\u003e Anthropic\n\u003e ``` \n\u003e ```\n\u003e claude-3-7-sonnet-latest\n\u003e ```\n\u003e\n\u003e **Goal or task:** \n\u003e ```\n\u003eYou are a privacy agent that REMOVES PII and formats the input for another process. Analyze the input text and identify any personally identifiable information including: Email addresses, Phone numbers, Social Security Numbers, Names (first, last, full names), Physical addresses, Credit card numbers, Driver's license numbers, Any other sensitive personal data. Respond with: detected: true if any PII was found, false otherwise,types: array of PII types found (e.g., ['email', 'name', 'phone']), redacted: the input text with PII replaced by [REDACTED], keeping the text readable and natural. Examples: Input: 'My email is john@company.com and I need help', Output: detected=true, types=['email'], redacted='My email is [REDACTED] and I need help'. Input: 'I need help with my account',Output: detected=false, types=[], redacted='I need help with my account'. Input: 'My name is Sarah Johnson and my phone is 555-1234', Output: detected=true, types=['name', 'phone'], redacted='My name is [REDACTED] and my phone is [REDACTED]'. Be thorough in your analysis and err on the side of caution when identifying potential PII.\n\nThis agent detects PII and provides detailed redaction information, showing exactly what sensitive data was found and how it would be handled for compliance and transparency.\n\n**Remember to switch to the Targeting tab and enable this agent the same way we did for the supervisor - edit the default rule to serve your `pii-detector` variation and save it.**\n\n### Create the Support Agent\n\nFinally, create `support-agent`\n\n\n\u003e \n\u003e **variation:** \n\u003e ```\n\u003e rag-search-enhanced\n\u003e ```\n\u003e\n\u003e **Model configuration:** \n\u003e ```\n\u003e Anthropic\n\u003e ``` \n\u003e ```\n\u003e claude-3-7-sonnet-latest\n\u003e ```\n\u003e\n\u003e Click **Attach tools**.\n\u003e\n\u003e select:  **✅ reranking** **✅ search_v2**\n\u003e\n\u003e → **Add parameters**\n\u003e → **Click Custom parameters**\n\u003e ```json\n\u003e {\"max_tool_calls\":5}\n\u003e ```\n\u003e\n\u003e **Goal or task:** \n\u003e ```\n\u003e You are a helpful assistant that can search documentation and research papers. When search results are available, prioritize information from those results over your general knowledge to provide the most accurate and up-to-date responses. Use available tools to search the knowledge base and external research databases to answer questions accurately and comprehensively.\n\u003e ```\n\nThis **agent** combines **LangGraph** workflow management with your **RAG** tools. **LangGraph** enables the **agent** to chain multiple tool calls together: first using **RAG** for document retrieval, then semantic reranking, all while maintaining conversation state and handling error recovery gracefully.\n\n**Remember to switch to the Targeting tab and enable this agent the same way - edit the default rule to serve your `rag-search-enhanced` variation and save it.**\n\nWhen you are done, you should have three enabled AI Config Agents as shown below.\n\n\u003cbr /\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n![Agents](screenshots/agents_small.png)\n*Overview of all three configured AI agents in LaunchDarkly.*\n\n\u003c/div\u003e\n\n## Step 6: Launch Your System (2 minutes)\n\nStart the system:\n\n```bash\n# Terminal 1: Start the backend\nuv run uvicorn api.main:app --reload --port 8000\n```\n\n```bash\n# Terminal 2: Launch the UI  \nuv run streamlit run ui/chat_interface.py --server.port 8501\n```\n\nOpen http://localhost:8501 in your browser. You should see a clean chat interface.\n\n## Step 7: Test Your Multi-Agent System (2 minutes)\n\nTest with these queries:\n\n**Basic Knowledge Test:**\n\"What is reinforcement learning?\" (if using sample docs)\nOr ask about your specific domain: \"What's our refund policy?\"\n\n**PII Detection Test:**\n\"My email is john.doe@example.com and I need help\"\n\n**Workflow Details** show:\n- Which agents are activated\n- What models and tools are being used\n- Text after redaction\n\n\u003cbr /\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n![UI](screenshots/ui_small.png)\n*Chat interface showing the multi-agent workflow in action.*\n\n\u003c/div\u003e\n\nWatch LangGraph in action: the supervisor agent first routes to the security agent, which detects PII. It then passes control to the support agent, which uses your RAG system for document search. LangGraph maintains state across this multi-agent workflow so that context flows seamlessly between agents.\n\n## Step 8: Make Changes Without Deploying Code\n\nTry these experiments in LaunchDarkly:\n\n### Switch Models Instantly\n\nEdit your `support-agent` config:\n```json\n{\n  \"model\": {\"name\": \"chatgpt-4o-latest\"}  // was claude\n}\n```\n\nSave and refresh your chat. No code deployment or restart required.\n\n### Adjust Tool Usage\n\nWant to limit tool calls? Reduce the limits:\n```json\n{\n  \"customParameters\": {\n    \"max_tool_calls\": 3  // was 5\n  }\n}\n```\n\n### Change Agent Behavior\n\nWant more thorough searches? Update instructions:\n```json\n{\n  \"instructions\": \"You are a research specialist. Always search multiple times from different angles before answering. Prioritize accuracy over speed.\"\n}\n```\n\nChanges take effect immediately without downtime.\n\n## Understanding What You Built\n\nYour **LangGraph** multi-**agent** system with **RAG** includes:\n\n**1. LangGraph Orchestration**\nThe supervisor **agent** uses **LangGraph** state management to route requests intelligently based on content analysis.\n\n**2. Privacy Protection**\nThe supervisor **agent** uses **LangGraph** state management to route requests intelligently. This separation allows you to assign a trusted model to the security and supervisor agents and consider on a less-trusted model for the more expensive support agent at a reduced risk of PII exposure.\n\n**3. RAG Knowledge System**\nThe support **agent** combines **LangGraph** tool chaining with your **RAG** system for semantic document search and reranking.\n\n**4. Runtime Control**\nLaunchDarkly controls both **LangGraph** behavior and **RAG** parameters without code changes.\n\n## What's Next?\n\nYour multi-agent system is running with dynamic control and ready for optimization.\n\n **In Part 2**, we'll add:\n\n- Geographic-based privacy rules (strict for EU, standard for Other)\n- MCP tools for external data\n- Business tier configurations (free, paid)\n- Cost optimization strategies\n\n**In Part 3**, we'll run A/B experiments to prove which configurations actually work best with real data.\n\n## Try This Now\n\nExperiment with:\n\n1. **Different Instructions**: Make agents more helpful, more cautious, or more thorough\n2. **Tool Combinations**: Add/remove tools to see impact on quality\n3. **Model Comparisons**: Try different models for different agents\n4. **Cost Limits**: Find the sweet spot between quality and cost\n\nEvery change is instant, measurable, and reversible.\n\n## Key Takeaways\n\n- Multi-agent systems work best when each agent has a specific role\n- Dynamic configuration handles changing requirements better than hardcoding\n- LaunchDarkly AI Configs control and change AI behavior without requiring deployments\n- Start simple and add complexity as you learn what works\n\n## Related Resources\n\nExplore the **[LaunchDarkly MCP Server](/home/getting-started/mcp)** - enable AI agents to access feature flag configurations, user segments, and experimentation data directly through the Model Context Protocol.\n\n---\n\n*Questions? Issues? Reach out at `aiproduct@launchdarkly.com` or open an issue in the [GitHub repo](https://github.com/launchdarkly-labs/devrel-agents-tutorial/issues).*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaunchdarkly-labs%2Fdevrel-agents-tutorial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flaunchdarkly-labs%2Fdevrel-agents-tutorial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaunchdarkly-labs%2Fdevrel-agents-tutorial/lists"}