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 Graphs)。你的任务是设计图拓扑结构,创建带有正确边和交接逻辑的图,并验证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
    —— 修改边、根配置或描述
  • delete-agent-graph
    —— 永久删除图
  • get-ai-config
    —— 查看作为节点的单个AI Config
  • create-ai-config
    —— 创建用作图节点的新AI Config

Core Concepts

核心概念

What Are Agent Graphs?

什么是智能体图(Agent Graphs)?

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
智能体图是一种有向图,其中:
  • 节点是AI Config(每个配置是一个拥有自己模型、提示词和工具的智能体)
  • 定义配置之间的路由(源 -> 目标)
  • 边的交接数据控制智能体之间传递上下文的方式
  • 根配置是入口点——第一个接收用户输入的智能体

When to Use Agent Graphs

何时使用智能体图(Agent Graphs)

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
场景示例
多步骤工作流分诊智能体 -> 专家智能体 -> 总结智能体
按意图路由路由智能体决定由哪位专家处理请求
升级链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. 一个智能体,一项任务:每个节点应承担清晰、明确的职责
  3. 根配置即路由器:入口点应了解如何调度请求
  4. 交接数据至关重要:明确智能体之间传递的上下文内容
  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. 确定所需的智能体(AI Config)——每个都是图的一个节点
  2. 规划路由:哪个智能体交接给哪个?
  3. 定义交接数据:每条边传递什么上下文?
  4. 确定根配置:哪个智能体接收初始输入?
  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。如果配置尚未存在:
  1. 使用
    create-ai-config
    创建每个智能体配置
  2. 为每个智能体的角色设置合适的模型和提示词变体
  3. 使用
    get-ai-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
    —— 配置间连接的数组
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. 验证边是否连接了正确的源和目标配置
  3. 检查根配置密钥是否与预期的入口点一致
  4. 确认需要交接数据的边上已包含该数据
报告结果:
  • 已创建包含N个节点和M条边的图
  • 根配置设置正确
  • 所有边已验证

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
情况操作
配置尚未存在在图中引用之前,先使用
create-ai-config
创建它
循环路由允许但需向用户警告——确保智能体逻辑中包含终止条件
单节点图有效但不常见——考虑是否真的需要使用图
更新边使用
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节点存在之前创建图
  • 当智能体需要从先前的智能体获取上下文时,不要遗漏交接数据
  • 不要创建过于复杂的图——从简单开始,根据需要添加节点
  • 在不清楚图是否正用于智能体工作流的情况下,不要删除图