aiconfig-agent-graphs

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

AI Config Agent Graphs

AI Config Agent Graphs

You're using a skill that will guide you through creating and managing agent graphs in LaunchDarkly. Your job is to design the graph topology, create it with the right edges and handoffs, and verify the routing between AI Config nodes.
你正在使用一项技能,它将引导你在LaunchDarkly中创建和管理Agent图。你的任务是设计图拓扑结构,使用正确的边和切换逻辑创建图,并验证AI Config节点之间的路由。

Prerequisites

前提条件

This skill requires the remotely hosted LaunchDarkly MCP server to be configured in your environment.
Required MCP tools:
  • create-agent-graph
    -- create a new graph with nodes and edges
  • get-agent-graph
    -- inspect a graph's structure and edges
  • list-agent-graphs
    -- browse existing graphs in the project
Optional MCP tools:
  • update-agent-graph
    -- modify edges, root config, or description
  • delete-agent-graph
    -- permanently remove a graph
  • get-ai-config
    -- inspect individual AI Configs that serve as nodes
  • create-ai-config
    -- create new AI Configs to use as graph nodes
此技能要求在你的环境中配置远程托管的LaunchDarkly MCP服务器。
必需的MCP工具:
  • create-agent-graph
    —— 创建包含节点和边的新图
  • get-agent-graph
    —— 检查图的结构和边
  • list-agent-graphs
    —— 浏览项目中现有的图
可选的MCP工具:
  • update-agent-graph
    —— 修改边、根Config或描述
  • delete-agent-graph
    —— 永久删除图
  • get-ai-config
    —— 检查作为节点的单个AI Config
  • create-ai-config
    —— 创建用作图节点的新AI Config

Core Concepts

核心概念

What Are Agent Graphs?

什么是Agent图?

An agent graph is a directed graph where:
  • Nodes are AI Configs (each config is an agent with its own model, prompt, and tools)
  • Edges define routing between configs (source -> target)
  • Handoff data on edges controls how context is passed between agents
  • Root config is the entry point — the first agent that receives user input
Agent图是一种有向图,其中:
  • 节点是AI Config(每个Config都是一个拥有自己模型、提示词和工具的Agent)
  • 定义了Config之间的路由(源 -> 目标)
  • 边上的切换数据控制Agent之间的上下文传递方式
  • 根Config是入口点——第一个接收用户输入的Agent

When to Use Agent Graphs

何时使用Agent图

ScenarioExample
Multi-step workflowsTriage agent -> Specialist agent -> Summary agent
Routing by intentRouter agent decides which specialist handles the request
Escalation chainsL1 support -> L2 support -> Human handoff
Pipeline processingExtract -> Transform -> Validate -> Store
场景示例
多步骤工作流分诊Agent -> 专家Agent -> 总结Agent
按意图路由路由Agent决定由哪位专家处理请求
升级链L1支持 -> L2支持 -> 人工交接
流水线处理提取 -> 转换 -> 验证 -> 存储

Graph Structure

图结构

[Root Config] --edge--> [Config A] --edge--> [Config C]
                  \--edge--> [Config B]
Each edge has:
  • key
    -- unique identifier for the edge
  • sourceConfig
    -- the AI Config key that routes FROM
  • targetConfig
    -- the AI Config key that routes TO
  • handoff
    (optional) -- data/instructions passed during the transition
[Root Config] --edge--> [Config A] --edge--> [Config C]
                  \--edge--> [Config B]
每条边包含:
  • key
    —— 边的唯一标识符
  • sourceConfig
    —— 路由发起方的AI Config键
  • targetConfig
    —— 路由接收方的AI Config键
  • handoff
    (可选)—— 转换过程中传递的数据/指令

Core Principles

核心原则

  1. Design Before Building: Map out nodes and edges on paper/whiteboard first
  2. One Agent, One Job: Each node should have a clear, focused responsibility
  3. Root Config Is the Router: The entry point should understand how to dispatch
  4. Handoff Data Matters: Define what context flows between agents
  5. Verify the Full Path: Test that routing works end-to-end
  1. 先设计再构建:先在纸上/白板上规划节点和边
  2. 一个Agent,一个任务:每个节点应承担明确、专注的职责
  3. 根Config是路由器:入口点应了解如何调度请求
  4. 切换数据很重要:定义Agent之间传递的上下文内容
  5. 验证完整路径:测试端到端路由是否正常工作

Workflow

工作流

Step 1: Design the Graph

步骤1:设计图

Before creating anything:
  1. Identify the agents (AI Configs) needed — each is a graph node
  2. Map the routing: which agent hands off to which?
  3. Define handoff data: what context does each edge carry?
  4. Identify the root config: which agent receives initial input?
  5. Check existing graphs with
    list-agent-graphs
    to avoid duplicates
  6. Check existing AI Configs with
    get-ai-config
    to see what nodes already exist
