agent-graphs
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAI 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 a new graph with nodes and edges
create-agent-graph - -- inspect a graph's structure and edges
get-agent-graph - -- browse existing graphs in the project
list-agent-graphs
Optional MCP tools:
- -- modify edges, root config, or description
update-agent-graph - -- permanently remove a graph
delete-agent-graph - -- inspect individual AI Configs that serve as nodes
get-ai-config - -- create new AI Configs to use as graph nodes
create-ai-config
使用此技能需要在你的环境中配置远程托管的LaunchDarkly MCP服务器。
必备MCP工具:
- —— 创建包含节点和边的新图
create-agent-graph - —— 查看图的结构和边
get-agent-graph - —— 浏览项目中已有的图
list-agent-graphs
可选MCP工具:
- —— 修改边、根配置或描述
update-agent-graph - —— 永久删除图
delete-agent-graph - —— 查看作为节点的单个AI Config
get-ai-config - —— 创建用作图节点的新AI Config
create-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)
| Scenario | Example |
|---|---|
| Multi-step workflows | Triage agent -> Specialist agent -> Summary agent |
| Routing by intent | Router agent decides which specialist handles the request |
| Escalation chains | L1 support -> L2 support -> Human handoff |
| Pipeline processing | Extract -> Transform -> Validate -> Store |
| 场景 | 示例 |
|---|---|
| 多步骤工作流 | 分诊智能体 -> 专家智能体 -> 总结智能体 |
| 按意图路由 | 路由智能体决定由哪位专家处理请求 |
| 升级链 | L1支持 -> L2支持 -> 人工交接 |
| 流水线处理 | 提取 -> 转换 -> 验证 -> 存储 |
Graph Structure
图结构
[Root Config] --edge--> [Config A] --edge--> [Config C]
\--edge--> [Config B]Each edge has:
- -- unique identifier for the edge
key - -- the AI Config key that routes FROM
sourceConfig - -- the AI Config key that routes TO
targetConfig - (optional) -- data/instructions passed during the transition
handoff
[Root Config] --edge--> [Config A] --edge--> [Config C]
\--edge--> [Config B]每条边包含:
- —— 边的唯一标识符
key - —— 发起路由的AI Config密钥
sourceConfig - —— 路由指向的AI Config密钥
targetConfig - (可选)—— 过渡期间传递的数据/指令
handoff
Core Principles
核心原则
- Design Before Building: Map out nodes and edges on paper/whiteboard first
- One Agent, One Job: Each node should have a clear, focused responsibility
- Root Config Is the Router: The entry point should understand how to dispatch
- Handoff Data Matters: Define what context flows between agents
- Verify the Full Path: Test that routing works end-to-end
- 先设计再构建:先在纸上或白板上规划节点和边
- 一个智能体,一项任务:每个节点应承担清晰、明确的职责
- 根配置即路由器:入口点应了解如何调度请求
- 交接数据至关重要:明确智能体之间传递的上下文内容
- 验证完整路径:测试路由是否能端到端正常工作
Workflow
工作流程
Step 1: Design the Graph
步骤1:设计图结构
Before creating anything:
- Identify the agents (AI Configs) needed — each is a graph node
- Map the routing: which agent hands off to which?
- Define handoff data: what context does each edge carry?
- Identify the root config: which agent receives initial input?
- Check existing graphs with to avoid duplicates
list-agent-graphs - Check existing AI Configs with to see what nodes already exist
get-ai-config
在创建任何内容之前:
- 确定所需的智能体(AI Config)——每个都是图的一个节点
- 规划路由:哪个智能体交接给哪个?
- 定义交接数据:每条边传递什么上下文?
- 确定根配置:哪个智能体接收初始输入?
- 使用查看现有图,避免重复创建
list-agent-graphs - 使用查看现有AI Config,了解已有的节点
get-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:
- Use to create each agent config
create-ai-config - Set up variations with appropriate models and prompts for each agent's role
- Verify each config exists with
get-ai-config
图中的每个节点必须是已存在的AI Config。如果配置尚未存在:
- 使用创建每个智能体配置
create-ai-config - 为每个智能体的角色设置合适的模型和提示词变体
- 使用验证每个配置是否存在
get-ai-config
Step 3: Create the Graph
步骤3:创建图
Use with:
create-agent-graph- -- the project containing the AI Configs
projectKey - -- unique identifier for the graph
key - -- human-readable display name
name - (optional) -- explain the graph's purpose
description - -- the entry-point AI Config key
rootConfigKey - -- array of connections between configs
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"}
}
]
}使用时需提供以下参数:
create-agent-graph- —— 包含AI Config的项目密钥
projectKey - —— 图的唯一标识符
key - —— 易读的显示名称
name - (可选)—— 说明图的用途
description - —— 作为入口点的AI Config密钥
rootConfigKey - —— 配置间连接的数组
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:验证
- Use to confirm the graph was created with the correct structure
get-agent-graph - Verify edges connect the right source and target configs
- Check that the root config key matches the intended entry point
- 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
- 使用确认图已按正确结构创建
get-agent-graph - 验证边是否连接了正确的源和目标配置
- 检查根配置密钥是否与预期的入口点一致
- 确认需要交接数据的边上已包含该数据
报告结果:
- 已创建包含N个节点和M条边的图
- 根配置设置正确
- 所有边已验证
Edge Cases
边缘情况
| Situation | Action |
|---|---|
| Config doesn't exist yet | Create it first with |
| Circular routing | Allowed but warn user — ensure there's a termination condition in the agent logic |
| Single-node graph | Valid but unusual — consider if a graph is actually needed |
| Updating edges | Use |
| 情况 | 操作 |
|---|---|
| 配置尚未存在 | 在图中引用之前,先使用 |
| 循环路由 | 允许但需向用户警告——确保智能体逻辑中包含终止条件 |
| 单节点图 | 有效但不常见——考虑是否真的需要使用图 |
| 更新边 | 使用 |
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节点存在之前创建图
- 当智能体需要从先前的智能体获取上下文时,不要遗漏交接数据
- 不要创建过于复杂的图——从简单开始,根据需要添加节点
- 在不清楚图是否正用于智能体工作流的情况下,不要删除图