在创建任何内容之前:
  1. 确定所需的Agent(AI Config)——每个都是图的节点
  2. 规划路由:哪个Agent切换到哪个Agent?
  3. 定义切换数据:每条边携带什么上下文?
  4. 确定根Config:哪个Agent接收初始输入?
  5. 使用
    list-agent-graphs
    检查现有图,避免重复
  6. 使用
    get-ai-config
    检查现有AI Config,了解已存在的节点

Step 2: Ensure Nodes Exist

步骤2:确保节点存在

Each node in the graph must be an existing AI Config. If configs don't exist yet:
  1. Use
    create-ai-config
    to create each agent config
  2. Set up variations with appropriate models and prompts for each agent's role
  3. Verify each config exists with
    get-ai-config
图中的每个节点必须是已存在的AI Config。如果Config尚未存在:
  1. 使用
    create-ai-config
    创建每个Agent的Config
  2. 为每个Agent的角色设置合适的模型和提示词变体
  3. 使用
    get-ai-config
    验证每个Config是否存在

Step 3: Create the Graph

步骤3:创建图

Use
create-agent-graph
with:
  • projectKey
    -- the project containing the AI Configs
  • key
    -- unique identifier for the graph
  • name
    -- human-readable display name
  • description
    (optional) -- explain the graph's purpose
  • rootConfigKey
    -- the entry-point AI Config key
  • edges
    -- array of connections between configs
json
{
  "projectKey": "my-project",
  "key": "support-triage-graph",
  "name": "Customer Support Triage",
  "description": "Routes customer queries to the appropriate specialist agent",
  "rootConfigKey": "triage-agent",
  "edges": [
    {
      "key": "triage-to-billing",
      "sourceConfig": "triage-agent",
      "targetConfig": "billing-specialist",
      "handoff": {"category": "billing", "priority": "normal"}
    },
    {
      "key": "triage-to-technical",
      "sourceConfig": "triage-agent",
      "targetConfig": "technical-specialist",
      "handoff": {"category": "technical", "priority": "normal"}
    }
  ]
}
使用
create-agent-graph
工具,需提供:
  • projectKey
    —— 包含AI Config的项目
  • key
    —— 图的唯一标识符
  • name
    —— 人类可读的显示名称
  • description
    (可选)—— 说明图的用途
  • rootConfigKey
    —— 作为入口点的AI Config键
  • edges
    —— Config之间的连接数组
json
{
  "projectKey": "my-project",
  "key": "support-triage-graph",
  "name": "Customer Support Triage",
  "description": "Routes customer queries to the appropriate specialist agent",
  "rootConfigKey": "triage-agent",
  "edges": [
    {
      "key": "triage-to-billing",
      "sourceConfig": "triage-agent",
      "targetConfig": "billing-specialist",
      "handoff": {"category": "billing", "priority": "normal"}
    },
    {
      "key": "triage-to-technical",
      "sourceConfig": "triage-agent",
      "targetConfig": "technical-specialist",
      "handoff": {"category": "technical", "priority": "normal"}
    }
  ]
}

Step 4: Verify

步骤4:验证

  1. Use
    get-agent-graph
    to confirm the graph was created with the correct structure
  2. Verify edges connect the right source and target configs
  3. Check that the root config key matches the intended entry point
  4. Confirm handoff data is present on edges that need it
Report results:
  • Graph created with N nodes and M edges
  • Root config set correctly
  • All edges verified
  1. 使用
    get-agent-graph
    确认图已按正确结构创建
  2. 验证边连接了正确的源和目标Config
  3. 检查根Config键是否与预期的入口点匹配
  4. 确认需要切换数据的边上已包含该数据
报告结果:
  • 已创建包含N个节点和M条边的图
  • 根Config设置正确
  • 所有边已验证

Edge Cases

边缘情况

SituationAction
Config doesn't exist yetCreate it first with
create-ai-config
before referencing in a graph
Circular routingAllowed but warn user — ensure there's a termination condition in the agent logic
Single-node graphValid but unusual — consider if a graph is actually needed
Updating edgesUse
update-agent-graph
— provide the complete new edge list
情况操作
Config尚未存在在图中引用之前,先使用
create-ai-config
创建它
循环路由允许但需警告用户——确保Agent逻辑中有终止条件
单节点图有效但不常见——考虑是否真的需要使用图
更新边使用
update-agent-graph
——提供完整的新边列表

What NOT to Do

注意事项

  • Don't create a graph before the AI Config nodes exist
  • Don't forget handoff data when agents need context from predecessors
  • Don't create overly complex graphs — start simple and add nodes as needed
  • Don't delete a graph without understanding if it's actively used in agent workflows
  • 不要在AI Config节点存在之前创建图
  • 当Agent需要从上游获取上下文时,不要忘记设置切换数据
  • 不要创建过于复杂的图——从简单开始,根据需要添加节点
  • 在删除图之前,要了解它是否正被Agent工作流使用